Closed nicolargo closed 2 weeks ago
There is also an error if the sensor name contains a space.
Ex: columns=system:hr_name,load:min5,cpu:total,mem:percent,memswap:percent,sensors:value:Ambient 2
venv/bin/python -m glances -C conf/glances.conf --browser
Exception in thread Thread-4 (__update_stats):
Traceback (most recent call last):
File "/usr/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
self.run()
File "/usr/lib/python3.12/threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "/home/nicolargo/dev/glances/glances/servers_list.py", line 149, in __update_stats
self.__update_stats_rest(f'{server['uri']}/api/{__apiversion__}', server)
File "/home/nicolargo/dev/glances/glances/servers_list.py", line 221, in __update_stats_rest
server[server_key] = r.json()[column['field']]
~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'value'
Corrected for both '_' and space chars in the develop branch.
Will be release in Glances 4.3.
Related to https://github.com/nicolargo/glances/issues/1289#issuecomment-2425084676