<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Morning all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m trying to refine a few snmp checks I do.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My command looks like this;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">./check_snmp –H xx.xx.xx.xx –o READyNAS-MIB::diskState.1 –C nas-drive –P 2c –v<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This produces the following;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">/usr/bin/snmpget –t 1 –r 5 –m ALL –v 2c [authpriv] xx.xx.xx.xx READYNAS-MIB::diskState.1<o:p></o:p></p>
<p class="MsoNormal">READYNAS-MIB::diskState.1 = STRING: “dead”<o:p></o:p></p>
<p class="MsoNormal">SNMP OK – “dead” |<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">----- working disk---<o:p></o:p></p>
<p class="MsoNormal">/usr/bin/snmpget –t 1 –r 5 –m ALL –v 2c [authpriv] xx.xx.xx.xx READYNAS-MIB::diskState.2<o:p></o:p></p>
<p class="MsoNormal">READYNAS-MIB::diskState.2 = STRING: “ok”<o:p></o:p></p>
<p class="MsoNormal">SNMP OK – “ok” |<o:p></o:p></p>
<p class="MsoNormal">----- working disk---<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Anyone got any ideas??<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Have I messed up the syntax??<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks in advance,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Tristan<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">Micro Peripherals Limited.<br>
Registered Office: Shorten Brook Way, Altham Business Park, Altham,<br>
Accrington, Lancs. BB5 5YJ. Tel: (01282) 776776 Fax: (01282) 858790<br>
Micro Peripherals Limited. Registered in England No. 1511931. VAT No. GB 864 4387 91<br>
<br>
DISCLAIMER:<br>
This e-mail and attachments are confidential and are intended solely for the use of the individual to<br>
whom it is addressed. Any views or opinions presented are solely those of the author and do not<br>
necessarily represent those of Micro Peripherals Limited.<br>
If you are not the intended recipient, be advised that you have received this Email in error and that<br>
any use, dissemination, forwarding, printing, or copying of this Email is strictly prohibited. If this<br>
transmission is received in error please notify the sender immediately and delete this message from<br>
your E-mail system.<br>
All electronic transmissions to and from Micro Peripherals Ltd are recorded and may be monitored.<br>
</font>
</body>
</html>