<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [Nagios-users] Problems with check_apc_ups.pl</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Bruce,</FONT>
</P>
<P><FONT SIZE=2>I turned warnings off in the file I passed to you - also the "use lib utils.pm" was commented out. Please check that you are using the new check_apc_ups.pl file. Also, you should keep the line "require '/usr/lib/nagios/plugins/utils.pm'" assuming that is the location of utils.pm - or adjust it to the correct location of utils.pm from the plugin distribution.</FONT></P>
<P><FONT SIZE=2>I found debugging the script was helped by directly running the snmpget command as follows:</FONT>
</P>
<P><FONT SIZE=2>snmpget -v 1 -c public ups.hostname.com .1.3.6.1.4.1.318.1.1.1.7.2.3.0</FONT>
</P>
<P><FONT SIZE=2>where you substitute your community name for "public" and your hostname for "ups.hostname.com". This OID is for upsAdvTestDiagnosticsResults - a value of 1 indicates OK.</FONT></P>
<P><FONT SIZE=2>If you do not get a reasonable value for the above snmp command then you have a problem with either:</FONT>
<BR><FONT SIZE=2>a) the snmp toolkit installation</FONT>
<BR><FONT SIZE=2>b) the configuration of your APC UPS (i.e. community name/IP address allowed)</FONT>
<BR><FONT SIZE=2>c) other network configuration problems</FONT>
</P>
<P><FONT SIZE=2>I suspect the problem you are experiencing may be found this way.</FONT>
</P>
<P><FONT SIZE=2>regards, </FONT>
<BR><FONT SIZE=2>Bruce Friedman </FONT>
<BR><FONT SIZE=2>Snap-on, Inc. </FONT>
<BR><FONT SIZE=2>eTechnician System Administrator </FONT>
<BR><FONT SIZE=2>bruce.l.friedman@snapon.com </FONT>
<BR><FONT SIZE=2>(847) 478-7262 (voice) </FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Gilbert, Bruce [<A HREF="mailto:bruce.gilbert@tmgus.mosaic.com">mailto:bruce.gilbert@tmgus.mosaic.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Tuesday, March 02, 2004 4:29 PM</FONT>
<BR><FONT SIZE=2>To: 'Friedman, Bruce L.'</FONT>
<BR><FONT SIZE=2>Cc: 'nagios-users@lists.sourceforge.net'</FONT>
<BR><FONT SIZE=2>Subject: RE: [Nagios-users] Problems with check_apc_ups.pl</FONT>
</P>
<BR>
<P><FONT SIZE=2>Bruce,</FONT>
</P>
<P><FONT SIZE=2>First, thanks for the help.</FONT>
</P>
<P><FONT SIZE=2>When running your version I get the following error -</FONT>
</P>
<P><FONT SIZE=2>./check_apc_ups.pl -H 172.23.0.27</FONT>
<BR><FONT SIZE=2>Can't locate utils.pm in @INC (@INC contains:</FONT>
<BR><FONT SIZE=2>/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0</FONT>
<BR><FONT SIZE=2>/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi</FONT>
<BR><FONT SIZE=2>/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl</FONT>
<BR><FONT SIZE=2>/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi</FONT>
<BR><FONT SIZE=2>/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl</FONT>
<BR><FONT SIZE=2>/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0) at</FONT>
<BR><FONT SIZE=2>./check_apc_ups.pl line 20</FONT>
</P>
<BR>
<P><FONT SIZE=2>I had that same problem with the included script that came with the plugins.</FONT>
<BR><FONT SIZE=2>Changing the plugin version or yours with the following allows the script to</FONT>
<BR><FONT SIZE=2>run, but both give -</FONT>
</P>
<P><FONT SIZE=2>Status: unknown, Batt Cap(%): unknown, Batt Time: unknown, Batt status:</FONT>
<BR><FONT SIZE=2>unknown, Batt temp(F): unknown, Batt repl: unknown, Output load (%):</FONT>
<BR><FONT SIZE=2>unknown, Diag result: unknown, I-Freq: unknown, I-V,Max,Min: unknown,</FONT>
<BR><FONT SIZE=2>unknown, unknown, O-Freq: unknown, O-V: unknown,</FONT>
</P>
<P><FONT SIZE=2># use lib utils.pm;</FONT>
<BR><FONT SIZE=2>#require '/usr/lib/nagios/plugins/utils.pm';</FONT>
<BR><FONT SIZE=2>use lib "/usr/local/nagios/libexec/";</FONT>
<BR><FONT SIZE=2>use utils qw(%ERRORS &print_revision &support &usage);</FONT>
</P>
<P><FONT SIZE=2>If you have any other suggestions, I would appreciate it. I am running</FONT>
<BR><FONT SIZE=2>net-snmp-5.0.9. Would upgrading perhaps alleviate the problem?</FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Friedman, Bruce L. [<A HREF="mailto:Bruce.L.Friedman@snapon.com">mailto:Bruce.L.Friedman@snapon.com</A>] </FONT>
<BR><FONT SIZE=2>Sent: Tuesday, March 02, 2004 1:03 PM</FONT>
<BR><FONT SIZE=2>To: 'Gilbert, Bruce'</FONT>
<BR><FONT SIZE=2>Subject: RE: [Nagios-users] Problems with check_apc_ups.pl</FONT>
</P>
<BR>
<P><FONT SIZE=2>Bruce, </FONT>
<BR><FONT SIZE=2>I have made numerous changes to check_apc_ups.pl to get it to work. Please</FONT>
<BR><FONT SIZE=2>try out the attached file and let me know if it works for you. I am using</FONT>
<BR><FONT SIZE=2>net-snmp-5.1-2.1</FONT>
<BR><FONT SIZE=2>regards, </FONT>
<BR><FONT SIZE=2>Bruce Friedman </FONT>
<BR><FONT SIZE=2>Snap-on, Inc. </FONT>
<BR><FONT SIZE=2>eTechnician System Administrator </FONT>
<BR><FONT SIZE=2>bruce.l.friedman@snapon.com </FONT>
<BR><FONT SIZE=2>(847) 478-7262 (voice) </FONT>
<BR><FONT SIZE=2>-----Original Message----- </FONT>
<BR><FONT SIZE=2>From: Gilbert, Bruce [<A HREF="mailto:bruce.gilbert@tmgus.mosaic.com">mailto:bruce.gilbert@tmgus.mosaic.com</A>] </FONT>
<BR><FONT SIZE=2>Sent: Tuesday, March 02, 2004 11:49 AM </FONT>
<BR><FONT SIZE=2>To: 'nagios-users@lists.sourceforge.net' </FONT>
<BR><FONT SIZE=2>Subject: [Nagios-users] Problems with check_apc_ups.pl </FONT>
</P>
<BR>
<P><FONT SIZE=2>When running the check_apc_ups.pl plugin it returns the following messages -</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>./check_apc_ups.pl -H 172.23.0.27 </FONT>
<BR><FONT SIZE=2>Output status: unknown | Rem time: unknown | Battery status: unknown | </FONT>
<BR><FONT SIZE=2>Battery temp(C): unknown | Battery repl: unknown | Output load (%): unknown </FONT>
<BR><FONT SIZE=2>| Diag result: unknown </FONT>
<BR><FONT SIZE=2>If I run ./check_snmp with the OID for battery temp or output status it </FONT>
<BR><FONT SIZE=2>returns OK. I've downloaded the APC MIBS, copied them to the appropriate </FONT>
<BR><FONT SIZE=2>folder, and even tried export MIBS=All. </FONT>
<BR><FONT SIZE=2>Is there anything else I am missing or any suggestions? </FONT>
<BR><FONT SIZE=2>Thanks, </FONT>
<BR><FONT SIZE=2>Bruce Gilbert </FONT>
<BR><FONT SIZE=2>Senior Network Manager </FONT>
<BR><FONT SIZE=2>Mosaic Sales Solutions </FONT>
<BR><FONT SIZE=2> </FONT>
</P>
<BR>
<P><FONT SIZE=2>------------------------------------------------------- </FONT>
<BR><FONT SIZE=2>SF.Net is sponsored by: Speed Start Your Linux Apps Now. </FONT>
<BR><FONT SIZE=2>Build and deploy apps & Web services for Linux with </FONT>
<BR><FONT SIZE=2>a free DVD software kit from IBM. Click Now! </FONT>
<BR><FONT SIZE=2><A HREF="http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click" TARGET="_blank">http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click</A> </FONT>
<BR><FONT SIZE=2>_______________________________________________ </FONT>
<BR><FONT SIZE=2>Nagios-users mailing list </FONT>
<BR><FONT SIZE=2>Nagios-users@lists.sourceforge.net </FONT>
<BR><FONT SIZE=2><A HREF="https://lists.sourceforge.net/lists/listinfo/nagios-users" TARGET="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</A> </FONT>
<BR><FONT SIZE=2>::: Please include Nagios version, plugin version (-v) and OS when reporting</FONT>
<BR><FONT SIZE=2>any issue. </FONT>
<BR><FONT SIZE=2>::: Messages without supporting info will risk being sent to /dev/null </FONT>
<BR><FONT SIZE=2> </FONT>
</P>
</BODY>
</HTML>