<table border="0" cellpadding="0" cellspacing="0" width="650">
        <tbody><tr><td width="650" colspan="2" align="left" valign="top"><!-- RS-STRIP-BEGIN image-8215-28573@branding.transpire.com.au--><p><a href="http://branding.transpire.com.au/rs/31MIVwJg"><img src="cid:image-8215-28573@branding.transpire.com.au" class="rocketseed-strip" usemap="#tpheaderblack" alt="" border="0"></a><map id="tpheaderblack" name="tpheaderblack">
<area target="_blank" href="http://branding.transpire.com.au/rs/31YdLuMi" title="Tell me more" alt="Tell me more" coords="515,0,650,16" shape="rect">
<area target="_blank" href="http://branding.transpire.com.au/rs/31L3LnTa" title="Transpire Website" alt="Transpire Website" coords="0,17,650,96" shape="rect"></map></p><!-- RS-STRIP-END image-8215-28573@branding.transpire.com.au--></td></tr><tr><td width="605" align="right" valign="middle"><table style="border: 1px none #F00;" border="0" cellpadding="0" cellspacing="0" width="605">
<tbody>
<tr>
<td align="right">
<p style="font-size: 10px;"><a style="text-decoration: none;" href="http://branding.transpire.com.au/rs/31TZ9hoE"><font style="color: #666666;" face="helvetica,verdana,geneva">cleverthink: Great article
http://t.co/VizsP4tF2i</font></a></p>
</td>
</tr>
</tbody>
</table></td><td width="45" align="left" valign="top"> <!-- RS-STRIP-BEGIN image-7615-28573@branding.transpire.com.au--><a href="http://branding.transpire.com.au/rs/31jCYUeN"><img title="Follow Us on Twitter" class="rocketseed-strip" src="cid:image-7615-28573@branding.transpire.com.au" border="0"></a><!-- RS-STRIP-END image-7615-28573@branding.transpire.com.au--></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0">
        <tbody><tr><td valign="top"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td><br><div dir="ltr">Do you mean you want to check the result of one OID and make that treat another OID's values differently?<div><br></div><div>Personally if I faced that problem - I would probably code a custom check in Bash using snmpget from snmputils that did some nested If statements, or use Net::SNMP from Perl and check it that way. Quite simple to write a Nagios plugin - it's all about the exit values - 0 is OK, 1 is Warning, 2 is Critical, 3 is Unknown.</div>
<div><br></div><div>You may be able to use warning states generated by the first to define a dependency on the second but it will be complicated to change the thresholds dynamically via that method, at best you'd be able to suppress a warning or other state from the 2nd but you couldn't have differential thresholds between the two states of the first service without some work or hackery (e.g. having an event trigger fire off that changes the configuration file and reloads nagios)</div>
<div><br></div><div>I would just code it into a plugin (assuming you or someone on your team can code)</div><div><br></div><div><br></div><div>Something like this perl pseudo code...</div><div><br></div><div>use Net::SNMP;</div>
<div><br></div><div>$snmp = Net::SNMP->session(-hostname => $ipaddress, -community => "public", -version => 'snmpv2c');</div><div><br></div><div>@oids = qw/<a href="http://1.2.3.4">1.2.3.4</a> <a href="http://1.2.3.5/">1.2.3.5/</a>;</div>
<div><br></div><div>$res = $snmp->get_request(-varbindlist => \@oids);</div><div>unless(defined($res))</div><div>{</div><div>   print "UNKNOWN - no response\n";</div><div>   exit(3);</div><div>}</div><div>
<br></div><div>$firstoidval = $res->{$oids[0]};</div><div>$secondoidval = $res->{$oids[1]};</div><div><br></div><div>if ($firstoidval == 1)  #running?</div><div>{</div><div>   if ($secondoidval > 50) { print "CRITICAL - running and temp above critical threshold"; exit(2); }</div>
<div>   if ($secondoidval > 45) { print "WARNING"; exit(1); }</div><div>   else { print "OK"; exit(0): }</div><div>}</div><div>elsif ($firstoidval == 0)  #notrunning?</div><div>{</div><div>   if ($secondoidval > 40) { print "CRITICAL"; exit(2); }</div>
<div>   if ($secondoidval > 35) { print "WARNING"; exit(1); }</div><div>   else { print "OK"; exit(0): }</div><div>}</div><div>  </div><div><br></div><div>Logic probably differs a bit, but you get the gist...</div>
<div><br></div><div><br></div><div>Cheers</div><div><br></div><div>Ben</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 29, 2013 at 11:27 AM, Mark Campbell <span dir="ltr"><<a href="mailto:mcc171@psu.edu" target="_blank">mcc171@psu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So I need to utilize some logic in my service checks.<br>
<br>
I have a chiller that if it is not running the discharge temp is not of<br>
concern.  However if it is running the discharge temp needs to be lower<br>
than 50 degrees.<br>
<br>
Is there a way to have the check snmp utilize some logic that says if<br>
running = 0 then ignore discharge temp.  If running = 1 then discharge<br>
temp must be <50 degrees?<br>
<br>
THe other option I thought of was using dependencies.  Anyone have<br>
suggestions on that?<br>
<br>
<br>
<br>
------------------------------------------------------------------------------<br>
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!<br>
Discover the easy way to master current and previous Microsoft technologies<br>
and advance your career. Get an incredible 1,500+ hours of step-by-step<br>
tutorial videos with LearnDevNow. Subscribe today and save!<br>
<a href="http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
</blockquote></div><br></div>
</td></tr></tbody></table></td></tr><tr><td><br><table border="0" cellpadding="0" cellspacing="0">
        <tbody><tr><td width="330" rowspan="1" align="left" valign="bottom"><table border="0" cellpadding="0" cellspacing="0" width="330">
<tbody>
<tr>
<td style="padding-left: 0px;">
<p style="color: #666666; font-family: helvetica, arial; font-size: 12px;"><font face="helvetica, arial"><span style="font-size: 22px;">ben sykes</span> </font><br><font face="helvetica, arial"> <span style="color: #3399cc;">consultant</span> </font><br> <br><font face="helvetica"> m. +61 404 308 201 </font><br><font face="helvetica, arial"> e. ben.sykes@transpire.com.au</font></p>
</td>
</tr>
</tbody>
</table></td><td width="320" rowspan="1" align="left" valign="bottom"><table width="320" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<p style="font-face: helvetica, arial; color: #666666; font-size: 12px;"><font face="helvetica, arial"> <font color="#3399cc"><strong>Sydney</strong></font> <br>Level 4, 93-95 Pacific Highway<br>North Sydney NSW 2060<br>T: +61 (0) 2 8221 8850 <br>F: +61 (0) 2 9925 8787 </font></p>
</td>
</tr>
</tbody>
</table></td></tr><tr><td width="650" colspan="2" align="left" valign="top"><!-- RS-STRIP-BEGIN image-8145-28573@branding.transpire.com.au--><a href="http://branding.transpire.com.au/rs/31IQ-oX6"><img usemap="#tpfooter" alt="more info: transpire.com.au" class="rocketseed-strip" src="cid:image-8145-28573@branding.transpire.com.au" border="0"></a><map name="tpfooter" id="tpfooter">
<area target="_blank" href="http://branding.transpire.com.au/rs/31FjUW1C" title="who we are" alt="who we are" coords="37,9,85,44" shape="rect">
<area target="_blank" href="http://branding.transpire.com.au/rs/31gXqZaX" title="what we do" alt="what we do" coords="154,9,213,44" shape="rect">
<area target="_blank" href="http://branding.transpire.com.au/rs/31LtMCFS" title="work we've done" alt="work we've done" coords="274,9,342,44" shape="rect">
<area target="_blank" href="http://branding.transpire.com.au/rs/31A0PtRS" title="our opinions" alt="our opinions" coords="408,9,459,44" shape="rect"></map><!-- RS-STRIP-END image-8145-28573@branding.transpire.com.au--></td></tr></tbody></table></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tbody><tr><td></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tbody><tr><td><br><table width="650" border="0" cellpadding="0" cellspacing="0">
        <tbody><tr><td width="650" align="left" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="650">
<tbody>
<tr>
<td style="padding-left: 0px;"><span style="font-face: arial; font-size: 7pt; color: #808080; text-align: justify; padding: 0;"><font face="helvetica"><strong>legal disclaimer:</strong></font><br><br><font face="helvetica"> This email, including any attachments, may be confidential or privileged, and is sent for the personal attention of the intended recipient. If you have received this email in error, please delete it immediately. The views expressed are not necessarily those of Transpire Pty Ltd. Transpire is not liable for the effects of any virus which may be contained in this email.</font></span></td>
</tr>
</tbody>
</table></td></tr></tbody></table></td></tr></tbody></table>