MIBs?


#1

Can somebody please point me in the right direction on how to use mib files within Nagios.

Thanks,


#2

You don’t use MIB files within Nagios. Install MIB files you need on the server from which you would like to make snmp queries, and then snmpwalk or snmpget the queries you need. Nagios can use snmpwalk or snmpget as check commands, and snmpwalk/snmpget use the MIB files. MIB files are in /usr/share/snmp/mibs or something like that.


#3

Thanks. That helped out quite a bit. I have figured out how to use the mibs with snmpwalk. Now I am trying to integrate them in to Nagios.
My check command is:

    *define command{
    command_name    Check_OSR_Uptime
    command_line    snmpwalk $HOSTADDRESS$ -c xxxxxx -v 1 -m /usr/local/nagios/MIBs/xylan.mib iso.3.6.1.2.1.1.3.0
    } *

My service definition is

    *define service{
use  router-service
host_name   DallasOSR
service_description  Uptime
check_command   Check_OSR_Uptime
    }*

When I run this I am getting:

(Return code of 127 is out of bounds - plugin may be missing)

I can run:

snmpwalk 10.1.1.x -c xxxxxx -v 1 -m /usr/local/nagios/MIBs/xylan.mib iso.3.6.1.2.1.1.3.0

and I get back:

RFC1155-SMI::mgmt.1.1.3.0 = Timeticks: (105950127) 12 days, 6:18:21.27

which is what I expect.
Any idea why I am getting an error from Nagios? I have checked my file permissions and I do not think they are an issue. I am able to run the snmpwalk logged in as nagios as well.

I think the issue is that it is just not being checked. When I look at the last check time, it is almost an hour ago. The next scheduled check is several minutes ago from when I told it to reschedule the next check of this service. I did see it come up for a brief second and display the correct information and list the service as up, but then, it reverted back to critical and the last check time almost an hour ago. It is almost as if the status.dat file was reverted or something.

Thank you for any help you can give.


#4

Some Exerts from my event logs:

[05-07-2008 17:59:21] SERVICE ALERT: DallasOSR;Uptime;CRITICAL;SOFT;2;(Return code of 127 is out of bounds - plugin may be missing)

[05-07-2008 17:59:21] Warning: Return code of 127 for check of service ‘Uptime’ on host ‘DallasOSR’ was out of bounds. Make sure the plugin you’re trying to run actually exists.

[05-07-2008 17:54:41] SERVICE ALERT: DallasOSR;Uptime;OK;HARD;3;RFC1155-SMI::mgmt.1.1.3.0 = Timeticks: (106028899) 12 days, 6:31:28.99

[05-07-2008 17:54:35] EXTERNAL COMMAND: ENABLE_SVC_CHECK;DallasOSR;Uptime

[05-07-2008 17:53:21] SERVICE ALERT: DallasOSR;Uptime;CRITICAL;SOFT;1;(Return code of 127 is out of bounds - plugin may be missing)

[05-07-2008 17:53:21] Warning: Return code of 127 for check of service ‘Uptime’ on host ‘DallasOSR’ was out of bounds. Make sure the plugin you’re trying to run actually exists.

These were all without making any changes.


#5

One more quick update. The service seems to be flapping every few minutes with the same 127 error. I am investigating to see if it the device being monitored or the nagios box that is the problem. I am starting to think that this is doing a full snmpwalk of the entire device every time it is checked. If that is the case, that would explain why it is flapping. The device returns somewhere in the neighborhood of 10,000 results. This may be overloading the device. I will keep posted here.