snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
Ulfandu
Posts: 26
Joined: Thu Jun 14, 2018 4:53 am

snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post by scottwilkerson »

You aren't specifying the SNMP version, add the following to the command

Code: Select all

-P 2c
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
Ulfandu
Posts: 26
Joined: Thu Jun 14, 2018 4:53 am

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
Ulfandu
Posts: 26
Joined: Thu Jun 14, 2018 4:53 am

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
Ulfandu
Posts: 26
Joined: Thu Jun 14, 2018 4:53 am

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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%)"
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
Ulfandu
Posts: 26
Joined: Thu Jun 14, 2018 4:53 am

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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.
Last edited by Ulfandu on Fri Apr 12, 2019 10:26 am, edited 1 time in total.
User avatar
Ulfandu
Posts: 26
Joined: Thu Jun 14, 2018 4:53 am

Re: snmpwalk works on EdgeSwitch 16 XG but check_snmp fails

Post 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
Locked