centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
311 stars 273 forks source link

check_centreon_snmp_memory never exclude swap #705

Closed imnotme closed 7 years ago

imnotme commented 7 years ago

Hi, The "-S" option from the "check_centreon_snmp_memory" plugin seems to not working :

[root@monitoring plugins]# ./check_centreon_snmp_memory -H 192.168.0.1 -C public -S Total memory used : 13% ram used : 98%, swap used 0% | used=137334784o size=1051549696o [root@monitoring plugins]# ./check_centreon_snmp_memory -H 192.168.0.1 -C public -S -w 80 -c 90 Total memory used : 13% ram used : 98%, swap used 0% | used=137453568o size=1051549696o [root@monitoring plugins]# ./check_centreon_snmp_memory -H 192.168.0.1 -C public -w 80 -c 90 Total memory used : 13% ram used : 98%, swap used 0% | used=137445376o size=1051549696o [root@monitoring plugins]# ./check_centreon_snmp_memory -H 192.168.0.1 -C public -w 10 -c 90 Threshold (10%) excedeed : total memory used : 13%, ram used : 98%, swap used 0% | used=137449472o size=1051549696o

Plugins version : [root@monitoring plugins]# ./check_centreon_snmp_memory --version Undefined subroutine &main::print_revision called at ./check_centreon_snmp_memory line 99.

Note I have to use this one since the default linux plugin for memory is not working either, I think it's a server issue for this one since the request for .1.3.6.1.4.1.2021.4.13.0 is returning "[noSuchObject]". Does it exit a switch in this plugin to not requesting this OID ?

[root@monitoring plugins]# /usr/lib/centreon/plugins/centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=memory --no-swap --hostname=192.168.0.1 --snmp-version='2c' --snmp-community='public' UNKNOWN: SNMP GET Request : Timeout

tcpdump : GetResponse(104) .1.3.6.1.4.1.2021.4.5.0=1026904 .1.3.6.1.4.1.2021.4.6.0=31112 .1.3.6.1.4.1.2021.4.13.0=[noSuchObject] .1.3.6.1.4.1.2021.4.14.0=11612 .1.3.6.1.4.1.2021.4.15.0=866764

garnier-quentin commented 7 years ago

Could you test with following command:

/usr/lib/centreon/plugins/centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=memory --no-swap --hostname=192.168.0.1 --snmp-version='2c' --snmp-community='public' --subsetleef=1
imnotme commented 7 years ago

