Page 1 of 2

snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Posted: Fri Apr 05, 2019 6:51 am
by Ulfandu
Hello.

I've recently acquired an Ubiquiti EdgeSwitch 16 XG and I'm trying to monitor it's CPU utilization. At first, I did an snmpwalk on it to find the relevant OIDs, however I could not find them. After some Google-fu I found out that I had to get a relevant MIB from Ubiquiti's web page, which I did, and moved it to /usr/share/snmp/mibs and gave it similar permissions as other MIBs.

Now I'm able to fetch the CPU utilization using the following command:
snmpwalk -c testsnmp -v 2c 10.2.1.35 1.3.6.1.4.1.4413.1.1.1.1.4.9

which outputs:
SNMPv2-SMI::enterprises.4413.1.1.1.1.4.9.0 = STRING: " 5 Secs ( 13.5635%) 60 Secs ( 11.5099%) 300 Secs ( 11.6118%)"

However, for some reason I can't achieve this using the check_snmp plugin. I can cd into the plugins directory and issue the following command:
./check_snmp -H 10.2.1.35 -C testsnmp -o 1.3.6.1.4.1.4413.1.1.1.1.4.9 -m ALL -vvv

and the output is:
/usr/bin/snmpget -Le -t 10 -r 5 -m ALL -v 1 [context] [authpriv] 10.2.1.35:161 1.3.6.1.4.1.4413.1.1.1.1.4.9
CRITICAL - Plugin timed out while executing system call


For my life I can't figure out why it is not working. I have a bunch of old HP ProCurve switches which I'm also monitoring using check_snmp and they work fine. For reference, here's a command I use to check a HP switch's CPU:

./check_snmp -H 10.2.1.25 -o .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 -C testsnmp

When using check_snmp to fetch the Ubiquiti's CPU status I'm using the -m switch to specify all the MIBS. I've also tried issuing the command without the -m part but it still doesn't work.

Can anybody help out? I must be missing something very obvious. Thanks in advance for the help!

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Posted: Fri Apr 05, 2019 10:37 am
by scottwilkerson
You aren't specifying the SNMP version, add the following to the command

Code: Select all

-P 2c

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Posted: Sun Apr 07, 2019 11:26 am
by Ulfandu
I tried that. Here's the output:

Code: Select all

[root@nagios libexec]# ./check_snmp -H 10.2.1.35 -o 1.3.6.1.4.1.4413.1.1.1.1.4.9 -C testsnmp -P 2c -m ALL -vvv
/usr/bin/snmpget -Le -t 10 -r 5 -m ALL -v 2c [context] [authpriv] 10.2.1.35:161 1.3.6.1.4.1.4413.1.1.1.1.4.9
CRITICAL - Plugin timed out while executing system call

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Posted: Mon Apr 08, 2019 7:15 am
by scottwilkerson
Try

Code: Select all

./check_snmp -H 10.2.1.35 -o 1.3.6.1.4.1.4413.1.1.1.1.4.9.0 -C testsnmp -P 2c -m ALL -vvv
when you did the snmpwalk you started at

Code: Select all

1.3.6.1.4.1.4413.1.1.1.1.4.9
but got a result for

Code: Select all

1.3.6.1.4.1.4413.1.1.1.1.4.9.0

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Posted: Tue Apr 09, 2019 4:24 am
by Ulfandu

Code: Select all

[root@nagios libexec]# ./check_snmp -H 10.2.1.35 -o 1.3.6.1.4.1.4413.1.1.1.1.4.9.0 -C testsnmp -P 2c -m ALL -vvv
/usr/bin/snmpget -Le -t 10 -r 5 -m ALL -v 2c [context] [authpriv] 10.2.1.35:161 1.3.6.1.4.1.4413.1.1.1.1.4.9.0
CRITICAL - Plugin timed out while executing system call
I have no idea why snmpwalk returns it with a zero at the end of the OID.

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Posted: Tue Apr 09, 2019 7:39 am
by scottwilkerson
Can you run this?

Code: Select all

snmpget -v 2c -c testsnmp 10.2.1.35 1.3.6.1.4.1.4413.1.1.1.1.4.9.0

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Posted: Thu Apr 11, 2019 4:17 am
by Ulfandu
That works:

Code: Select all

[root@nagios /]# snmpget -v 2c -c testsnmp 10.2.1.35 1.3.6.1.4.1.4413.1.1.1.1.4.9.0
SNMPv2-SMI::enterprises.4413.1.1.1.1.4.9.0 = STRING: "    5 Secs (  9.4009%)   60 Secs ( 11.8000%)  300 Secs ( 11.8176%)"

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Posted: Thu Apr 11, 2019 8:19 am
by scottwilkerson
Ok, now lets run this using the same OID

Code: Select all

./check_snmp -H 10.2.1.25 -o 1.3.6.1.4.1.4413.1.1.1.1.4.9.0 -C testsnmp

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Posted: Fri Apr 12, 2019 7:40 am
by Ulfandu

Code: Select all

./check_snmp -H 10.2.1.35 -o 1.3.6.1.4.1.4413.1.1.1.1.4.9.0 -C testsnmp -vvv
/usr/bin/snmpget -Le -t 10 -r 5 -m '' -v 1 [context] [authpriv] 10.2.1.35:161 1.3.6.1.4.1.4413.1.1.1.1.4.9.0
iso.3.6.1.4.1.4413.1.1.1.1.4.9.0 = STRING: "    5 Secs ( 12.7170%)   60 Secs ( 12.5264%)  300 Secs ( 12.2709%)"
Processing oid 1 (line 1)
  oidname: iso.3.6.1.4.1.4413.1.1.1.1.4.9.0
  response: STRING: "    5 Secs ( 12.7170%)   60 Secs ( 12.5264%)  300 Secs ( 12.2709%)"
SNMP OK - "    5 Secs ( 12.7170%)   60 Secs ( 12.5264%)  300 Secs ( 12.2709%)" |
Thanks! It seems to work now.

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Posted: Fri Apr 12, 2019 7:45 am
by Ulfandu
Hmm this is strange. I put the working command into switches-object's configuration and it doesn't work. Here is the CPU service check for the Ubiquiti switch:

Code: Select all

# Check CPU utilization
define service{
    use                     generic-service
    host_name               net-sw-6
    service_description     CPU Utilization
    check_command           check_snmp!-C testsnmp -o 1.3.6.1.4.1.4413.1.1.1.1.4.9.0
}
And in Nagios' web management I get the following error:
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.4.1.4413.1.1.1.1.4.9.0