[Nagiosplug-devel] Re: Re: PluginHelp: php scripts give "Status: 404"

Karim Vaes kvaes at vangenechten.com
Thu Mar 3 02:51:21 CET 2005


Thanks for the reply, but I already tried that part...

Here are my configs:

# 'check_esx' command definition
define command {
	command_name	check_esx
	command_line	/usr/local/nagios/libexec/esx/test.php
$HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$
	}

define service{
 	use				generic-service
 	hostgroup_name			VMWARE
 	service_description		VMWARE-CPU
 	check_command			check_esx!CPU!85!90
 	contact_groups			Helpdesk
 	}

/usr/local/nagios/libexec/esx/test.php
#!/usr/bin/php -q
<?php
echo "Hello World\n";
?>


and I still get:

ESX1 VMWARE-CPU
UNKNOWN 	03-03-2005 11:43:45 	0d 0h 1m 18s 	1/3 	Status:
404 

ESX9 VMWARE-CPU
UNKNOWN 	03-03-2005 11:43:33 	0d 0h 1m 28s 	1/3 	Status:
404 

Regards

Karim

From: Andreas Ericsson <ae at ...>
Subject: Re: PluginHelp: php scripts give "Status: 404"
Newsgroups: gmane.network.nagios.plugins.devel
Date: Wed, 02 Mar 2005 18:36:12 +0100

Karim Vaes wrote:
> Hi,
> 
> I'm trying to write some additional scripts for nagios.  The thing
is
> that my own coding skills are limited to php.  So I've written a few
> scripts that do what their supposed to do from commandline, yet when
I
> configure them in nagios, I get a "Status: 404" in the status
> information.
> 
> I did some research and found out that it's got something to do with
> the link between going from CGI to php.  Does anyone have any
experience
> with this, and could you give me some pointers on how I can get my
php
> scripts working?
> 

Try /usr/bin/php -q, which will cause it not to print http and html
headers.
The CLI version of PHP also supports hashbang lines, so you can add it
there
#!/usr/bin/php -q
<?php
script(doing, cool, things);
?>

> Thanks in advance
> 

Cheers.

> Karim Vaes
> Sys Admin Vangenechten Group
> 
> 
> 
> 
> Config (file path's are correct)
> # 'check_esx' command definition
> define command {
> 	command_name	check_esx
> 	command_line	/usr/bin/php
> /usr/local/nagios/libexec/esx/esx.php $HOSTADDRESS$ $ARG1$ $ARG2$
> $ARG3$
> 	}
> 
> 
> 
>
------------------------------------------------------------------------
> 
> Privileged Confidential Information may be contained in this
message.
> If you are not the addressee indicated in this message (or
responsible for delivery of 
> the message to such person), you may not copy or deliver this message
to anyone.
> In such case, you should destroy this message and kindly notify the
sender by reply 
> email. Please advise immediately if you or your employer does not
consent to Internet 
> email for messages of this kind. Opinions, conclusions and other
information in this 
> message that do not relate to the official business of my firm shall
be understood 
> as neither given nor endorsed by it.
> 

-- 
Andreas Ericsson                   andreas.ericsson at ...
OP5 AB                             www.op5.se 
Lead Developer

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real
users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click 
_______________________________________________________
Nagios Plugin Development Mailing List Nagiosplug-devel at ...
Unsubscribe at
https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel 
::: Please include plugins version (-v) and OS when reporting any
issue. 
::: Messages without supporting info will risk being sent to /dev/null


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: InterScan_Disclaimer.txt
URL: <http://nagios-plugins.org/archive/devel/attachments/20050303/f9d1ea3b/attachment.txt>


More information about the Devel mailing list