Glances not working

I’ve installed glances, and can correctly see it via http://192.168.1.53:61208

My config looks like this:

sensor:
  - platform: glances
    name: docker4
    host: 192.168.1.53
    resources:
      - 'disk_use_percent'
      - 'disk_use'
      - 'disk_free'
      - 'memory_use_percent'
      - ... SNIP

When I restart HASS I don’t get any errors but none of the glance servers get added either.

My entire config can be seen here if it helps: https://github.com/rossdargan/hass-config/blob/master/configuration.yaml#L79

Thanks :slight_smile:

Is your used version of glances greater than 2.3?

yeah, I just installed it.

And what release are you using?

2.9.1 (sorry took a while to figure out how to find the version!)

Works fine for me on dev with Glances v2.5.1 with psutil v4.3.0.

Does my config look correct? It’s odd as I’m not seeing any errors in the log.

Can you try to retrieve a value with the command line, please?

$ curl -X GET http://192.168.1.53:61208/api/2/mem/free

The glances sensor is basically just doing this. But as the access to the website works your server side seems to work.

hmm. That just doesn’t do anything - it gives me that ability to type stuff in and press enter but I never get a response. In the end I have to ctrl-c out.

Hmm!

That is kind of weird as I just performed the same test and got a response:

pi@raspi1:~$ curl -X GET http://192.168.1.181:61208/api/2/mem/free
{"free": 574656512}pi@raspi1:~$

Glances 2.6.2, HA 0.45.0

The only difference between my config in HA and yours is that I specified the port.

-  platform: glances
   name: RP1
   host: 192.168.1.181
   port: 61208
   resources:
     - 'disk_use_percent'
     - 'disk_use'
     - 'disk_free'
     - 'memory_use_percent'
     - 'memory_use'
     - 'memory_free'
     - 'swap_use_percent'
     - 'swap_use'
     - 'swap_free'
     - 'processor_load'
     - 'process_running'
     - 'process_total'
     - 'process_thread'
     - 'process_sleeping'

But you should get a response from the command line @fabaff gave like I did. You may want to check again to make sure it is running, maybe it went down since the last test in your browser.

Just to check, I updated both psutil and glances to the latest versions, restarted the service and checked again and I am still working.

So a reboot started the api working, but it still isn’t working in hass.

The curl command returns

{"free": 3280195584}

I’ve reduced my config to this:

sensor:
  - platform: glances
    name: docker4
    host: 192.168.1.53
    port: 61208
    resources:
      - 'memory_free'

but I still don’t see glances in states.

Are you sure you’re looking in the right place? Should be under sensor.docker4.ram_free.

Bingo. Also doh. lol.

1 Like

Yeah, weird that it’s not the same naming convention. I can see how that would throw you off.

1 Like

I am having inssues installing glances in Hassio for some reason? I want to remotely monitor a Desktop PC on my network.
Can anyone point a a noob in the right direction? I was tryingto follow the sisntall steps here, but I am not sure if i am doing something right. I can not install it on my PI.

Not sure what is going on here - can start with glances -w and
use the web interface on http://0.0.0.0:61208/
but when I try "http://IP:61208/api/2 or 3 I get file does not exist.

curl -X GET http://192.168.1.2:61208/api/2/mem/ confirms this also

<html>
    <head>
        <title>Error: 404 Not Found</title>
        <style type="text/css">
          html {background-color: #eee; font-family: sans;}
          body {background-color: #fff; border: 1px solid #ddd;
                padding: 15px; margin: 15px;}
          pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
        </style>
    </head>
    <body>
        <h1>Error: 404 Not Found</h1>
        <p>Sorry, the requested URL <tt>&#039;http://192.168.1.2:61208/api/2/mem/free&#039;</tt>
           caused an error:</p>
        <pre>File does not exist.</pre>
    </body>
</html>

Ubuntu 19.04, running HA in VE

Sorted- using version 3 requires a version entry in the config.yaml… defaults to 2 otherwise.

You can also use the following options (however, some might not be applicable): alert, amps, batpercent, cloud, core, cpu, diskio, docker, folders, fs, gpu, help, ip, irq, load, mem, memswap, network, now, percpu, ports, processcount, processlist, psutilversion, quicklook, raid, sensors, smart, system, uptime, wifi

1 Like