SNMP chcek of Cisco 3750 switch

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.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

SNMP chcek of Cisco 3750 switch

Post by kwhogster »

Nagios 4.3.4
Cisco switch 3750
SNMP agent is enabled

I found this check https://exchange.nagios.org/directory/P ... rs/details


My command

Code: Select all

define command{
        command_name check_cisco
        command_line $USER1$/check_cisco.pl -H $HOSTADDRESS$ $USER7$ -n $ARG1$ $ARG2$
}
My service

Code: Select all

# cisco.proto

define service{
        use                     generic-service
        host_name               hostname
        service_description     Check_Interface_Port_0/1
        check_command           check_cisco!-C cisco3750 -i GigabitEthernet0/1
}

Testing from command line first

/usr/local/nagios/etc/objects# /usr/local/nagios/libexec/check_cisco.pl -C cisco3750 -i GigabitEthernet1/0/21
MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
Cannot find module (IF-MIB): At line 0 in (none)
IF-MIB::ifDescr: Unknown Object Identifier
MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
Cannot find module (IF-MIB): At line 0 in (none)
IF-MIB::ifName: Unknown Object Identifier
Interface not found : please check your syntax for this device


First I thought SNMP was not on the switch

Switch>en
Password:
Switch#show snmp
Chassis: FDO1446K03S
0 SNMP packets input
0 Bad SNMP version errors
0 Unknown community name
0 Illegal operation for community name supplied
0 Encoding errors
0 Number of requested variables
0 Number of altered variables
0 Get-request PDUs
0 Get-next PDUs
0 Set-request PDUs
0 Input queue packet drops (Maximum queue size 1000)
0 SNMP packets output
0 Too big errors (Maximum packet size 1500)
0 No such name errors
0 Bad values errors
0 General errors
0 Response PDUs
0 Trap PDUs
SNMP global trap: enabled

SNMP logging: disabled
SNMP agent enabled

I tried a snmp walk from my computer

snmp walk -v l -c public 10.22.8.4 1.3.6.1.2.1.2

10.22.8.34 is ip address of my switch

any ideas or suggestions.
Any ideas?
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: SNMP chcek of Cisco 3750 switch

Post by kwhogster »

Update

I ran snmpwalk from the Nagios server

root@tgcs017:/usr/local/nagios/libexec# snmpwalk -v 1 -c public cisc03750 1.3.6.1.2.1.2
iso.3.6.1.2.1.2.1.0 = INTEGER: 60
iso.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1
iso.3.6.1.2.1.2.2.1.1.5179 = INTEGER: 5179
iso.3.6.1.2.1.2.2.1.1.5180 = INTEGER: 5180
iso.3.6.1.2.1.2.2.1.1.5181 = INTEGER: 5181
iso.3.6.1.2.1.2.2.1.1.10101 = INTEGER: 10101
iso.3.6.1.2.1.2.2.1.1.10102 = INTEGER: 10102
iso.3.6.1.2.1.2.2.1.1.10103 = INTEGER: 10103
iso.3.6.1.2.1.2.2.1.1.10104 = INTEGER: 10104
iso.3.6.1.2.1.2.2.1.1.10105 = INTEGER: 10105
iso.3.6.1.2.1.2.2.1.1.10106 = INTEGER: 10106
iso.3.6.1.2.1.2.2.1.1.10107 = INTEGER: 10107
iso.3.6.1.2.1.2.2.1.1.10108 = INTEGER: 10108
iso.3.6.1.2.1.2.2.1.1.10109 = INTEGER: 10109
iso.3.6.1.2.1.2.2.1.1.10110 = INTEGER: 10110
iso.3.6.1.2.1.2.2.1.1.10111 = INTEGER: 10111
iso.3.6.1.2.1.2.2.1.1.10112 = INTEGER: 10112
iso.3.6.1.2.1.2.2.1.1.10113 = INTEGER: 10113
iso.3.6.1.2.1.2.2.1.1.10114 = INTEGER: 10114
iso.3.6.1.2.1.2.2.1.1.10115 = INTEGER: 10115
iso.3.6.1.2.1.2.2.1.1.10116 = INTEGER: 10116
iso.3.6.1.2.1.2.2.1.1.10117 = INTEGER: 10117
iso.3.6.1.2.1.2.2.1.1.10118 = INTEGER: 10118
iso.3.6.1.2.1.2.2.1.1.10119 = INTEGER: 10119
iso.3.6.1.2.1.2.2.1.1.10120 = INTEGER: 10120
iso.3.6.1.2.1.2.2.1.1.10121 = INTEGER: 10121
iso.3.6.1.2.1.2.2.1.1.10122 = INTEGER: 10122
iso.3.6.1.2.1.2.2.1.1.10123 = INTEGER: 10123
iso.3.6.1.2.1.2.2.1.1.10124 = INTEGER: 10124
iso.3.6.1.2.1.2.2.1.1.10125 = INTEGER: 10125
iso.3.6.1.2.1.2.2.1.1.10126 = INTEGER: 10126
iso.3.6.1.2.1.2.2.1.1.10127 = INTEGER: 10127
iso.3.6.1.2.1.2.2.1.1.10128 = INTEGER: 10128
iso.3.6.1.2.1.2.2.1.1.10129 = INTEGER: 10129
iso.3.6.1.2.1.2.2.1.1.10130 = INTEGER: 10130
iso.3.6.1.2.1.2.2.1.1.10131 = INTEGER: 10131
iso.3.6.1.2.1.2.2.1.1.10132 = INTEGER: 10132
iso.3.6.1.2.1.2.2.1.1.10133 = INTEGER: 10133
iso.3.6.1.2.1.2.2.1.1.10134 = INTEGER: 10134
iso.3.6.1.2.1.2.2.1.1.10135 = INTEGER: 10135
iso.3.6.1.2.1.2.2.1.1.10136 = INTEGER: 10136
iso.3.6.1.2.1.2.2.1.1.10137 = INTEGER: 10137
iso.3.6.1.2.1.2.2.1.1.10138 = INTEGER: 10138
iso.3.6.1.2.1.2.2.1.1.10139 = INTEGER: 10139
iso.3.6.1.2.1.2.2.1.1.10140 = INTEGER: 10140
iso.3.6.1.2.1.2.2.1.1.10141 = INTEGER: 10141
iso.3.6.1.2.1.2.2.1.1.10142 = INTEGER: 10142
iso.3.6.1.2.1.2.2.1.1.10143 = INTEGER: 10143
iso.3.6.1.2.1.2.2.1.1.10144 = INTEGER: 10144
iso.3.6.1.2.1.2.2.1.1.10145 = INTEGER: 10145
iso.3.6.1.2.1.2.2.1.1.10146 = INTEGER: 10146
iso.3.6.1.2.1.2.2.1.1.10147 = INTEGER: 10147
iso.3.6.1.2.1.2.2.1.1.10148 = INTEGER: 10148
iso.3.6.1.2.1.2.2.1.1.10149 = INTEGER: 10149
iso.3.6.1.2.1.2.2.1.1.10150 = INTEGER: 10150
iso.3.6.1.2.1.2.2.1.1.10151 = INTEGER: 10151
iso.3.6.1.2.1.2.2.1.1.10152 = INTEGER: 10152
iso.3.6.1.2.1.2.2.1.1.10201 = INTEGER: 10201
iso.3.6.1.2.1.2.2.1.1.10202 = INTEGER: 10202
iso.3.6.1.2.1.2.2.1.1.14501 = INTEGER: 14501
iso.3.6.1.2.1.2.2.1.1.14502 = INTEGER: 14502
iso.3.6.1.2.1.2.2.1.2.1 = STRING: "Vlan1"
iso.3.6.1.2.1.2.2.1.2.5179 = STRING: "StackPort1"
iso.3.6.1.2.1.2.2.1.2.5180 = STRING: "StackSub-St1-1"
iso.3.6.1.2.1.2.2.1.2.5181 = STRING: "StackSub-St1-2"
iso.3.6.1.2.1.2.2.1.2.10101 = STRING: "GigabitEthernet1/0/1"
iso.3.6.1.2.1.2.2.1.2.10102 = STRING: "GigabitEthernet1/0/2"
iso.3.6.1.2.1.2.2.1.2.10103 = STRING: "GigabitEthernet1/0/3"
iso.3.6.1.2.1.2.2.1.2.10104 = STRING: "GigabitEthernet1/0/4"
iso.3.6.1.2.1.2.2.1.2.10105 = STRING: "GigabitEthernet1/0/5"
iso.3.6.1.2.1.2.2.1.2.10106 = STRING: "GigabitEthernet1/0/6"
iso.3.6.1.2.1.2.2.1.2.10107 = STRING: "GigabitEthernet1/0/7"
iso.3.6.1.2.1.2.2.1.2.10108 = STRING: "GigabitEthernet1/0/8"
iso.3.6.1.2.1.2.2.1.2.10109 = STRING: "GigabitEthernet1/0/9"
iso.3.6.1.2.1.2.2.1.2.10110 = STRING: "GigabitEthernet1/0/10"
iso.3.6.1.2.1.2.2.1.2.10111 = STRING: "GigabitEthernet1/0/11"
iso.3.6.1.2.1.2.2.1.2.10112 = STRING: "GigabitEthernet1/0/12"
iso.3.6.1.2.1.2.2.1.2.10113 = STRING: "GigabitEthernet1/0/13"
iso.3.6.1.2.1.2.2.1.2.10114 = STRING: "GigabitEthernet1/0/14"
iso.3.6.1.2.1.2.2.1.2.10115 = STRING: "GigabitEthernet1/0/15"
iso.3.6.1.2.1.2.2.1.2.10116 = STRING: "GigabitEthernet1/0/16"
iso.3.6.1.2.1.2.2.1.2.10117 = STRING: "GigabitEthernet1/0/17"
iso.3.6.1.2.1.2.2.1.2.10118 = STRING: "GigabitEthernet1/0/18"
iso.3.6.1.2.1.2.2.1.2.10119 = STRING: "GigabitEthernet1/0/19"
iso.3.6.1.2.1.2.2.1.2.10120 = STRING: "GigabitEthernet1/0/20"
iso.3.6.1.2.1.2.2.1.2.10121 = STRING: "GigabitEthernet1/0/21"
iso.3.6.1.2.1.2.2.1.2.10122 = STRING: "GigabitEthernet1/0/22"
iso.3.6.1.2.1.2.2.1.2.10123 = STRING: "GigabitEthernet1/0/23"
iso.3.6.1.2.1.2.2.1.2.10124 = STRING: "GigabitEthernet1/0/24"
iso.3.6.1.2.1.2.2.1.2.10125 = STRING: "GigabitEthernet1/0/25"
iso.3.6.1.2.1.2.2.1.2.10126 = STRING: "GigabitEthernet1/0/26"
iso.3.6.1.2.1.2.2.1.2.10127 = STRING: "GigabitEthernet1/0/27"
iso.3.6.1.2.1.2.2.1.2.10128 = STRING: "GigabitEthernet1/0/28"
iso.3.6.1.2.1.2.2.1.2.10129 = STRING: "GigabitEthernet1/0/29"
iso.3.6.1.2.1.2.2.1.2.10130 = STRING: "GigabitEthernet1/0/30"
iso.3.6.1.2.1.2.2.1.2.10131 = STRING: "GigabitEthernet1/0/31"
iso.3.6.1.2.1.2.2.1.2.10132 = STRING: "GigabitEthernet1/0/32"
iso.3.6.1.2.1.2.2.1.2.10133 = STRING: "GigabitEthernet1/0/33"
iso.3.6.1.2.1.2.2.1.2.10134 = STRING: "GigabitEthernet1/0/34"
iso.3.6.1.2.1.2.2.1.2.10135 = STRING: "GigabitEthernet1/0/35"
iso.3.6.1.2.1.2.2.1.2.10136 = STRING: "GigabitEthernet1/0/36"
iso.3.6.1.2.1.2.2.1.2.10137 = STRING: "GigabitEthernet1/0/37"
iso.3.6.1.2.1.2.2.1.2.10138 = STRING: "GigabitEthernet1/0/38"
iso.3.6.1.2.1.2.2.1.2.10139 = STRING: "GigabitEthernet1/0/39"
iso.3.6.1.2.1.2.2.1.2.10140 = STRING: "GigabitEthernet1/0/40"
iso.3.6.1.2.1.2.2.1.2.10141 = STRING: "GigabitEthernet1/0/41"
iso.3.6.1.2.1.2.2.1.2.10142 = STRING: "GigabitEthernet1/0/42"
iso.3.6.1.2.1.2.2.1.2.10143 = STRING: "GigabitEthernet1/0/43"
iso.3.6.1.2.1.2.2.1.2.10144 = STRING: "GigabitEthernet1/0/44"
iso.3.6.1.2.1.2.2.1.2.10145 = STRING: "GigabitEthernet1/0/45"
iso.3.6.1.2.1.2.2.1.2.10146 = STRING: "GigabitEthernet1/0/46"
iso.3.6.1.2.1.2.2.1.2.10147 = STRING: "GigabitEthernet1/0/47"
iso.3.6.1.2.1.2.2.1.2.10148 = STRING: "GigabitEthernet1/0/48"
iso.3.6.1.2.1.2.2.1.2.10149 = STRING: "GigabitEthernet1/1/1"
iso.3.6.1.2.1.2.2.1.2.10150 = STRING: "GigabitEthernet1/1/2"
iso.3.6.1.2.1.2.2.1.2.10151 = STRING: "GigabitEthernet1/1/3"
iso.3.6.1.2.1.2.2.1.2.10152 = STRING: "GigabitEthernet1/1/4"
iso.3.6.1.2.1.2.2.1.2.10201 = STRING: "TenGigabitEthernet1/1/1"
iso.3.6.1.2.1.2.2.1.2.10202 = STRING: "TenGigabitEthernet1/1/2"
iso.3.6.1.2.1.2.2.1.2.14501 = STRING: "Null0"
iso.3.6.1.2.1.2.2.1.2.14502 = STRING: "FastEthernet0"



