Nagios SNMP Plugin
Richard Remington
rremington at messagevision.com
Wed Jul 29 00:51:40 CEST 2009
Peter,
This isn't exactly an easy example because it incorporates the check_multi plug-in, but you should be able to get the idea.
My service check definition calls check_multi...
define service {; Check T1 OperStatus on Cisco 5300's
service_description DS0 OperStatus
check_command check_multi!$USER8$/multi/check_multi_snmp_cpmDS0OperStatus.cmd!$USER1$!15
host_name nagios-host
flap_detection_enabled 0; Flap detection is disabled due to check_multi use.
notes SNMP OID: iso.3.6.1.4.1.9.10.19.1.5.2.1.1.0.x.x<BR> cpmDS0OperStatus<BR> (T1(DS0) Operational Status on Cisco 5300)<BR> 1:un known, 2:down, 3:idle, 4:setup, 5:connected, 6:test
use services-template
}
which is defined as follows in my check_multi_snmp_xxxx.cmd file...
command[ OperStatus_slot_0_channel_1 ] = check_snmp -H 192.168.xx.xxx -m CISCO-POP-MGMT-MIB -P 2c -C public -o cpmDS0OperStatus.0.0.1 -R '3|4|5'
But likely the part that matters most to you is the check_snmp string...
check_snmp -H 192.168.xx.xxx -m CISCO-POP-MGMT-MIB -P 2c -C public -o cpmDS0OperStatus.0.0.1 -R '3|4|5'
which you could add to your own command definition. The use of the -m switch with the MIB definition is not essential. You could get it to work with just an OID. check_snmp actually calls another application in the SNMP suite, snmpget, I think, and relies on MIB files typically found in /usr/share/snmp/mibs or similar location.
I hope this helps.
Richard Remington
Unix Systems Adminstrator
Peter Gritsch wrote:
> On Tuesday 28 July 2009, Tom Denham wrote:
>> Anyone out there have any examples of using Nagios SNMP plugin to
>> perform simple queries for Cisco Routers and Linux boxes? I'm
>> thinking of basic queries such as uptime, cpu, storage, etc..
>
> http://snmp4nagios.sourceforge.net
>
>> I was thinking of using the check_snmp cmd, but syntax is a bit
>> confusing...if you know of a better way that would be helpful too.
>
> Hmm ... don't know if they are that much easier to use ;-)
>
> CU
> Peter
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list