Check_snmp -d & -s

Giles Coochey giles at coochey.net
Fri Feb 11 12:25:13 CET 2011


On 11/02/2011 12:08, Tristan Drinkwater 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??
>
>
Have you tried --eregi="ok"

?

-- 
Best Regards,

Giles Coochey
NetSecSpec Ltd
NL T-Systems Mobile: +31 681 265 086
NL Mobile: +31 626 508 131
GIB Mobile: +350 5401 6693
Email/MSN/Live Messenger: giles at coochey.net
Skype: gilescoochey



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5137 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110211/517ee7b7/attachment.bin>
-------------- next part --------------
------------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
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