<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)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Webdings;
        panose-1:5 3 1 2 1 5 9 6 7 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas","serif";
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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 bgcolor=white lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Mike,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks very much for your help.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I’ve changed the below, and I now get the following as the Nagios Status Information.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>/usr/local/nagios/libexec/check_apc_pdu.pl: line 24: use: command not found</span></span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><br><span class=apple-style-span>/usr/local/nagios/libexec/check_apc_pdu.pl: line 25: use: command not found</span><br><span class=apple-style-span>/usr/local/nagios/libexec/check_apc_pdu.pl: line 26: use: command not found</span><br><span class=apple-style-span>/usr/local/nagios/libexec/check_apc_pdu.pl: line 27: syntax error near unexpected token `('</span><br><span class=apple-style-span>/usr/local/nagios/libexec/check_apc_pdu.pl: line 27: `use utils qw($TIMEOUT %ERRORS &print_revision &support);'<o:p></o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'>So I guess there’s a problem with the script after all.<o:p></o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'>Strange, as it works when I run it from the command line as the nagios user.<o:p></o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'><o:p> </o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'>Back to the drawing board with that one I suppose!<o:p></o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'><o:p> </o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'>Thanks,<o:p></o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'><o:p> </o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'>Peter.<o:p></o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Peter Roddan</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><br>Senior Systems Analyst <b><br><br>SBS Worldwide Ltd - Dartford </b><br>DDI No: +44 (0)1322 424741<br>Email :<a href="mailto:Peter.Roddan@sbsworldwide.com">Peter.Roddan@sbsworldwide.com</a><br>Website :<a href="http://sbsworldwide.com">sbsworldwide.com</a><br><br></span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><img border=0 width=334 height=108 id="_x0000_i1025" src="cid:image001.jpg@01CBF470.444E0770" alt="Description: http://www.sbsworldwide.com/_images/signatures/sig_logo.jpg"></span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:Webdings;color:#00CC00'>P</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#00CC00'>  </span><span style='font-size:8.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Think before you print!</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Mike Lindsey [mailto:mike-nagios@5dninja.net] <br><b>Sent:</b> 05 April 2011 20:23<br><b>To:</b> Nagios Users List<br><b>Cc:</b> Peter Roddan<br><b>Subject:</b> Re: [Nagios-users] Check_APC_PDU Command Definition<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Often, when you're getting an error and the only result you see is (null), what is happening is that your check script is printing to stderr.  It might be that you have perl in your path, but the perl script's #! line doesn't declare the full path to perl, or there's an access error of some sort.<br><br>But it's easy to figure out what's going on.  Simply change your command_line to:<br>    command_line    $USER1$/check_apc_pdu.pl -H $HOSTADDRESS$ -C public 2>&1<br><br>That will redirect standard error to standard out.  Next time Nagios runs the script it will capture the full output of the script and you should see right in your Nagios ui, what the issue is.<br><br>Sun, Mar 27, 2011 at 2:45 PM, Peter Roddan <<a href="mailto:Peter.Roddan@sbsworldwide.com">Peter.Roddan@sbsworldwide.com</a>> wrote: <o:p></o:p></p><div><div><div><div><p class=MsoNormal>If I log onto the nagios server as the nagios user, and run the command from the libexec folder (check_apc_pdu –H <address> -C public) I get the response : <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>“OK: All Outlets ok. | load=25”<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I have put the following command definition in :<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'># 'check_apc_pdu' command definition<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>define command{<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>command_name              check_apc_pdu<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>command_line $USER1$/<a href="http://check_apc_pdu.pl" target="_blank">check_apc_pdu.pl</a> -H $HOSTADDRESS$ -C public<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>}<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>And defined the following service <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>define service{<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                use                                         generic-service                ; Inherit values from a template<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                hostgroup_name                             apc         ; The name of the host the service is associated with<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                service_description        check_apc                           ; The service description<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                check_command                              check_apc_pdu                 ; The command used to monitor the service<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                normal_check_interval 5                              ; Check the service every 5 minutes under normal conditions<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                retry_check_interval      1                              ; Re-check the service every minute until its final/hard state is determined<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                }<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>However, my APC PDUs report an error for this service, with  a status information of “(Null)”<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I’d be grateful for anyone who could point me in the right direction of where I’m going wrong.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></div></div></div><p class=MsoNormal><br><br><o:p></o:p></p><pre>-- <o:p></o:p></pre><pre>Mike Lindsey<o:p></o:p></pre></div><BR>
________________________________________________________________________<BR>
THE DRIVING FORCE BEHIND FREIGHT MANAGEMENT<BR>
________________________________________________________________________<BR>
This email and any files transmitted with it are confidential and may be privileged or otherwise protected from disclosure. The email is intended solely for the use of the individual or entity to whom it is addressed and, if you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person. If you have received this email in error please notify hostmaster@sbsworldwide.com<BR>
<BR>
This e-mail has been scanned for all viruses by Messagelabs but no responsibility will be accepted by SBS Worldwide Group if the recipient&#x02019;s computer system is corrupted by information transmitted from this computer system nor for any delays or problems arising out of or caused by any corruption.<BR>
<BR>
All business is conducted strictly subject to SBS standard contract terms and conditions which are as follows:-<BR>
 <BR>
1) Business transacted by SBS Worldwide Ltd (UK):  British International Freight Association (BIFA) Standard Trading Conditions, latest edition<BR>
 <BR>
2) Business transacted by SBS Worldwide Inc (USA): National Customs Brokers And Forwarders Association of America (NCBFAA) Terms & Conditions of Service, latest edition<BR>
 <BR>
Copies will be supplied on request or can be viewed on our website as follows:-<BR>
 <BR>
http://www.sbsworldwide.com/legals<BR>
<BR>
All quotes , rates and surcharges are subject to market fluctuation.<BR>
<BR>
SBS Worldwide Ltd registered in England No: 1739816<BR>
<BR>
Registered Office: SBS Cargo Centre, Anchor Boulevard, Crossways, Dartford, Kent DA2 6SB, England<BR>
<BR>
________________________________________________________________________<BR>
</body></html>