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.
root@tgcs017:/usr/local/nagios/libexec# ./check_snmp_cisco.pl -H 10.2.8.4 -C public -I GigabitEthernet1/1/21
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
IF-MIB::ifOperStatus.: Unknown Object Identifier (Index out of range: (ifIndex))
Unknown state for GigabitEthernet1/1/21 : check your -s state syntax
Add the -S up
root@tgcs017:/usr/local/nagios/libexec# ./check_snmp_cisco.pl -H 10.2.8.4 -C public -I GigabitEthernet1/1/21 -S up
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
IF-MIB::ifOperStatus.: Unknown Object Identifier (Index out of range: (ifIndex))
Unknown state for GigabitEthernet1/1/21 : check your -s state syntax
The other check does this now
root@tgcs017:/usr/local/nagios/libexec# ./check_snmp_cisco.sh -H 10.2.8.4 -C public -i GigabitEthernet1/1/21
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Can not get Interface Status of port
This is the original check I was trying it shows this now
root@tgcs017:/usr/local/nagios/libexec# ./check_cisco.pl -h 10.2.8.4 -c public -i GigabitEthernet1/1/21 -s down
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Interface not found : please check your syntax for this device
root@tgcs017:/usr/local/nagios/libexec# ./check_snmp_cisco.pl -H 10.2.8.4 -C public -I 'GigabitEthernet1/1/21' -s up
Unknown option: s
IF-MIB::ifOperStatus.: Unknown Object Identifier (Index out of range: (ifIndex))
Unknown state for GigabitEthernet1/1/21 : check your -s state syntax
root@tgcs017:/usr/local/nagios/libexec# ./check_snmp_cisco.pl -H 10.2.8.4 -C public -I 'GigabitEthernet1/1/21' -S up
IF-MIB::ifOperStatus.: Unknown Object Identifier (Index out of range: (ifIndex))
Unknown state for GigabitEthernet1/1/21 : check your -s state syntax
root@tgcs017:/usr/local/nagios/libexec# ./check_snmp_cisco.pl -h
Hostname/address not specified
Usage: check_cisco_snmp -H ip -C community -I interface -S state (optional)
or
Usage: check_cisco_snmp -h for help.
root@tgcs017:/usr/local/nagios/libexec# ./check_snmp_cisco.pl -H 10.2.8.4 -C public -i 'GigabitEthernet1/1/21' -s up
Unknown option: i
Unknown option: s
Interface not specified
Usage: check_cisco_snmp -H ip -C community -I interface -S state (optional)
root@tgcs017:/usr/local/nagios/libexec# ./check_snmp_cisco.sh -H 10.2.8.4 -C public -i GigabitEthernet1/1/21
Can not get Interface Status of port
root@tgcs017:/usr/local/nagios/libexec# ./check_snmp_cisco.sh -H 10.2.8.4 -C public -i 'GigabitEthernet1/1/21'
Can not get Interface Status of port
root@tgcs017:/usr/local/nagios/libexec# ./check_snmp_cisco.sh -h
check_snmp_cisco.sh version 1.0
The nagios plugins come with ABSOLUTELY NO WARRANTY.
You may redistribute copies of the plugins under the terms of the GNU General Public License v2.
-H ADDRESS
Name or IP address of host (default: 127.0.0.1)
-C STRING
Community name for the host's SNMP agent (default: public)
-i INTERFACE
Interface to check: Fa0/15
-w INTEGER
Warning level for consummable in percent (default: down)
-c INTEGER
Critical level for consummable in percent (default: unknown)
-h
Print this help screen
-V
Print version and license information
This plugin uses the 'snmpget' command and 'snmpwalk' command included with the NET-SNMP package.
root@tgcs017:/usr/local/nagios/libexec# ./check_cisco.pl -h 10.2.8.4 -c public -i GigabitEthernet1/1/21 -s down
Interface not found : please check your syntax for this device
root@tgcs017:/usr/local/nagios/libexec# ./check_cisco.pl -h 10.2.8.4 -c public -i "GigabitEthernet1/1/21" -s down
Interface not found : please check your syntax for this device
root@tgcs017:/usr/local/nagios/libexec# ./check_cisco.pl -h 10.2.8.4 -c public -i 'GigabitEthernet1/1/21' -s down
Interface not found : please check your syntax for this device
root@tgcs017:/usr/local/nagios/libexec#
Scott
Good catch event with glasses on I missed that LOL
root@tgcs017:/usr/local/nagios/libexec# ./check_cisco.pl -h 10.2.8.4 -c public -i GigabitEthernet1/0/21 -s down
GigabitEthernet1/0/21 should not be up
root@tgcs017:/usr/local/nagios/libexec# ./check_cisco.pl -h 10.2.8.4 -c public -i GigabitEthernet1/0/21 -s up
GigabitEthernet1/0/21 up: , LastChanges: (49480) 0:08:14.80, Traffic in : 2600355167 octets, out: 1999632072 octets
Looks like it is working now will add to the Nagios config and see what happens
kwhogster wrote:Scott
Good catch event with glasses on I missed that LOL
root@tgcs017:/usr/local/nagios/libexec# ./check_cisco.pl -h 10.2.8.4 -c public -i GigabitEthernet1/0/21 -s down
GigabitEthernet1/0/21 should not be up
root@tgcs017:/usr/local/nagios/libexec# ./check_cisco.pl -h 10.2.8.4 -c public -i GigabitEthernet1/0/21 -s up
GigabitEthernet1/0/21 up: , LastChanges: (49480) 0:08:14.80, Traffic in : 2600355167 octets, out: 1999632072 octets
Looks like it is working now will add to the Nagios config and see what happens