My check_snmp command doesn´t work for switch monitoring

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
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: My check_snmp command doesn´t work for switch monitoring

Post by tgriep »

I found the name of the OID that our Cisco Switch is using, try running this command to get the uptime from your switch.

Code: Select all

snmpget  -v 2c <CiscoIP> -c public sysUpTimeInstance
If that fails, run this command and post back the output.

Code: Select all

snmpwalk  -v 2c <CiscoIP> -c public |grep -i time
Be sure to check out our Knowledgebase for helpful articles and solutions!
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: My check_snmp command doesn´t work for switch monitoring

Post by Jessuzz94 »

Well, it doesnt work :| , i dont understand do i need to put some parameters in the definition of the check_command?,
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: My check_snmp command doesn´t work for switch monitoring

Post by Jessuzz94 »

aaah!! now it change, in the nagios web interface the CRITICAL error - plugin timed out while executing system call o changed to UNKNOWN and it says: No OIDs specified
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: My check_snmp command doesn´t work for switch monitoring

Post by Jessuzz94 »

tgriep sorry, but, i need to put the sysUpTimeInstance in the check_command too?
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: My check_snmp command doesn´t work for switch monitoring

Post by Jessuzz94 »

the command: snmpwalk -v 2c <CiscoIP> -c public |grep -i time

shoes me timeticks

iso3.6.1.2.1.1.3.0 timeticks: (2596) 0:00:25:96
iso3.6.1.2.1.1.3.0 timeticks: (2595) 0:00:29:55

and more like that
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: My check_snmp command doesn´t work for switch monitoring

Post by jdalrymple »

Did you ever get SNMP to properly load your MIBS? They aren't explicitly necessary, but now would be a good time to get all that working:
Jessuzz94 wrote:the seccond command "snmpget -v 2c -c public <ciscoIP> .1.3.6.1.2.1.1.3.0" throws me:

Code: Select all

iso.3.6.1.2.1.1.3.0 = Timeticks: (530168) 1:28:21.68
This means SNMP is working, but since it didn't work when you specified the object name - there is a problem loading the MIBs.

Did you ever:

Code: Select all

snmptranslate -Dinit_mib .1.3 2>&1 | grep MIBDIR
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: My check_snmp command doesn´t work for switch monitoring

Post by tgriep »

It look like you are missing the MIB files for checking uptimeof the switch.
You could either re-install the net-snmp software or you could download this file
http://www.net-snmp.org/docs/mibs/DISMAN-EVENT-MIB.txt
and save it in this folder

Code: Select all

/usr/share/snmp/mibs/
After you get the MIB installed, you would use this command to check for uptime of your switch.

Code: Select all

snmpget  -v 2c <CiscoIP> -c public sysUpTimeInstance
Be sure to check out our Knowledgebase for helpful articles and solutions!
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: My check_snmp command doesn´t work for switch monitoring

Post by Jessuzz94 »

Okay I will do, but tomorrow because i am not in the server because im in practice of university on a business and i cant connect to the nagios server remotely from my home. but yes i will do it tomorrow, very thanks really!, will give you the results of the commands.

PD: sorry for my bad english.
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: My check_snmp command doesn´t work for switch monitoring

Post by Jessuzz94 »

Hi tgriep, i did it, i download the mib and move it to the mibs directory, but i have something bad, i put the command you gave me to test the uptime of the switch and i have this error:

sysUpTimeInstance: Unknown Object Identifier (Sub-id not found): (top) -> sysUpTimeInstance

this error appears every time i put a command like this. whats wrong?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: My check_snmp command doesn´t work for switch monitoring

Post by tgriep »

For some reason your switch isn't reporting the OID correctly. You use the following to get the UPTime in place of the other command.

Code: Select all

snmpget -v 2c -c public <ciscoIP> .1.3.6.1.2.1.1.3.0
Could you run the following and post the output back here?

Code: Select all

ll /usr/share/snmp/mibs/
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked