Would love some ideas on how to monitor switch port duplex

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
logic_bomb421
Posts: 43
Joined: Tue Jul 15, 2014 6:58 pm

Would love some ideas on how to monitor switch port duplex

Post by logic_bomb421 »

So like the title says, I'm trying to monitor switch port duplex mode. I figured this would be doable using SNMP, however, what I didn't take into account were the older switches we need to monitor duplex on. Currently we're trying to monitor 3COM 4200G 48-port switches. The do appear to support SNMP, but whenever I reference most OIDs, I get errors. We'll take the default port monitoring command/service that comes with Nagios 4.0.7. Right now, I have configured:

Code: Select all

define command{
     command_name   check_snmp
     command_line   $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$
     }
and

Code: Select all

define service{
     use                   generic-service
     host_name             NAME OF SWITCH
     service_description   Port 1 Link Status
     check_command         check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
     }
What this returns in Nagios is really confusing:

Code: Select all

External command error: MIB search path: $HOME/.snmp/mibs:/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 0 in (none)
ifOperStatus.1: Unknown Object Identifier (Sub-id not found: (top) -> ifOperStatus)
Has anyone seen this before?

Also, if someone knows of a better way to monitor port duplex, I'm all ears. I was hoping 3COM copied Cisco (Cisco has a portDuplex OID), but, alas, they did not.

Thank you!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Would love some ideas on how to monitor switch port dupl

Post by tmcdonald »

It looks like your SNMPv2-SMI MIB is missing. Please run the following command and post the output:

Code: Select all

find / -name SNMPv2-SMI.txt
Former Nagios employee
logic_bomb421
Posts: 43
Joined: Tue Jul 15, 2014 6:58 pm

Re: Would love some ideas on how to monitor switch port dupl

Post by logic_bomb421 »

Alright, when I run

Code: Select all

find / -name SNMPv2-SMI.txt
my terminal lags for a second like it's thinking and then returns nothing and gives me the root::/# cursor.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Would love some ideas on how to monitor switch port dupl

Post by tmcdonald »

Yea, looks like you probably have no MIBs at all. Try running the following:

Code: Select all

yum install -y net-snmp-utils
I believe this should give you the standard MIBs, located by default in /usr/share/snmp/mibs/.
Former Nagios employee
logic_bomb421
Posts: 43
Joined: Tue Jul 15, 2014 6:58 pm

Re: Would love some ideas on how to monitor switch port dupl

Post by logic_bomb421 »

So neither the yum or apt-get commands found anything for net-snmp-utils, however I did manage to find http://www.net-snmp.org/, and I downloaded and installed the latest LTS version. Now the find command returns /net-snmp-5.7.2.1/mibs/SNMPv2-SMI.txt.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Would love some ideas on how to monitor switch port dupl

Post by tmcdonald »

Try placing /net-snmp-5.7.2.1/mibs/SNMPv2-SMI.txt into /usr/share/snmp/mibs/ so it's in the default path the system will look for MIBs.
Former Nagios employee
logic_bomb421
Posts: 43
Joined: Tue Jul 15, 2014 6:58 pm

Re: Would love some ideas on how to monitor switch port dupl

Post by logic_bomb421 »

Okay, after moving my SNMPv2 text file to the directory you specified, Nagios is now returning the unknown status error:

Code: Select all

External command error: ifOperStatus.1: Unknown Object Identifier (Sub-id not found: (top) -> ifOperStatus) 
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Would love some ideas on how to monitor switch port dupl

Post by tmcdonald »

Go ahead and copy over all of the MIBs from /net-snmp-5.7.2.1/mibs/ to /usr/share/snmp/mibs/ since it seems the one I had you move originally relies on some others.
Former Nagios employee
Locked