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

Karim Vaes kvaes at vangenechten.com
Mon Mar 7 01:01:17 CET 2005


Anybody an idea how to get php checks working with nagios?

Regards

Karim

>>> Subhendu Ghosh <sghosh at sghosh.org> 3/03/2005 13:57:56 >>>

Before coding - might want to see if there is an existing VmWare ESX 
plugin ;)

http://www.nagiosexchange.org/Linux.55.0.html?&tx_netnagext_pi1[p_view]=148


On Thu, 3 Mar 2005, Karim Vaes wrote:

> 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.
>>
>
>

-- 



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: InterScan_Disclaimer.txt
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20050307/b707f2ea/attachment.txt>


More information about the Devel mailing list