So it looks like snmp is working on my switch and the Nagios server can communicate with the switch.

Any thing any one have an idea

Thank

Tom
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP chcek of Cisco 3750 switch

Post by scottwilkerson »

It looks like your system doesn't have the BIM.

Place the attached file in /usr/share/snmp/mibs
Attachments
IF-MIB.txt
(70.01 KiB) Downloaded 369 times
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: SNMP chcek of Cisco 3750 switch

Post by kwhogster »

Scott

Copied the file to /usr/share/snmp/mibs then ran the script

root@tgcs017:/usr/local/nagios/libexec# ./check_cisco.pl -h 10.2.8.4 -c public -i GigabitEthernet1/1/21 -s down
MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
Cannot find module (SNMPv2-SMI): At line 6 in /usr/share/snmp/mibs/IF-MIB.txt
Cannot find module (SNMPv2-TC): At line 9 in /usr/share/snmp/mibs/IF-MIB.txt
Cannot find module (SNMPv2-MIB): At line 12 in /usr/share/snmp/mibs/IF-MIB.txt
Cannot find module (SNMPv2-SMI): At line 4 in /usr/share/snmp/mibs/IANAifType-MIB.txt
Did not find 'mib-2' in module #-1 (/usr/share/snmp/mibs/IANAifType-MIB.txt)
Unlinked OID in IANAifType-MIB: ianaifType ::= { mib-2 30 }
Undefined identifier: mib-2 near line 7 of /usr/share/snmp/mibs/IANAifType-MIB.txt
Did not find 'mib-2' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'DisplayString' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'PhysAddress' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'TruthValue' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'RowStatus' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'TimeStamp' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'AutonomousType' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'TestAndIncr' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'snmpTraps' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Unlinked OID in IF-MIB: interfaces ::= { mib-2 2 }
Undefined identifier: mib-2 near line 48 of /usr/share/snmp/mibs/IF-MIB.txt
Unlinked OID in IF-MIB: ifMIB ::= { mib-2 31 }
Undefined identifier: mib-2 near line 15 of /usr/share/snmp/mibs/IF-MIB.txt
Unlinked OID in IF-MIB: linkUp ::= { snmpTraps 4 }
Undefined identifier: snmpTraps near line 1118 of /usr/share/snmp/mibs/IF-MIB.txt
Unlinked OID in IF-MIB: linkDown ::= { snmpTraps 3 }
Undefined identifier: snmpTraps near line 1106 of /usr/share/snmp/mibs/IF-MIB.txt
IF-MIB::ifDescr: Unknown Object Identifier
MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
Cannot find module (SNMPv2-SMI): At line 6 in /usr/share/snmp/mibs/IF-MIB.txt
Cannot find module (SNMPv2-TC): At line 9 in /usr/share/snmp/mibs/IF-MIB.txt
Cannot find module (SNMPv2-MIB): At line 12 in /usr/share/snmp/mibs/IF-MIB.txt
Cannot find module (SNMPv2-SMI): At line 4 in /usr/share/snmp/mibs/IANAifType-MIB.txt
Did not find 'mib-2' in module #-1 (/usr/share/snmp/mibs/IANAifType-MIB.txt)
Unlinked OID in IANAifType-MIB: ianaifType ::= { mib-2 30 }
Undefined identifier: mib-2 near line 7 of /usr/share/snmp/mibs/IANAifType-MIB.txt
Did not find 'mib-2' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'DisplayString' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'PhysAddress' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'TruthValue' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'RowStatus' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'TimeStamp' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'AutonomousType' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'TestAndIncr' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Did not find 'snmpTraps' in module #-1 (/usr/share/snmp/mibs/IF-MIB.txt)
Unlinked OID in IF-MIB: interfaces ::= { mib-2 2 }
Undefined identifier: mib-2 near line 48 of /usr/share/snmp/mibs/IF-MIB.txt
Unlinked OID in IF-MIB: ifMIB ::= { mib-2 31 }
Undefined identifier: mib-2 near line 15 of /usr/share/snmp/mibs/IF-MIB.txt
Unlinked OID in IF-MIB: linkUp ::= { snmpTraps 4 }
Undefined identifier: snmpTraps near line 1118 of /usr/share/snmp/mibs/IF-MIB.txt
Unlinked OID in IF-MIB: linkDown ::= { snmpTraps 3 }
Undefined identifier: snmpTraps near line 1106 of /usr/share/snmp/mibs/IF-MIB.txt
IF-MIB::ifName: Unknown Object Identifier
Interface not found : please check your syntax for this device


