<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    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
      moz-do-not-send="true" href="mailto:Peter.Roddan@sbsworldwide.com">Peter.Roddan@sbsworldwide.com</a>>
    wrote:<o:p></o:p>
    <blockquote
cite="mid:4AF89336841CA740B4338F482A8FC74C11BA6D74D0@message-drt.sbsworldwide.com"
      type="cite">
      <div class="WordSection1">
        <div>
          <div>
            <div>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>
              <o:p></o:p>
              <p class="MsoNormal" style="">“OK: All Outlets ok. |
                load=25”<o:p></o:p></p>
              <p class="MsoNormal" style="">I have put the following
                command definition in :<o:p></o:p></p>
              <p class="MsoNormal" style=""># 'check_apc_pdu' command
                definition<o:p></o:p></p>
              <p class="MsoNormal" style="">define command{<o:p></o:p></p>
              <p class="MsoNormal" style="">command_name             
                check_apc_pdu<o:p></o:p></p>
              <p class="MsoNormal" style="">command_line $USER1$/<a
                  moz-do-not-send="true" 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="">}<o:p></o:p></p>
              <p class="MsoNormal" style=""> <o:p></o:p></p>
              <p class="MsoNormal" style="">And defined the following
                service <o:p></o:p></p>
              <p class="MsoNormal" style=""> <o:p></o:p></p>
              <p class="MsoNormal" style="">define service{<o:p></o:p></p>
              <p class="MsoNormal" style="">               
                use                                        
                generic-service                ; Inherit values from a
                template<o:p></o:p></p>
              <p class="MsoNormal" style="">               
                hostgroup_name                             apc         ;
                The name of the host the service is associated with<o:p></o:p></p>
              <p class="MsoNormal" style="">               
                service_description       
                check_apc                           ; The service
                description<o:p></o:p></p>
              <p class="MsoNormal" style="">               
                check_command                              check_apc_pdu
                                ; The command used to monitor the
                service<o:p></o:p></p>
              <p class="MsoNormal" style="">               
                normal_check_interval 5                              ;
                Check the service every 5 minutes under normal
                conditions<o:p></o:p></p>
              <p class="MsoNormal" style="">               
                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="">                }<o:p></o:p></p>
              <p class="MsoNormal" style=""> <o:p></o:p></p>
              <p class="MsoNormal" style=""> <o:p></o:p></p>
              <p class="MsoNormal" style="">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="">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>
              <br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Mike Lindsey</pre>
  </body>
</html>