<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18928"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=577394520-16082010><FONT size=2
face=Arial>Hello all,</FONT></SPAN></DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2 face=Arial>I've googled around
everywhere trying to find an answer here and came up unsuccessful, so if anyone
has had experience in this situation, I'd appreciate help!
</FONT></SPAN></DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2 face=Arial>Basically, the issue
that I'm having is that I have a couple of temperature plugins that are
reporting errors in Nagios and at the command line they're exiting in
0:</FONT></SPAN></DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2
face=Arial></FONT></SPAN> </DIV><SPAN class=577394520-16082010>
<DIV><SPAN class=577394520-16082010><FONT size=2
face=Arial>check7204temp.pl - Return code of 255 is out of
bounds</FONT></SPAN></DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2
face=Arial>and</FONT></SPAN></DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2 face=Arial>checkciscotemp.pl -
Return code of 9 is out of bounds</FONT></SPAN></DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2 face=Arial>If I run a "echo $?"
at the command line after running the command successfully, I get
0.</FONT></SPAN></DIV>
<DIV><SPAN class=577394520-16082010><SPAN class=577394520-16082010><FONT size=2
face=Arial></FONT></SPAN></SPAN> </DIV>
<DIV><SPAN class=577394520-16082010><SPAN class=577394520-16082010><FONT size=2
face=Arial>Thanks for any help anyone can provide!! My perms are 755 and
nagios user owns the plugins and I've run successfully with nagios user and got
0 output. I'm really stumped!!</FONT></SPAN></DIV></SPAN>
<DIV><SPAN class=577394520-16082010><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2 face=Arial>Here's the code for
the plugins:<BR></FONT></SPAN></DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2
face=Arial>*******************************************</FONT></SPAN></DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2
face=Arial>check7204temp.pl:</FONT></SPAN></DIV>
<DIV><SPAN class=577394520-16082010><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=577394520-16082010><SPAN lang=EN>
<P><FONT size=2 face=Arial>#!/usr/bin/perl -w</FONT></P>
<P><FONT size=2 face=Arial># check_ciscotemp.pl</FONT></P>
<P><FONT size=2 face=Arial>#</FONT></P>
<P><FONT size=2 face=Arial># Copyright (C) 2000 Leland E. Vandervort
<leland@mmania.com> # # This program is free software; you can
redistribute it and/or # modify it under the terms of the GNU General Public
License # as published by the Free Software Foundation; either version 2 # of
the License, or (at your option) any later version.</FONT></P>
<P><FONT size=2 face=Arial>#</FONT></P>
<P><FONT size=2 face=Arial># This program is distributed in the hope that it
will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty #
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General
Public License for more details.</FONT></P>
<P><FONT size=2 face=Arial>#</FONT></P>
<P><FONT size=2 face=Arial># you should have received a copy of the GNU General
Public License # along with this program (or with Nagios); if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA
02111-1307, USA ####################################</FONT></P>
<P><FONT size=2 face=Arial># Nagios pluging to check inlet and outlet
temperatures on # Cisco router platforms which support environmental monitoring
# (7200, 7500, GSR12000...) ####################################</FONT></P>
<P><FONT size=2 face=Arial># default temperature thresholds are 30C for inlet,
40C outlet.</FONT></P>
<P><FONT size=2 face=Arial># if input or output is less than thresholds, returns
OK # if equal to (the temps don't change that rapidly) returns WARNING # if
greater than threshold, returns CRITICAL # if undetermined, or cannot access
environmental, returns UNKNOWN # (in accordance with the plugin coding
guidelines) ####################################</FONT></P>
<P><FONT size=2 face=Arial>use Net::SNMP;</FONT></P>
<P><FONT size=2 face=Arial>use Getopt::Long;</FONT></P>
<P><FONT size=2 face=Arial>#use strict;</FONT></P>
<P><FONT size=2 face=Arial>&Getopt::Long::config('auto_abbrev');</FONT></P>
<P><FONT size=2 face=Arial>#my $critical_vals;</FONT></P>
<P><FONT size=2 face=Arial>#my $warning_vals;</FONT></P>
<P><FONT size=2 face=Arial>#my $inlet_warn;</FONT></P>
<P><FONT size=2 face=Arial>#my $outlet_warn;</FONT></P>
<P><FONT size=2 face=Arial>#my $status;</FONT></P>
<P><FONT size=2 face=Arial>my $response = "";</FONT></P>
<P><FONT size=2 face=Arial>my $timeout = 10;</FONT></P>
<P><FONT size=2 face=Arial>my $community = "<SPAN
class=577394520-16082010>blah"</SPAN>;</FONT></P>
<P><FONT size=2 face=Arial>my $port = 161;</FONT></P>
<P><FONT size=2 face=Arial>my $INTAKE_TEMP = "1.3.6.1.4.1.9.9.13.1.3.1.3.1"; my
$OUTLET_TEMP = "1.3.6.1.4.1.9.9.13.1.3.1.3.3"; my $in_temp; my $out_temp; my
$inlet_thresh = 30; my $outlet_thresh = 34; my $hostnm; #my $OID; #my $session;
#my $state; #my $error;</FONT></P>
<P><FONT size=2 face=Arial>my %STATUSCODE = ( 'UNKNOWN' => '-1',</FONT></P>
<P><FONT size=2 face=Arial>'OK' => '0',</FONT></P>
<P><FONT size=2 face=Arial>'WARNING' => '1',</FONT></P>
<P><FONT size=2 face=Arial>'CRITICAL' => '2');</FONT></P>
<P><FONT size=2 face=Arial>my $state = "UNKNOWN";</FONT></P>
<P><FONT size=2 face=Arial> </FONT></P>
<P><FONT size=2 face=Arial>$SIG{'ALRM'} = sub {</FONT></P>
<P><FONT size=2 face=Arial>print "ERROR: No snmp response from $hostnm
(sigALRM)\n";</FONT></P>
<P><FONT size=2 face=Arial>exit($STATUSCODE{"UNKNOWN"});</FONT></P>
<P><FONT size=2 face=Arial>};</FONT></P>
<P><FONT size=2 face=Arial>Getopt::Long::Configure('bundling');</FONT></P>
<P><FONT size=2 face=Arial>$status = GetOptions</FONT></P>
<P><FONT size=2 face=Arial>("community=s", \$community,</FONT></P>
<P><FONT size=2 face=Arial>"C=s", \$community,</FONT></P>
<P><FONT size=2 face=Arial>"H=s", \$hostnm,</FONT></P>
<P><FONT size=2 face=Arial>"hostname=s", \$hostnm,</FONT></P>
<P><FONT size=2 face=Arial>"port=i", \$port,</FONT></P>
<P><FONT size=2 face=Arial>"timeout=i", \$timeout,</FONT></P>
<P><FONT size=2 face=Arial>"c=s", \$critical_vals,</FONT></P>
<P><FONT size=2 face=Arial>"w=s", \$warning_vals,</FONT></P>
<P><FONT size=2 face=Arial>"ithresh=i", \$inlet_thresh,</FONT></P>
<P><FONT size=2 face=Arial>"othresh=i", \$outlet_thresh);</FONT></P>
<P><FONT size=2 face=Arial></FONT></P>
<P><FONT size=2 face=Arial>if($status == 0) {</FONT></P>
<P><FONT size=2 face=Arial>&show_help;</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>unless (defined($hostnm)) {</FONT></P>
<P><FONT size=2 face=Arial>$hostnm = shift || &show_help;</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>if (defined($critical_vals)) {</FONT></P>
<P><FONT size=2 face=Arial>if ($critical_vals =~ m/^([0-9]+)[,:]([0-9]+)$/)
{</FONT></P>
<P><FONT size=2 face=Arial>($inlet_thresh,$outlet_thresh) = ($1, $2);</FONT></P>
<P><FONT size=2 face=Arial>} else {</FONT></P>
<P><FONT size=2 face=Arial>die "Cannot Parse Critical Thresholds\n";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>if (defined($warning_vals)) {</FONT></P>
<P><FONT size=2 face=Arial>if ($warning_vals =~ m/^([0-9]+)[:,]([0-9]+)$/)
{</FONT></P>
<P><FONT size=2 face=Arial>($inlet_warn,$outlet_warn) = ($1, $2);</FONT></P>
<P><FONT size=2 face=Arial>} else {</FONT></P>
<P><FONT size=2 face=Arial>die "Cannot Parse Warning Thresholds\n";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>}else{</FONT></P>
<P><FONT size=2 face=Arial>$inlet_warn=$inlet_thresh;</FONT></P>
<P><FONT size=2 face=Arial>$outlet_warn=$outlet_thresh;</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>alarm($timeout); </FONT></P>
<P><FONT size=2 face=Arial>$in_temp = &SNMPGET($INTAKE_TEMP);</FONT></P>
<P><FONT size=2 face=Arial>$out_temp = &SNMPGET($OUTLET_TEMP);</FONT></P>
<P><FONT size=2 face=Arial>if (($in_temp < $inlet_thresh) &&
($out_temp < $outlet_thresh)) {</FONT></P>
<P><FONT size=2 face=Arial>$state = "OK";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>elsif (($in_temp == $inlet_thresh) || ($out_temp ==
$outlet_thresh)) {</FONT></P>
<P><FONT size=2 face=Arial>if(($in_temp > $inlet_thresh) || ($out_temp >
$outlet_thresh)) {</FONT></P>
<P><FONT size=2 face=Arial>$state = "CRITICAL";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>else {</FONT></P>
<P><FONT size=2 face=Arial>$state = "WARNING";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>elsif (($in_temp > $inlet_thresh) || ($out_temp
> $outlet_thresh)) {</FONT></P>
<P><FONT size=2 face=Arial>$state = "CRITICAL";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>else {</FONT></P>
<P><FONT size=2 face=Arial>$state = "WARNING";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>print "$state Inlet Temp: $in_temp Outlet Temp:
$out_temp\n"; exit($STATUSCODE{$state});</FONT></P>
<P><FONT size=2 face=Arial>sub show_help {</FONT></P>
<P><FONT size=2 face=Arial>printf("\nPerl envmon temperature plugin for
Nagios\n");</FONT></P>
<P><FONT size=2 face=Arial>printf("Usage:\n");</FONT></P>
<P><FONT size=2 face=Arial>printf("</FONT></P>
<P><FONT size=2 face=Arial>check_ciscotemp [options] <hostname></FONT></P>
<P><FONT size=2 face=Arial>Options:</FONT></P>
<P><FONT size=2 face=Arial>-C snmp-community</FONT></P>
<P><FONT size=2 face=Arial>-p snmp-port</FONT></P>
<P><FONT size=2 face=Arial>-i input temperature threshold</FONT></P>
<P><FONT size=2 face=Arial>-o output temperature threshold</FONT></P>
<P><FONT size=2 face=Arial>");</FONT></P>
<P><FONT size=2 face=Arial>printf("Copyright (C)2000 Leland E.
Vandervort\n");</FONT></P>
<P><FONT size=2 face=Arial>printf("check_ciscotemp comes with absolutely NO
WARRANTY either implied or explicit\n");</FONT></P>
<P><FONT size=2 face=Arial>printf("This program is licensed under the terms of
the\n");</FONT></P>
<P><FONT size=2 face=Arial>printf("GNU General Public License\n(check source
code for details)\n\n\n");</FONT></P>
<P><FONT size=2 face=Arial>exit($STATUSCODE{"UNKNOWN"});</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>sub SNMPGET {</FONT></P>
<P><FONT size=2 face=Arial>$OID = shift;</FONT></P>
<P><FONT size=2 face=Arial>($session,$error) = Net::SNMP->session(</FONT></P>
<P><FONT size=2 face=Arial>Hostname => $hostnm,</FONT></P>
<P><FONT size=2 face=Arial>Community => $community,</FONT></P>
<P><FONT size=2 face=Arial>Port => $port</FONT></P>
<P><FONT size=2 face=Arial>);</FONT></P>
<P><FONT size=2 face=Arial>if(!defined($session)) {</FONT></P>
<P><FONT size=2 face=Arial>printf("$state %s\n", $error);</FONT></P>
<P><FONT size=2 face=Arial>exit($STATUSCODE{$state});</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>if(!defined($response =
$session->get_request($OID))) {</FONT></P>
<P><FONT size=2 face=Arial>printf("$state %s\n",
$session->error());</FONT></P>
<P><FONT size=2 face=Arial>$session->close();</FONT></P>
<P><FONT size=2 face=Arial>exit($STATUSCODE{$state});</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>$session->close();</FONT></P>
<P><FONT size=2 face=Arial>return($response->{$OID});</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT face=Arial><FONT size=2><SPAN
class=577394520-16082010>*******************************************************<BR></SPAN></FONT></FONT><FONT
face=Arial><FONT size=2><SPAN class=577394520-16082010>code for
checkciscotemp.pl</SPAN> </FONT></FONT></P></SPAN></SPAN></SPAN><SPAN lang=EN>
<P><FONT size=2 face=Arial>#!/usr/bin/perl -w</FONT></P>
<P><FONT size=2 face=Arial># check_ciscotemp.pl</FONT></P>
<P><FONT size=2 face=Arial>#</FONT></P>
<P><FONT size=2 face=Arial># Copyright (C) 2000 Leland E. Vandervort
<leland@mmania.com> # # This program is free software; you can
redistribute it and/or # modify it under the terms of the GNU General Public
License # as published by the Free Software Foundation; either version 2 # of
the License, or (at your option) any later version.</FONT></P>
<P><FONT size=2 face=Arial>#</FONT></P>
<P><FONT size=2 face=Arial># This program is distributed in the hope that it
will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty #
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General
Public License for more details.</FONT></P>
<P><FONT size=2 face=Arial>#</FONT></P>
<P><FONT size=2 face=Arial># you should have received a copy of the GNU General
Public License # along with this program (or with Nagios); if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA
02111-1307, USA ####################################</FONT></P>
<P><FONT size=2 face=Arial># Nagios pluging to check inlet and outlet
temperatures on # Cisco router platforms which support environmental monitoring
# (7200, 7500, GSR12000...) ####################################</FONT></P>
<P><FONT size=2 face=Arial># default temperature thresholds are 30C for inlet,
40C outlet.</FONT></P>
<P><FONT size=2 face=Arial># if input or output is less than thresholds, returns
OK # if equal to (the temps don't change that rapidly) returns WARNING # if
greater than threshold, returns CRITICAL # if undetermined, or cannot access
environmental, returns UNKNOWN # (in accordance with the plugin coding
guidelines) ####################################</FONT></P>
<P><FONT size=2 face=Arial>use Net::SNMP;</FONT></P>
<P><FONT size=2 face=Arial>use Getopt::Long;</FONT></P>
<P><FONT size=2 face=Arial>#use strict;</FONT></P>
<P><FONT size=2 face=Arial>&Getopt::Long::config('auto_abbrev');</FONT></P>
<P><FONT size=2 face=Arial>#my $critical_vals;</FONT></P>
<P><FONT size=2 face=Arial>#my $warning_vals;</FONT></P>
<P><FONT size=2 face=Arial>#my $inlet_warn;</FONT></P>
<P><FONT size=2 face=Arial>#my $outlet_warn;</FONT></P>
<P><FONT size=2 face=Arial>#my $status;</FONT></P>
<P><FONT size=2 face=Arial>my $response = "";</FONT></P>
<P><FONT size=2 face=Arial>my $timeout = 10;</FONT></P>
<P><FONT size=2 face=Arial>my $community = "<SPAN
class=577394520-16082010>blah</SPAN>";</FONT></P>
<P><FONT size=2 face=Arial>my $port = 161;</FONT></P>
<P><FONT size=2 face=Arial>my $INTAKE_TEMP = "1.3.6.1.4.1.9.9.13.1.3.1.3.1"; my
$OUTLET_TEMP = "1.3.6.1.4.1.9.9.13.1.3.1.3.3"; my $in_temp; my $out_temp; my
$inlet_thresh = 22; my $outlet_thresh = 32; my $hostnm; #my $OID; #my $session;
#my $state; #my $error;</FONT></P>
<P><FONT size=2 face=Arial>my %STATUSCODE = ( 'UNKNOWN' => '-1',</FONT></P>
<P><FONT size=2 face=Arial>'OK' => '0',</FONT></P>
<P><FONT size=2 face=Arial>'WARNING' => '1',</FONT></P>
<P><FONT size=2 face=Arial>'CRITICAL' => '2');</FONT></P>
<P><FONT size=2 face=Arial>my $state = "UNKNOWN";</FONT></P>
<P><FONT size=2 face=Arial> </FONT></P>
<P><FONT size=2 face=Arial>$SIG{'ALRM'} = sub {</FONT></P>
<P><FONT size=2 face=Arial>print "ERROR: No snmp response from $hostnm
(sigALRM)\n";</FONT></P>
<P><FONT size=2 face=Arial>exit($STATUSCODE{"UNKNOWN"});</FONT></P>
<P><FONT size=2 face=Arial>};</FONT></P>
<P><FONT size=2 face=Arial>Getopt::Long::Configure('bundling');</FONT></P>
<P><FONT size=2 face=Arial>$status = GetOptions</FONT></P>
<P><FONT size=2 face=Arial>("community=s", \$community,</FONT></P>
<P><FONT size=2 face=Arial>"C=s", \$community,</FONT></P>
<P><FONT size=2 face=Arial>"H=s", \$hostnm,</FONT></P>
<P><FONT size=2 face=Arial>"hostname=s", \$hostnm,</FONT></P>
<P><FONT size=2 face=Arial>"port=i", \$port,</FONT></P>
<P><FONT size=2 face=Arial>"timeout=i", \$timeout,</FONT></P>
<P><FONT size=2 face=Arial>"c=s", \$critical_vals,</FONT></P>
<P><FONT size=2 face=Arial>"w=s", \$warning_vals,</FONT></P>
<P><FONT size=2 face=Arial>"ithresh=i", \$inlet_thresh,</FONT></P>
<P><FONT size=2 face=Arial>"othresh=i", \$outlet_thresh);</FONT></P>
<P><FONT size=2 face=Arial></FONT></P>
<P><FONT size=2 face=Arial>if($status == 0) {</FONT></P>
<P><FONT size=2 face=Arial>&show_help;</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>unless (defined($hostnm)) {</FONT></P>
<P><FONT size=2 face=Arial>$hostnm = shift || &show_help;</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>if (defined($critical_vals)) {</FONT></P>
<P><FONT size=2 face=Arial>if ($critical_vals =~ m/^([0-9]+)[,:]([0-9]+)$/)
{</FONT></P>
<P><FONT size=2 face=Arial>($inlet_thresh,$outlet_thresh) = ($1, $2);</FONT></P>
<P><FONT size=2 face=Arial>} else {</FONT></P>
<P><FONT size=2 face=Arial>die "Cannot Parse Critical Thresholds\n";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>if (defined($warning_vals)) {</FONT></P>
<P><FONT size=2 face=Arial>if ($warning_vals =~ m/^([0-9]+)[:,]([0-9]+)$/)
{</FONT></P>
<P><FONT size=2 face=Arial>($inlet_warn,$outlet_warn) = ($1, $2);</FONT></P>
<P><FONT size=2 face=Arial>} else {</FONT></P>
<P><FONT size=2 face=Arial>die "Cannot Parse Warning Thresholds\n";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>}else{</FONT></P>
<P><FONT size=2 face=Arial>$inlet_warn=$inlet_thresh;</FONT></P>
<P><FONT size=2 face=Arial>$outlet_warn=$outlet_thresh;</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>alarm($timeout); </FONT></P>
<P><FONT size=2 face=Arial>$in_temp = &SNMPGET($INTAKE_TEMP);</FONT></P>
<P><FONT size=2 face=Arial>$out_temp = &SNMPGET($OUTLET_TEMP);</FONT></P>
<P><FONT size=2 face=Arial>if (($in_temp < $inlet_thresh) &&
($out_temp < $outlet_thresh)) {</FONT></P>
<P><FONT size=2 face=Arial>$state = "OK";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>elsif (($in_temp == $inlet_thresh) || ($out_temp ==
$outlet_thresh)) {</FONT></P>
<P><FONT size=2 face=Arial>if(($in_temp > $inlet_thresh) || ($out_temp >
$outlet_thresh)) {</FONT></P>
<P><FONT size=2 face=Arial>$state = "CRITICAL";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>else {</FONT></P>
<P><FONT size=2 face=Arial>$state = "WARNING";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>elsif (($in_temp > $inlet_thresh) || ($out_temp
> $outlet_thresh)) {</FONT></P>
<P><FONT size=2 face=Arial>$state = "CRITICAL";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>else {</FONT></P>
<P><FONT size=2 face=Arial>$state = "WARNING";</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>print "$state Inlet Temp: $in_temp Outlet Temp:
$out_temp\n"; exit($STATUSCODE{$state});</FONT></P>
<P><FONT size=2 face=Arial>sub show_help {</FONT></P>
<P><FONT size=2 face=Arial>printf("\nPerl envmon temperature plugin for
Nagios\n");</FONT></P>
<P><FONT size=2 face=Arial>printf("Usage:\n");</FONT></P>
<P><FONT size=2 face=Arial>printf("</FONT></P>
<P><FONT size=2 face=Arial>check_ciscotemp [options] <hostname></FONT></P>
<P><FONT size=2 face=Arial>Options:</FONT></P>
<P><FONT size=2 face=Arial>-C snmp-community</FONT></P>
<P><FONT size=2 face=Arial>-p snmp-port</FONT></P>
<P><FONT size=2 face=Arial>-i input temperature threshold</FONT></P>
<P><FONT size=2 face=Arial>-o output temperature threshold</FONT></P>
<P><FONT size=2 face=Arial>");</FONT></P>
<P><FONT size=2 face=Arial>printf("Copyright (C)2000 Leland E.
Vandervort\n");</FONT></P>
<P><FONT size=2 face=Arial>printf("check_ciscotemp comes with absolutely NO
WARRANTY either implied or explicit\n");</FONT></P>
<P><FONT size=2 face=Arial>printf("This program is licensed under the terms of
the\n");</FONT></P>
<P><FONT size=2 face=Arial>printf("GNU General Public License\n(check source
code for details)\n\n\n");</FONT></P>
<P><FONT size=2 face=Arial>exit($STATUSCODE{"UNKNOWN"});</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>sub SNMPGET {</FONT></P>
<P><FONT size=2 face=Arial>$OID = shift;</FONT></P>
<P><FONT size=2 face=Arial>($session,$error) = Net::SNMP->session(</FONT></P>
<P><FONT size=2 face=Arial>Hostname => $hostnm,</FONT></P>
<P><FONT size=2 face=Arial>Community => $community,</FONT></P>
<P><FONT size=2 face=Arial>Port => $port</FONT></P>
<P><FONT size=2 face=Arial>);</FONT></P>
<P><FONT size=2 face=Arial>if(!defined($session)) {</FONT></P>
<P><FONT size=2 face=Arial>printf("$state %s\n", $error);</FONT></P>
<P><FONT size=2 face=Arial>exit($STATUSCODE{$state});</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>if(!defined($response =
$session->get_request($OID))) {</FONT></P>
<P><FONT size=2 face=Arial>printf("$state %s\n",
$session->error());</FONT></P>
<P><FONT size=2 face=Arial>$session->close();</FONT></P>
<P><FONT size=2 face=Arial>exit($STATUSCODE{$state});</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><FONT size=2 face=Arial>$session->close();</FONT></P>
<P><FONT size=2 face=Arial>return($response->{$OID});</FONT></P>
<P><FONT size=2 face=Arial>}</FONT></P>
<P><SPAN class=577394520-16082010><FONT size=2
face=Arial>*********************************************</FONT></SPAN></P>
<P><SPAN class=577394520-16082010><FONT size=2
face=Arial>Thanks,</FONT></SPAN></P></SPAN></DIV>
<DIV align=left><SPAN lang=EN><STRONG><FONT size=2
face=Verdana></FONT></STRONG><FONT size=2 face=Verdana></DIV>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal
align=left><B style="mso-bidi-font-weight: normal"><SPAN
style="FONT-FAMILY: Arial"><FONT size=3>M<SPAN
class=577394520-16082010>issy</SPAN></FONT></SPAN></B></FONT></SPAN></P></BODY></HTML>