Check_APC_PDU Command Definition

Mike Lindsey mike-nagios at 5dninja.net
Tue Apr 5 21:22:31 CEST 2011


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.

But it's easy to figure out what's going on.  Simply change your 
command_line to:
     command_line    $USER1$/check_apc_pdu.pl -H $HOSTADDRESS$ -C public 
2>&1

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.

Sun, Mar 27, 2011 at 2:45 PM, Peter Roddan 
<Peter.Roddan at sbsworldwide.com <mailto:Peter.Roddan at sbsworldwide.com>> 
wrote:
> 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 :
>
> "OK: All Outlets ok. | load=25"
>
> I have put the following command definition in :
>
> # 'check_apc_pdu' command definition
>
> define command{
>
> command_name              check_apc_pdu
>
> command_line $USER1$/check_apc_pdu.pl <http://check_apc_pdu.pl> -H 
> $HOSTADDRESS$ -C public
>
> }
>
> And defined the following service
>
> define service{
>
>                 use                                         
> generic-service                ; Inherit values from a template
>
>                 hostgroup_name                             apc         
> ; The name of the host the service is associated with
>
>                 service_description        
> check_apc                           ; The service description
>
>                 check_command                              
> check_apc_pdu                 ; The command used to monitor the service
>
>                 normal_check_interval 5                              ; 
> Check the service every 5 minutes under normal conditions
>
>                 retry_check_interval      
> 1                              ; Re-check the service every minute 
> until its final/hard state is determined
>
>                 }
>
> However, my APC PDUs report an error for this service, with  a status 
> information of "(Null)"
>
> I'd be grateful for anyone who could point me in the right direction 
> of where I'm going wrong.
>
>

-- 
Mike Lindsey

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110405/6a1bac86/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list