My check_snmp command doesn´t work for switch monitoring
My check_snmp command doesn´t work for switch monitoring
Hi, i have used nagios 4 for 1 month approximately and i have done test and it works, but i have one problem with one cisco switch, it doesnt send me the UPTIME via snmp, in the nagios web interface the Upime service shows:
CRITICAL - Plugin timed out while executing system call
I have check_snmp in /usr/local/nagioslibexec
this is my configuration in nagios
in the switch.cfg:
define service{
use generic-service
host_name switchcisco
service_description Uptime
check_command check_snmp!-C public -o sysUpTime.0
}
in commands.cfg
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}
in my cisco switch i put the command "snmp-server community public ro" to enable the snmp in the switch
so, whats wrong with the service monitoring?, I hope that you can help me :c
CRITICAL - Plugin timed out while executing system call
I have check_snmp in /usr/local/nagioslibexec
this is my configuration in nagios
in the switch.cfg:
define service{
use generic-service
host_name switchcisco
service_description Uptime
check_command check_snmp!-C public -o sysUpTime.0
}
in commands.cfg
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}
in my cisco switch i put the command "snmp-server community public ro" to enable the snmp in the switch
so, whats wrong with the service monitoring?, I hope that you can help me :c
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: My check_snmp command doesn´t work for switch monitoring
Let's start by testing from the command line:
If that doesn't work lets try:
For the record, at initial glance your command and service definitions look OK.
Code: Select all
snmpget -v 2c -c public <ciscoIP> sysUpTime.0Code: Select all
snmpget -v 2c -c public <ciscoIP> .1.3.6.1.2.1.1.3.0Re: My check_snmp command doesn´t work for switch monitoring
The command "snmpget -v 2c -c public <ciscoIP> sysUpTime.0" throws me:
sysUptime.0: Unknown Object Identifier (Sub-id not found: (top) -> sysUptime)
what means?
the seccond command "snmpget -v 2c -c public <ciscoIP> .1.3.6.1.2.1.1.3.0" throws me:
iso.3.6.1.2.1.1.3.0 = Timeticks: (530168) 1:28:21.68
Do i need to install something that i mising?
sysUptime.0: Unknown Object Identifier (Sub-id not found: (top) -> sysUptime)
what means?
the seccond command "snmpget -v 2c -c public <ciscoIP> .1.3.6.1.2.1.1.3.0" throws me:
iso.3.6.1.2.1.1.3.0 = Timeticks: (530168) 1:28:21.68
Do i need to install something that i mising?
Re: My check_snmp command doesn´t work for switch monitoring
Could you run the following and upload the /tmp/walk.txt file?
Code: Select all
snmpwalk -v 2c <CiscoIP> -c public >/tmp/walk.txtBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: My check_snmp command doesn´t work for switch monitoring
i opened the /tmp/walk.txt and shows me a lot of lines of iso.3.6.1.2.1.2.2.1.x= INTEGER 1....2...3....
but in the beginning the information of my switch,
STRING "Cisco Internetwork Operating System Software
IQS/tm) .... ..... ....
STRING "testcontact"
STRING"NameofTheSwitch"
.......
......
iso 3.6..2.1.2.2.1.2.1 = STRING: "VLAN1"
iso 3.6..2.1.2.2.1.2.2 = STRING: "FastEthernet0/1"
iso 3.6..2.1.2.2.1.2.3 = STRING: "FastEthernet0/2"
iso 3.6..2.1.2.2.1.2.4 = STRING: "FastEthernet0/3"
thinks like that
but in the beginning the information of my switch,
STRING "Cisco Internetwork Operating System Software
IQS/tm) .... ..... ....
STRING "testcontact"
STRING"NameofTheSwitch"
.......
......
iso 3.6..2.1.2.2.1.2.1 = STRING: "VLAN1"
iso 3.6..2.1.2.2.1.2.2 = STRING: "FastEthernet0/1"
iso 3.6..2.1.2.2.1.2.3 = STRING: "FastEthernet0/2"
iso 3.6..2.1.2.2.1.2.4 = STRING: "FastEthernet0/3"
thinks like that
Re: My check_snmp command doesn´t work for switch monitoring
Check the file for this string
Code: Select all
sysUpTimeBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: My check_snmp command doesn´t work for switch monitoring
what is this, a command? a line in walk.txt? be more specific please :c
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: My check_snmp command doesn´t work for switch monitoring
Grab a copy of SNMPv2-MIB from somewhere (just google it, you'll find it) and place it in /usr/share/snmp/mibs then try your
command again.
If it fails
Move that MIB to one of the directories it spits out at you.
I don't think this is going to resolve your problem just yet, but it's gotta work before we move on to further troubleshoot.
Code: Select all
snmpget -v 2c -c public <ciscoIP> sysUpTime.0If it fails
Code: Select all
snmptranslate -Dinit_mib .1.3 2>&1 | grep MIBDIRI don't think this is going to resolve your problem just yet, but it's gotta work before we move on to further troubleshoot.
Re: My check_snmp command doesn´t work for switch monitoring
the SNMPv-MIB that i download is in .my and the mibs of the directory /usr/share/snmp/mibs ends in .txt
do i need to change the .my for .txt or doesnt matter?
do i need to change the .my for .txt or doesnt matter?
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: My check_snmp command doesn´t work for switch monitoring
The name of the file is entirely irrelevant, as long as it's a valid copy of the MIB