Check_APC_PDU Command Definition

Peter Roddan Peter.Roddan at sbsworldwide.com
Wed Apr 6 16:35:33 CEST 2011


Hi Mike,

Thanks very much for your help.
I've changed the below, and I now get the following as the Nagios Status Information.

/usr/local/nagios/libexec/check_apc_pdu.pl: line 24: use: command not found
/usr/local/nagios/libexec/check_apc_pdu.pl: line 25: use: command not found
/usr/local/nagios/libexec/check_apc_pdu.pl: line 26: use: command not found
/usr/local/nagios/libexec/check_apc_pdu.pl: line 27: syntax error near unexpected token `('
/usr/local/nagios/libexec/check_apc_pdu.pl: line 27: `use utils qw($TIMEOUT %ERRORS &print_revision &support);'

So I guess there's a problem with the script after all.
Strange, as it works when I run it from the command line as the nagios user.

Back to the drawing board with that one I suppose!

Thanks,

Peter.




Peter Roddan
Senior Systems Analyst

SBS Worldwide Ltd - Dartford
DDI No: +44 (0)1322 424741
Email :Peter.Roddan at sbsworldwide.com<mailto:Peter.Roddan at sbsworldwide.com>
Website :sbsworldwide.com<http://sbsworldwide.com>

[cid:image001.jpg at 01CBF470.444E0770]
P  Think before you print!

From: Mike Lindsey [mailto:mike-nagios at 5dninja.net]
Sent: 05 April 2011 20:23
To: Nagios Users List
Cc: Peter Roddan
Subject: Re: [Nagios-users] Check_APC_PDU Command Definition

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/20110406/9a79b2e3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 48202 bytes
Desc: image001.jpg
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110406/9a79b2e3/attachment.jpg>
-------------- 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