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.
I need to check a remote server's routing table to make sure a specific route is included and, if not, send an alert. The remote server has SNMP set up but I'm not really familiar with the MIB syntax. If I were to use the check_snmp plugin, what would the appropriate check_command be? I want to make sure the following line exists (the first IP address is realistically the only string I need to search for):
Well, if its a static route and you can bank on it being in the same OID (that long .1.2.3.4.5.3.2.3.4.5) number, you can use check_snmp, if its a dynamic route you'll have to use something else. This looks promising: http://exchange.nagios.org/directory/Pl ... le/details
If it is a static route, you'll need to have the MIB that you expect it to be at and then use a regular expression, your check might look something liek this:
check_snmp -H <router ip> -C <community string> -o <OID of the route> -r '^STRING: 10\.0\.1\.\0'
Will return OK if the OID begins with STRING: 10.0.1.0
Find out which mib file(s) is relevant for your device then look that mib up on oidview.com, a similar site or a mib viewing app and find the entry relevant to the routing table. This is probably the most sure fire way to find the correct oid.
$ ./check_snmp -H 10.80.10.1 -C public -o 1.3.6.1.2.1.4.21.1.7 -m RFC1213-MIB
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: RFC1213-MIB::ipRouteNextHop