Nagios Core 4.3.4 is running on Ubuntu 16.04.1 LTS does that make a difference?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP chcek of Cisco 3750 switch

Post by scottwilkerson »

It looks like you are missing all of the required MIBS.

How did you install snmp on the server?

Did you run this?

Code: Select all

sudo apt-get install snmp
This should install all of these base MIBs. Here is a guide to install some additional mibs
https://l3net.wordpress.com/2013/05/12/ ... nd-debian/
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: SNMP chcek of Cisco 3750 switch

Post by kwhogster »

Scott

yes that is what I ran to install snmp

We got less errors after following the instructions you sent

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
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
Expected "::=" (RFC5644): At line 493 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Expected "{" (EOF): At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Bad object identifier: At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Bad parse of OBJECT-IDENTITY: At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
Expected "::=" (RFC5644): At line 493 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Expected "{" (EOF): At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Bad object identifier: At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Bad parse of OBJECT-IDENTITY: At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Interface not found : please check your syntax for this device


The contents of /usr/share/snmp/mibs
root@tgcs017:/usr/local/nagios/libexec# ls /usr/share/snmp/mibs
GNOME-SMI.txt IANA-RTPROTO-MIB.txt NET-SNMP-AGENT-MIB.txt NET-SNMP-MONITOR-MIB.txt NET-SNMP-TC.txt SNMP-TSM-MIB.txt UCD-IPFILTER-MIB.txt
IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt IF-MIB.txt NET-SNMP-EXAMPLES-MIB.txt NET-SNMP-PASS-MIB.txt NET-SNMP-VACM-MIB.txt UCD-DEMO-MIB.txt UCD-IPFWACC-MIB.txt
IANAifType-MIB.txt LM-SENSORS-MIB.txt NET-SNMP-EXTEND-MIB.txt NET-SNMP-PERIODIC-NOTIFY-MIB.txt RFC-1215.txt UCD-DISKIO-MIB.txt UCD-SNMP-MIB-OLD.txt
IANA-LANGUAGE-MIB.txt miblist.txt NET-SNMP-MIB.txt NET-SNMP-SYSTEM-MIB.txt SNMP-TLS-TM-MIB.txt UCD-DLMOD-MIB.txt UCD-SNMP-MIB.txt

