nicolargo / glances

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
http://nicolargo.github.io/glances/
Other
26.95k stars 1.53k forks source link

SNMP no output #1404

Open jeremyj opened 5 years ago

jeremyj commented 5 years ago

Hello,

I'm trying to monitor a device via SNMP but I'm not getting any output, just a blank screen for a few moments.

This is the command I'm running:

glances -d --snmp-version 2c --snmp-community public --snmp-force -c 10.0.0.1

Here is the debug log: https://pastebin.com/raw/PeeZvTnU

The relevant message seems to be 2019-01-23 15:37:45,366 -- CRITICAL -- 'hostname' but I don't understand what it means.

A tcpdump shows normal flow between glances and the device:

14:51:45.397939 IP rfi_rm_0.55837 > gateway.snmp:  C="public" GetRequest(27)  system.sysName.0
14:51:45.399510 IP gateway.snmp > rfi_rm_0.55837:  C="public" GetResponse(33)  system.sysName.0="PCA-TT"
14:51:45.442036 IP rfi_rm_0.55837 > gateway.snmp:  C="public" GetRequest(27)  system.sysDescr.0
14:51:45.443467 IP gateway.snmp > rfi_rm_0.55837:  C="public" GetResponse(98)  system.sysDescr.0="Linux Teltonika-RUT955.com 3.18.44 #1 Tue Dec 11 07:38:19 UTC 2018 mips"

Software versions:

Glances v3.1.0 with psutil v5.4.8
ARMBIAN 5.60 stable Debian GNU/Linux 9 (stretch) 4.4.156-rockchip

Any help on this issue would be much appreciated.

nicolargo commented 5 years ago

Hi @jeremyj

can you give us more information about the SNMP server ? OS ? version ?

Thanks.

jeremyj commented 5 years ago

Hi @nicolargo

So this is the device I'm trying to query: https://wiki.teltonika.lt/view/RUT955

The OS is RutOS which I believe is based on OpenWRT: https://wiki.teltonika.lt/view/RutOS

and the snmp server version is:

root@Teltonika-RUT955:~# opkg list | grep snmp
teltonika-snmpd - 5.7.3-9

maybe the MIB file could be of help? https://wiki.teltonika.lt/wiki/images/e/e4/TLT-MIB_RUT9XX.txt

nicolargo commented 5 years ago

Not easy to investigate without the device...

Can you try the following command and pastebin use the result ?

$ python
>>> from pysnmp.entity.rfc3413.oneliner import cmdgen
>>> cmdGen = cmdgen.CommandGenerator()
>>> i, s, x, v = cmdGen.getCmd(cmdgen.CommunityData('public'), cmdgen.UdpTransportTarget(('10.0.0.1', 161)), '1.3.6.1.4.1.2021.11.9.0')
>>> exit()
jeremyj commented 5 years ago

Hi @nicolargo Sorry for the late reply. I tried the command as you asked:

>>> print(i)
None
>>> print(s)
0
>>> print(x)
0
>>> for name, val in v:
...    print('%s = %s' % (name.prettyPrint(), val.prettyPrint()))
... 
SNMPv2-SMI::enterprises.2021.11.9.0 = 2
>>>