[Nagiosplug-devel] PluginHelp: php scripts give "Status: 404"
Andreas Ericsson
ae at op5.se
Wed Mar 2 09:37:08 CET 2005
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.se
OP5 AB www.op5.se
Lead Developer
More information about the Devel
mailing list