Do I need additional MIBS? If so where to get them?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP chcek of Cisco 3750 switch

Post by scottwilkerson »

looks like you may have a bad mib here
/usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB

You may want to consider moving it at least temporarily

Code: Select all

mv /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB /tmp
Then, the last error you are getting is

Code: Select all

Interface not found : please check your syntax for this device
this looks like normal output, it is possible that this plugin just expects a number or something there instead of a name

I would check the plugin help to see if you can see an example

Code: Select all

./check_cisco.pl --help
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: SNMP chcek of Cisco 3750 switch

Post by kwhogster »

Scott

Moved the mib

Now this is the results.

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
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
Interface not found : please check your syntax for this device

I tried the --help
root@tgcs017:/usr/local/nagios/libexec# ./check_cisco.pl --help
Unknown option: help
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
Timeout: No Response from 127.0.0.1
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
Timeout: No Response from 127.0.0.1
Interface not found : please check your syntax for this device

should I reinstall snmp? remove it first? then install
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: SNMP chcek of Cisco 3750 switch

Post by kwhogster »

Scott

I see you locked my other posted that's ok they are all about the same issue they are just different plugins

So here are two others

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
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
Can not get Interface Status of port


root@tgcs017:/usr/local/nagios/libexec# ./check_snmp_cisco.pl -H 10.2.8.4 -C public -I GigabitEthernet1/1/21
sh: 1: cannot create /var/nagios_plugin_cache/10.2.8.4_cache: Directory nonexistent
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
sh: 1: cannot create /var/nagios_plugin_cache/10.2.8.4_cache: Directory nonexistent
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
sh: 1: cannot create /var/nagios_plugin_cache/10.2.8.4_cache.tmp: Directory nonexistent
mv: cannot stat '/var/nagios_plugin_cache/10.2.8.4_cache.tmp': No such file or directory
grep: /var/nagios_plugin_cache/10.2.8.4_cache: No such file or directory
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
IF-MIB::ifOperStatus.: Unknown Object Identifier (Index out of range: (ifIndex))
Unknown state for GigabitEthernet1/1/21 : check your -s state syntax


They all seem to be leading to a MIBS problem but how to fix? I never used SNMP before so all new to this.

Thanks
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: SNMP chcek of Cisco 3750 switch

Post by kwhogster »

Scott

This check runs but I do not like this one because you can not be selective on which interface you want
Just wanted to show that this snmp check works not sure why the other three plugins do not
If we can get anyone of the other three to work that would make my day.


root@tgcs017:/usr/local/nagios/libexec# ./nm_check_admin_up_oper_down -H 10.2.8.4 -p 161 -P 2c -C public -w
18 interfaces down
StackPort1
GigabitEthernet1/1/1
GigabitEthernet1/0/18
GigabitEthernet1/1/3
GigabitEthernet1/0/20
GigabitEthernet1/0/35
GigabitEthernet1/0/26
StackSub-St1-2
GigabitEthernet1/1/4
GigabitEthernet1/0/34
GigabitEthernet1/1/2
TenGigabitEthernet1/1/1
TenGigabitEthernet1/1/2
GigabitEthernet1/0/39
StackSub-St1-1
GigabitEthernet1/0/38
GigabitEthernet1/0/42
GigabitEthernet1/0/43
Locked