Check_snmp -d & -s

Yueh-Hung Liu yuehung.liu at gmail.com
Fri Feb 11 12:24:16 CET 2011


you can write a wrap script, which would be the check command, to deal
the return string and report correct status to Nagios.
of course this script will use check_snmp in it.


On Fri, Feb 11, 2011 at 7:08 PM, Tristan Drinkwater
<tristand at micro-p.com> wrote:
> Morning all,
>
>
>
> I’m trying to refine a few snmp checks I do.
>
>
>
> My command looks like this;
>
>
>
> ./check_snmp –H xx.xx.xx.xx –o READyNAS-MIB::diskState.1 –C nas-drive –P 2c
> –v
>
>
>
>
>
> This produces the following;
>
>
>
> /usr/bin/snmpget –t 1 –r 5 –m ALL –v 2c [authpriv] xx.xx.xx.xx
> READYNAS-MIB::diskState.1
>
> READYNAS-MIB::diskState.1 = STRING: “dead”
>
> SNMP OK – “dead” |
>
>
>
>
>
> Now, as you can see from above, my disk 2 is ‘dead’ but Nagios reports this
> as ok. I’m under the impression I need to use the ‘–s’ switch to specify
> what is good and what is bad, based on matching a string from the output.
>
>
>
> To me, the output above would suggest that the returning string is “dead” so
> to get it to report that this is actually bad I should use “-s ok”  as “ok”
> is the string returned on all the other disks that are working ok.
>
>
>
> ----- working disk---
>
> /usr/bin/snmpget –t 1 –r 5 –m ALL –v 2c [authpriv] xx.xx.xx.xx
> READYNAS-MIB::diskState.2
>
> READYNAS-MIB::diskState.2 = STRING: “ok”
>
> SNMP OK – “ok” |
>
> ----- working disk---
>
>
>
>
>
>
>
> Sadly, this doesn’t work as it seems that “ok” and “dead” aren’t the
> returning strings. Neither are 1 and 0 as stated in the readynas MIB
> documentation.
>
>
>
> Anyone got any ideas??
>
>
>
> Have I messed up the syntax??
>
>
>
> Thanks in advance,
>
>
>
> Tristan
>
>
>
>
>
>
>
> ________________________________
> Micro Peripherals Limited.
> Registered Office: Shorten Brook Way, Altham Business Park, Altham,
> Accrington, Lancs. BB5 5YJ. Tel: (01282) 776776 Fax: (01282) 858790
> Micro Peripherals Limited. Registered in England No. 1511931. VAT No. GB 864
> 4387 91
>
> DISCLAIMER:
> This e-mail and attachments are confidential and are intended solely for the
> use of the individual to
> whom it is addressed. Any views or opinions presented are solely those of
> the author and do not
> necessarily represent those of Micro Peripherals Limited.
> If you are not the intended recipient, be advised that you have received
> this Email in error and that
> any use, dissemination, forwarding, printing, or copying of this Email is
> strictly prohibited. If this
> transmission is received in error please notify the sender immediately and
> delete this message from
> your E-mail system.
> All electronic transmissions to and from Micro Peripherals Ltd are recorded
> and may be monitored.
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> 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
>

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
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