Timeout, and tcpdump : monitoring.39054 > 192.168.0.1.161: C=public GetRequest(30) .1.3.6.1.4.1.2021.4.5.0 192.168.0.1.161 > monitoring.39054: C=public GetResponse(33) .1.3.6.1.4.1.2021.4.5.0=1026904 monitoring.39054 > 192.168.0.1.161: C=public GetRequest(30) .1.3.6.1.4.1.2021.4.6.0 192.168.0.1.161 > monitoring.39054: C=public GetResponse(32) .1.3.6.1.4.1.2021.4.6.0=22152 monitoring.39054 > 192.168.0.1.161: C=public GetRequest(30) .1.3.6.1.4.1.2021.4.13.0 192.168.0.1.161 > monitoring.39054: C=public GetResponse(30) .1.3.6.1.4.1.2021.4.13.0=[noSuchObject] monitoring.39054 > 192.168.0.1.161: C=public GetRequest(30) .1.3.6.1.4.1.2021.4.13.0 192.168.0.1.161 > monitoring.39054: C=public GetResponse(30) .1.3.6.1.4.1.2021.4.13.0=[noSuchObject] monitoring.39054 > 192.168.0.1.161: C=public GetRequest(30) .1.3.6.1.4.1.2021.4.13.0 192.168.0.1.161 > monitoring.39054: C=public GetResponse(30) .1.3.6.1.4.1.2021.4.13.0=[noSuchObject] monitoring.39054 > 192.168.0.1.161: C=public GetRequest(30) .1.3.6.1.4.1.2021.4.13.0 192.168.0.1.161 > monitoring.39054: C=public GetResponse(30) .1.3.6.1.4.1.2021.4.13.0=[noSuchObject] monitoring.35245 > 192.168.0.1.161: C=public GetBulk(30) N=0 M=50 .1.3.6.1.2.1.25.3.3.1.2 192.168.0.1.161 > monitoring.35245: C=public GetResponse(966) .1.3.6.1.2.1.25.3.3.1.2.768=2 .1.3.6.1.2.1.25.3.4.1.1.1025=1 .1.3.6.1.2.1.25.3.4.1.1.1026=2 .1.3.6.1.2.1.25.3.8.1.1.1=1 .1.3.6.1.2.1.25.3.8.1.2.1="/" .1.3.6.1.2.1.25.3.8.1.3.1="" .1.3.6.1.2.1.25.3.8.1.4.1=.1.3.6.1.2.1.25.3.9.23 .1.3.6.1.2.1.25.3.8.1.5.1=1 .1.3.6.1.2.1.25.3.8.1.6.1=1 .1.3.6.1.2.1.25.3.8.1.7.1=31 .1.3.6.1.2.1.25.3.8.1.8.1=00_00_01_01_00_00_00_00 .1.3.6.1.2.1.25.3.8.1.9.1=00_00_01_01_00_00_00_00 .1.3.6.1.2.1.25.4.2.1.1.1=1 .1.3.6.1.2.1.25.4.2.1.1.2=2 .1.3.6.1.2.1.25.4.2.1.1.3=3 .1.3.6.1.2.1.25.4.2.1.1.4=4 .1.3.6.1.2.1.25.4.2.1.1.5=5 .1.3.6.1.2.1.25.4.2.1.1.6=6 .1.3.6.1.2.1.25.4.2.1.1.7=7 .1.3.6.1.2.1.25.4.2.1.1.8=8 .1.3.6.1.2.1.25.4.2.1.1.9=9 .1.3.6.1.2.1.25.4.2.1.1.10=10 .1.3.6.1.2.1.25.4.2.1.1.11=11 .1.3.6.1.2.1.25.4.2.1.1.12=12 .1.3.6.1.2.1.25.4.2.1.1.13=13 .1.3.6.1.2.1.25.4.2.1.1.14=14 .1.3.6.1.2.1.25.4.2.1.1.15=15 .1.3.6.1.2.1.25.4.2.1.1.16=16 .1.3.6.1.2.1.25.4.2.1.1.17=17 .1.3.6.1.2.1.25.4.2.1.1.18=18 .1.3.6.1.2.1.25.4.2.1.1.19=19 .1.3.6.1.2.1.25.4.2.1.1.21=21 .1.3.6.1.2.1.25.4.2.1.1.22=22 .1.3.6.1.2.1.25.4.2.1.1.23=23 .1.3.6.1.2.1.25.4.2.1.1.24=24 .1.3.6.1.2.1.25.4.2.1.1.25=25 .1.3.6.1.2.1.25.4.2.1.1.26=26 .1.3.6.1.2.1.25.4.2.1.1.206=206 .1.3.6.1.2.1.25.4.2.1.1.207=207 .1.3.6.1.2.1.25.4.2.1.1.208=208 .1.3.6.1.2.1.25.4.2.1.1.209=209 .1.3.6.1.2.1.25.4.2.1.1.241=241 .1.3.6.1.2.1.25.4.2.1.1.250=250 .1.3.6.1.2.1.25.4.2.1.1.251=251 .1.3.6.1.2.1.25.4.2.1.1.298=298 .1.3.6.1.2.1.25.4.2.1.1.413=413 .1.3.6.1.2.1.25.4.2.1.1.423=423 .1.3.6.1.2.1.25.4.2.1.1.480=480 .1.3.6.1.2.1.25.4.2.1.1.898=898 .1.3.6.1.2.1.25.4.2.1.1.930=930 monitoring.58826 > 192.168.0.1.161: C=public GetRequest(65) .1.3.6.1.4.1.2021.10.1.3.1 .1.3.6.1.4.1.2021.10.1.3.2 .1.3.6.1.4.1.2021.10.1.3.3 192.168.0.1.161 > monitoring.58826: C=public GetResponse(77) .1.3.6.1.4.1.2021.10.1.3.1="0.06" .1.3.6.1.4.1.2021.10.1.3.2="0.02" .1.3.6.1.4.1.2021.10.1.3.3="0.00" monitoring.39054 > 192.168.0.1.161: C=public GetRequest(30) .1.3.6.1.4.1.2021.4.13.0 192.168.0.1.161 > monitoring.39054: C=public GetResponse(30) .1.3.6.1.4.1.2021.4.13.0=[noSuchObject] monitoring.39054 > 192.168.0.1.161: C=public GetRequest(30) .1.3.6.1.4.1.2021.4.13.0 192.168.0.1.161 > monitoring.39054: C=public GetResponse(30) .1.3.6.1.4.1.2021.4.13.0=[noSuchObject]

garnier-quentin commented 7 years ago

Which version of net-snmp and linux do you use ? It shouldn't timeout if the OID is not present.

imnotme commented 7 years ago

Target is Debian 6 (yeah i already know) and net-snmp 5.4.3

(oopsie fat fingered the close button)

garnier-quentin commented 7 years ago

I'll try to install that version. But it seems like a net-snmp bug.

imnotme commented 7 years ago

fwiw, monitoring server use version 5.5 of net-snmp (CES iso, up to date)

garnier-quentin commented 7 years ago

It's not a problem about the client i think.

imnotme commented 7 years ago

Ok. Thanks for quick answers by the way :)

Have you checked the "-S" option from the "check_centreon_snmp_memory" plugin, or is this one deprecated?

garnier-quentin commented 7 years ago

This one is completely deprecated.

garnier-quentin commented 7 years ago

Do you use docker ? https://github.com/centreon/centreon-plugins/issues/708

But someone had the same kind of problem.

imnotme commented 7 years ago

No, no docker used.

On the target server :

snmpget -v2c -c public 127.0.0.1 .1.3.6.1.4.1.2021.4.13.0 iso.3.6.1.4.1.2021.4.13.0 = No Such Object available on this agent at this OID

snmpwalk -v2c -c public 127.0.0.1 .1.3.6.1.4.1.2021.4 iso.3.6.1.4.1.2021.4.1.0 = INTEGER: 0 iso.3.6.1.4.1.2021.4.2.0 = STRING: "swap" iso.3.6.1.4.1.2021.4.3.0 = INTEGER: 0 iso.3.6.1.4.1.2021.4.4.0 = INTEGER: 0 iso.3.6.1.4.1.2021.4.5.0 = INTEGER: 1026904 iso.3.6.1.4.1.2021.4.6.0 = INTEGER: 23788 iso.3.6.1.4.1.2021.4.11.0 = INTEGER: 23788 iso.3.6.1.4.1.2021.4.12.0 = INTEGER: 16000 iso.3.6.1.4.1.2021.4.14.0 = INTEGER: 14224 iso.3.6.1.4.1.2021.4.15.0 = INTEGER: 872052 iso.3.6.1.4.1.2021.4.100.0 = INTEGER: 1 iso.3.6.1.4.1.2021.4.101.0 = STRING: "Running out of swap space (0)"

Found this : https://sourceforge.net/p/net-snmp/bugs/2250/

Edit before posting : i followed the get-response packet, and... blocked by some firewall between probe and probed. Once firewall issue resolved, it worked using the "centreon_linux_snmp.pl" plugins. For instance, check_centreon_snmp_memory still don't care about the "-S" option ;)

garnier-quentin commented 7 years ago

Ok. So the problem is solved. Great!