glances client for DD-WRT or other openwrt routers.

611 views
Skip to first unread message

Jeff Eberl

unread,
Feb 25, 2016, 10:03:30 AM2/25/16
to Glances Users
Hey, just "discovered" glances (I'm a real Christopher Columbus here). I was hoping to get some stats from my router, and make them available to glances. I have a DD-WRT router, and optware installed, with python 2.7 installed.

Unfortunately, it doesn't do pip, and it won't be able to compile on the router.

Also, I can't see a way to install psutils.

So, I'm about to give up.

Is there a simple python only client that anyone knows about that I could run and publish some of the stuff that glances would use?

Even if it just had the CPU, Memory, and USB Stick free space, that would be a start.


This would also be useful on my arduino Yun, which uses a version of openwrt.

Nicolargo

unread,
Feb 25, 2016, 10:14:47 AM2/25/16
to Glances Users
If i understand yours needs, you want to monitor your DD-WRT router and Arduino Yum (powered by OpenWRT) using Glances. I do not think that you can install Glances directly on your devices (because Glances uses PsUtil and PsUtil should be available in order to make Glances grab the system stats).

Another solution will be to use the Glances SNMP feature. Glances can grab stats through SNMP. You nee to install all the pre-requisites (latest Glances version and the PySNMP python lib).
The run Glances with the following command line:

# glances --snmp-force -c <ip>

Where <ip> is the IP address of your
DD-WRT or Arduino.

Note: the SNMP feature is under development...

Nicolas

Jeff Eberl

unread,
Feb 25, 2016, 11:30:19 AM2/25/16
to Glances Users
That seems like it should work. 

Any tips on debugging? I think I have the snmp working: 

snmpbulkwalk -Os -c public -v 2c 10.0.2.1 iso.3.6.1.2.1.1
iso
.3.6.1.2.1.1.1.0 = STRING: "Linux router 2.6.24.111 #8612 Tue Dec 20 04:37:50 CET 2011 mips"
iso
.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10
iso
.3.6.1.2.1.1.3.0 = Timeticks: (113520) 0:18:55.20
iso
.3.6.1.2.1.1.4.0 = STRING: "root"
iso
.3.6.1.2.1.1.5.0 = STRING: "asus_rtn16"
iso
.3.6.1.2.1.1.6.0 = STRING: "Office"
iso
.3.6.1.2.1.1.7.0 = INTEGER: 9
iso
.3.6.1.2.1.1.8.0 = Timeticks: (36) 0:00:00.36
iso
.3.6.1.2.1.1.9.1.2.1 = OID: iso.3.6.1.6.3.1
iso
.3.6.1.2.1.1.9.1.2.2 = OID: iso.3.6.1.6.3.16.2.2.1
iso
.3.6.1.2.1.1.9.1.2.3 = OID: iso.3.6.1.2.1.49
iso
.3.6.1.2.1.1.9.1.2.4 = OID: iso.3.6.1.2.1.50
iso
.3.6.1.2.1.1.9.1.2.5 = OID: iso.3.6.1.2.1.4
iso
.3.6.1.2.1.1.9.1.2.6 = OID: iso.3.6.1.6.3.10.3.1.1
iso
.3.6.1.2.1.1.9.1.2.7 = OID: iso.3.6.1.6.3.11.3.1.1
iso
.3.6.1.2.1.1.9.1.2.8 = OID: iso.3.6.1.6.3.15.2.1.1
iso
.3.6.1.2.1.1.9.1.2.9 = OID: iso.3.6.1.2.1.31
iso
.3.6.1.2.1.1.9.1.3.1 = STRING: "The MIB module for SNMPv2 entities"
iso
.3.6.1.2.1.1.9.1.3.2 = STRING: "View-based Access Control Model for SNMP."
iso
.3.6.1.2.1.1.9.1.3.3 = STRING: "The MIB module for managing TCP implementations"
iso
.3.6.1.2.1.1.9.1.3.4 = STRING: "The MIB module for managing UDP implementations"
iso
.3.6.1.2.1.1.9.1.3.5 = STRING: "The MIB module for managing IP and ICMP implementations"
iso
.3.6.1.2.1.1.9.1.3.6 = STRING: "The SNMP Management Architecture MIB."
iso
.3.6.1.2.1.1.9.1.3.7 = STRING: "The MIB for Message Processing and Dispatching."
iso
.3.6.1.2.1.1.9.1.3.8 = STRING: "The management information definitions for the SNMP User-based Security Model."
iso
.3.6.1.2.1.1.9.1.3.9 = STRING: "The MIB module to describe generic objects for network interface sub-layers"
iso
.3.6.1.2.1.1.9.1.4.1 = Timeticks: (3) 0:00:00.03
iso
.3.6.1.2.1.1.9.1.4.2 = Timeticks: (3) 0:00:00.03
iso
.3.6.1.2.1.1.9.1.4.3 = Timeticks: (4) 0:00:00.04
iso
.3.6.1.2.1.1.9.1.4.4 = Timeticks: (4) 0:00:00.04
iso
.3.6.1.2.1.1.9.1.4.5 = Timeticks: (4) 0:00:00.04
iso
.3.6.1.2.1.1.9.1.4.6 = Timeticks: (4) 0:00:00.04
iso
.3.6.1.2.1.1.9.1.4.7 = Timeticks: (16) 0:00:00.16
iso
.3.6.1.2.1.1.9.1.4.8 = Timeticks: (22) 0:00:00.22
iso
.3.6.1.2.1.1.9.1.4.9 = Timeticks: (36) 0:00:00.36

But a call to glances gives me a blank screen for a few moments, then exits without a word. (glances --snmp-force -c 10.0.2.1)

glances -V
Glances v2.5.1 with psutil v4.0.0

I'd imagine it's frustrating to get support questions on bleeding edge features, but I'd like to help. I don't have 40 hours/week to work on it, but I can find some time. 

Nicolargo

unread,
Feb 25, 2016, 11:36:09 AM2/25/16
to Glances Users
Strange...

Can you run Glances with the debug mode (-d) and pastebin us the /tmp/glances.log file ?

# glances -d --snmp-version 2c --snmp-force -c <ip>

Nicolas

Jeff Eberl

unread,
Feb 25, 2016, 11:50:57 AM2/25/16
to Glances Users
Log:

2016-02-25 09:39:09,765 -- INFO -- Start Glances 2.5.1
2016-02-25 09:39:09,765 -- INFO -- CPython 2.7.6 and PSutil 4.0.0 detected
2016-02-25 09:39:09,767 -- INFO -- Read configuration file '/home/jeffe/.config/glances/glances.conf'
2016-02-25 09:39:09,767 -- INFO -- Start client mode
2016-02-25 09:39:09,774 -- DEBUG -- Try to connect to http://10.0.2.1:61209
2016-02-25 09:39:09,774 -- INFO -- Trying to grab stats by SNMP...
2016-02-25 09:39:09,775 -- WARNING -- PyStache lib not installed (action script with mustache will not work)
2016-02-25 09:39:09,792 -- DEBUG -- pymdstat library not found. Glances cannot grab RAID info.
2016-02-25 09:39:09,823 -- DEBUG -- Available plugins list: ['load', 'help', 'ip', 'memswap', 'processlist', 'uptime', 'monitor', 'percpu', 'system', 'quicklook', 'diskio', 'core', 'fs', 'raid', 'mem', 'alert', 'psutilversion', 'hddtemp', 'sensors', 'now', 'batpercent', 'network', 'processcount', 'docker', 'cpu']
2016-02-25 09:39:09,823 -- DEBUG -- Available exports modules list: []
2016-02-25 09:39:09,925 -- WARNING -- Cannot detect SNMP system name
...
2016-02-25 09:39:09,926 -- DEBUG -- Monitor list configuration detected
...
2016-02-25 09:39:10,028 -- ERROR -- Update load failed: '1.3.6.1.4.1.2021.10.1.3.1'
2016-02-25 09:39:10,028 -- DEBUG -- Plugin ip update return {}
2016-02-25 09:39:10,098 -- ERROR -- Update memswap failed: '1.3.6.1.4.1.2021.4.3.0'
2016-02-25 09:39:10,167 -- ERROR -- Update uptime failed: '1.3.6.1.2.1.1.3.0'
2016-02-25 09:39:10,265 -- ERROR -- Update system failed: '1.3.6.1.2.1.1.1.0'
2016-02-25 09:39:10,265 -- DEBUG -- Plugin quicklook update return {}
2016-02-25 09:39:10,265 -- DEBUG -- Plugin diskio update return []
2016-02-25 09:39:10,370 -- DEBUG -- Plugin fs update return []
2016-02-25 09:39:10,370 -- DEBUG -- Plugin raid update return {}
2016-02-25 09:39:10,444 -- ERROR -- Update mem failed: '1.3.6.1.4.1.2021.4.15.0'
2016-02-25 09:39:10,444 -- DEBUG -- Plugin sensors update return []
2016-02-25 09:39:10,446 -- DEBUG -- Plugin batpercent update return []
2016-02-25 09:39:10,642 -- DEBUG -- Plugin network update return []
2016-02-25 09:39:10,642 -- DEBUG -- File doesn't exist
2016-02-25 09:39:10,647 -- DEBUG -- "GET /v1.21/version HTTP/1.1" 404 72
2016-02-25 09:39:10,647 -- DEBUG -- Docker API error (404 Client Error: Not Found ("client and server don'
t have same version (client : 1.21, server: 1.18)"))
2016-02-25 09:39:10,647 -- DEBUG -- Try connection with Docker API version 1.18
2016-02-25 09:39:10,647 -- DEBUG -- File doesn't exist
2016-02-25 09:39:10,648 -- DEBUG -- "
GET /v1.18/version HTTP/1.1" 200 148
2016-02-25 09:39:10,648 -- DEBUG -- Plugin docker update return {}
2016-02-25 09:39:10,749 -- ERROR -- Update cpu failed: '1.3.6.1.4.1.2021.11.11.0'
2016-02-25 09:39:10,750 -- CRITICAL -- 'hostname'

Not sure where that CRITICAL is coming from. I did try snmpwalk'ing those codes, and got responses.
Reply all
Reply to author
Forward
0 new messages