Home Assistant Community Add-on: Glances

HI guys. Can someone tell me if it’s possible to export the glances sensor info out to mqtt and if so how? I have it outputting into influxdb already so maybe there’s a way out there, but would rather go straight from glances. thx

A while ago I broke some things when updating my Debian host and docker. Now I cannot run Glances anymore, it throws the following error:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 259, in _raise_for_status
    response.raise_for_status()
  File "/usr/lib/python3.8/site-packages/requests/models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http+docker://localhost/v1.41/images/7088e20389854f7641923dbb814ac3c6b635609a6cbe5b0c7f3d24f77052d301/json
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/bin/glances", line 11, in <module>
    load_entry_point('Glances==3.1.5', 'console_scripts', 'glances')()
  File "/usr/lib/python3.8/site-packages/glances/__init__.py", line 143, in main
    start(config=config, args=args)
  File "/usr/lib/python3.8/site-packages/glances/__init__.py", line 108, in start
    mode = GlancesMode(config=config, args=args)
  File "/usr/lib/python3.8/site-packages/glances/webserver.py", line 41, in __init__
    self.stats.update()
  File "/usr/lib/python3.8/site-packages/glances/stats.py", line 234, in update
    self._plugins[p].update()
  File "/usr/lib/python3.8/site-packages/glances/plugins/glances_plugin.py", line 925, in wrapper
    ret = fct(self, *args, **kw)
  File "/usr/lib/python3.8/site-packages/glances/plugins/glances_plugin.py", line 935, in wrapper
    ret = fct(*args, **kw)
  File "/usr/lib/python3.8/site-packages/glances/plugins/glances_docker.py", line 221, in update
    container_stats['Image'] = container.image.tags
  File "/usr/lib/python3.8/site-packages/docker/models/containers.py", line 40, in image
    return self.client.images.get(image_id.split(':')[1])
  File "/usr/lib/python3.8/site-packages/docker/models/images.py", line 316, in get
    return self.prepare_model(self.client.api.inspect_image(name))
  File "/usr/lib/python3.8/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/docker/api/image.py", line 245, in inspect_image
    return self._result(
        File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 265, in _result
    self._raise_for_status(response)
  File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 261, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/lib/python3.8/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.ImageNotFound: 404 Client Error: Not Found ("no such image: 7088e20389854f7641923dbb814ac3c6b635609a6cbe5b0c7f3d24f77052d301: No such image: sha256:7088e20389854f7641923dbb814ac3c6b635609a6cbe5b0c7f3d24f77052d301")
Terminated

Completely removing Glances and reinstalling doesn’t seem to work. Anyone any idea?

1 Like

I had the same problem. i was running a docker image with the same name as the docker contianer in the glances error in your case 7088e20389854f7641923dbb814ac3c6b635609a6cbe5b0c7f3d24f77052d301 look in docker/portianer for a container that matches that sting in your error log. when you find it recreate that container. now check if the contrainer got a different string. most likely it will. now reinstall glances and try again.

Hiyas,

Is it possible to add IP addresses to the webview display in the addon?
can you just add something under the network plugins in the glances.conf?
Do I need to do a pull request for it? (i saw that somewhere when skim reading)

Glances doc pdf

# curl http://localhost:61208/api/3/ip
{'address': '192.168.0.49',
'gateway': '192.168.0.254',
'mask': '255.255.255.0',
'mask_cidr': 24,
'public_address': '88.165.169.242'}

Can anyone explain why I often see my ctx_sw in red? Supposedly it is not good but I have found old threads saying that it may not be calculated properly and therefore irrelevant. If it is calculated properly and it is relevant, can someone tell me what I need to do to not have it turn red? It is red when the number is around 5000.

My Home Assistant is running on a Lenovo M920q Tiny PC with an I7-8700T and 32GB of RAM. I’ve assigned plenty of resources to it, likely super overkill.

Anyone else getting this?

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:103
First occurred: 12:03:55 PM (2 occurrences)
Last logged: 12:04:56 PM

Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue for glances using this method at homeassistant/components/glances/__init__.py, line 125: await self.api.get_data()
Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue for glances using this method at homeassistant/components/glances/__init__.py, line 113: await self.api.get_data()

EDIT: Looks like it’s been reported:

Silly question about Glances configuration from a newbie with HA: where is it stored?

I saved what is in the configuration tab, but I can’t see it in the configuration.yaml.

I tried adding the following on configuration.yaml, but it didn’t work:

glances: !include glances.yaml

The glances.yaml is very similar to yours. I changed refresh_time to 60 to see if it was working, but after rebooting the addon, it still refreshing every 10s …

Hi, I just installed Glances on a remote windows pc. I can use my browser to show the website. I can use the curl command to get a sensor value. I added the integration to hass, filled in the ip address of the remote server and the correct (default) port. But it is not adding any sensors.
In the hass logfile I get the following errors:

2022-04-13 21:27:03 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up glances platform for sensor
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 249, in _async_setup_platform
await asyncio.shield(task)
File “/usr/src/homeassistant/homeassistant/components/glances/sensor.py”, line 50, in async_setup_entry
elif client.api.data[description.type]:
KeyError: ‘docker’

What could be the issue here?

Hello, I just had this exact same issue.
For me, the problem was that I was running glances inside of a docker container and for some reason that breaks the glances integration.
After I installed glances natively on the system, it seems to all work as expected.

Thanks for the hint. This would explain, why glances didn’t work for me as well.

However: How can I monitor an Unraid NAS with glances, if docker is not supported? With unraid, everything has to be dockerized to work, no native installs possible. Is there an alternate solution, to integrate monitoring into HA?

I’ve opened a bug report here: Glances stopped working after update to 2022.4 · Issue #70373 · home-assistant/core · GitHub

I’m not running glances in docker, but I am running home assistant in docker

The issue seems to be with the latest version of Glances. Until a fix is rolled out, try using Glances v3.2.4.2.

In the HA Gui glances can show processes (commands) running against CPU, Memory, etc.

The Glances config also has an option to turn on process_info.

This is great - but I’m wondering if this info is written to influxdb at all? If so, where can I find it?

Hm, im trying to install glances from add-on store on HASS OS, installs, but unable to start it, says needs to disable protection mode, but it does not matter is it on or off, doesnt start.

Also, after installation it is not visible in installed add-on’s page.

2023-02-11 14:47:57.013 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 145, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/hassio/addon_panel.py", line 61, in post
await _register_panel(self.hass, addon, data)
File "/usr/src/homeassistant/homeassistant/components/hassio/addon_panel.py", line 81, in _register_panel
await panel_custom.async_register_panel(
File "/usr/src/homeassistant/homeassistant/components/panel_custom/__init__.py", line 122, in async_register_panel
frontend.async_register_built_in_panel(
File "/usr/src/homeassistant/homeassistant/components/frontend/__init__.py", line 281, in async_register_built_in_panel
raise ValueError(f"Overwriting panel {panel.frontend_url_path}")
ValueError: Overwriting panel a0d7b954_glances
2023-02-11 14:48:56.893 WARNING (MainThread) [homeassistant.components.hassio] Could not fetch stats for a0d7b954_glances: Container addon_a0d7b954_glances is not running

Glances does not seem to work anymore for me.
grafik

In log file I see the following:

-----------------------------------------------------------
 Add-on: Glances
 A cross-platform system monitoring tool
-----------------------------------------------------------
 Add-on version: 0.19.0
 You are running the latest version of this add-on.
 System: Raspbian GNU/Linux 11 (bullseye)  (armv7 / raspberrypi4)
 Home Assistant Core: 2023.5.3
 Home Assistant Supervisor: 2023.04.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
INFO: Starting Glances...
Glances Web User Interface started on http://127.0.0.1:61209/
INFO: Starting NGinx...

Any idea what is the problem?

is there a way to change the interval from 60 seconds to 30 seconds or less?

Thanks,

What am I doing wrong with this addon? I run HA in proxmox, and I run this addon in HA. If I open the glances web ui in HA the integration keeps delivering sensor updates, but as soon as I leave the UI for glances the integration drops after 1 minute with the log text, Error fetching Glances: localhost data:

Is there a good way to get hdd / ssd temperature sensors recognized?
My ssd has temp sensor that worked under Debian at least.
Running on a NUC.

Has anyone been able show HA Addon Glances data on gethomepage?