monitor Cisco CPU utilisation with SNMP

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.
Locked
ramil85
Posts: 7
Joined: Thu Feb 26, 2015 2:04 am

monitor Cisco CPU utilisation with SNMP

Post by ramil85 »

i've activated SNMP protocol on cisco switch. And from cisco site i found object id for cpu:
http://www.cisco.com/c/en/us/support/do ... -snmp.html

from my linux i can receive below results

Code: Select all

ramil@HP:~$ snmpwalk -v2c -c public 172.16.110.1 .1.3.6.1.4.1.9.9.109.1.1.1.1.5
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.5.1 = Gauge32: 0
but when i try to monitor it from nagios 3.x web
with configurations in /etc/nagios/objects/switch.cfg

Code: Select all

define service{
    use   generic-service
    host_name switch1
    service_description       5 min CPU Average
    check_command           check_snmp!-C public -o .1.3.6.1.4.1.9.9.109.1.1.1.1.5
}
i cant see anything on web interface.
Could you help me with this configuration?!

Thanks in advance.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: monitor Cisco CPU utilisation with SNMP

Post by jdalrymple »

When you say
i cant see anything on web interface.
Do you mean you can't see the service showing up at all, or do you mean that the service shows up but there is no data returning from the service check?

If the former, have you reloaded the Nagios config?

Code: Select all

/etc/init.d/nagios reload
If the latter, can you post the results you do get back? There should be an error included.
ramil85
Posts: 7
Joined: Thu Feb 26, 2015 2:04 am

Re: monitor Cisco CPU utilisation with SNMP

Post by ramil85 »

jdalrymple wrote: Do you mean you can't see the service showing up at all, or do you mean that the service shows up but there is no data returning from the service check?
i mean it shows up but there is no data returning from the service check.
jdalrymple wrote: If the former, have you reloaded the Nagios config?
i restart it

Code: Select all

/etc/init.d/nagios restart
jdalrymple wrote: If the latter, can you post the results you do get back? There should be an error included.
yes

Code: Select all

External command error. Timeout: No Response from 172.16.110.1:161
but this switch is available. PING on web interface is green.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: monitor Cisco CPU utilisation with SNMP

Post by jdalrymple »

Looks good,

I guess to troubleshoot it further we should make sure it runs properly when executed from the command line using the check_snmp plugin instead of snmpwalk:

Code: Select all

/usr/lib64/nagios/plugins/check_snmp -H 172.16.110.1 -C public -o .1.3.6.1.4.1.9.9.109.1.1.1.1.5
If that doesn't work let's throw the version in:

Code: Select all

/usr/lib64/nagios/plugins/check_snmp -H 172.16.110.1 -C public -P 2c -o .1.3.6.1.4.1.9.9.109.1.1.1.1.5
For reference it looks like you have a yum package of Nagios so I adjusted the plugins path using best guess, check_snmp may actually be located somewhere besides where I specified.

Let us know if that helps.
ramil85
Posts: 7
Joined: Thu Feb 26, 2015 2:04 am

Re: monitor Cisco CPU utilisation with SNMP

Post by ramil85 »

jdalrymple wrote: I guess to troubleshoot it further we should make sure it runs properly when executed from the command line using the check_snmp plugin instead of snmpwalk:

Code: Select all

/usr/lib64/nagios/plugins/check_snmp -H 172.16.110.1 -C public -o .1.3.6.1.4.1.9.9.109.1.1.1.1.5
this command return:

Code: Select all

External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
jdalrymple wrote:

Code: Select all

/usr/lib64/nagios/plugins/check_snmp -H 172.16.110.1 -C public -P 2c -o .1.3.6.1.4.1.9.9.109.1.1.1.1.5
this command return:

Code: Select all

SNMP OK - = No Such Instatnce currently exists at this OID
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: monitor Cisco CPU utilisation with SNMP

Post by jdalrymple »

OOoops, sorry I didn't tranaslate the walk output to a proper get. Change your service definition to the following - note the additional ".1" at the end of check_command. I bet that fixes it.

Code: Select all

define service{
    use   generic-service
    host_name switch1
    service_description       5 min CPU Average
    check_command           check_snmp!-C public -o .1.3.6.1.4.1.9.9.109.1.1.1.1.5.1
}
ramil85
Posts: 7
Joined: Thu Feb 26, 2015 2:04 am

Re: monitor Cisco CPU utilisation with SNMP

Post by ramil85 »

Thanks.
it works now.
Locked