Getting to Macros from script

Martin, Stanley G [GMG] Stanley.G.Martin at mail.sprint.com
Fri Jul 25 19:38:57 CEST 2003


I have numerous other virtual websites running PHP just fine, so it can't be that.  I wrote the same hello world in Perl and it worked fine.  It's something in the way that directory is configure in Apache that it doesn't know what to do with PHP scripts.  I think I'll try and re-write my script in Perl.

Stanley G. Martin
System Administrator
Sprint - EIS3 Customer Care 
Stanley.G.Martin at mail.sprint.com



-----Original Message-----
From: Marc Powell [mailto:mpowell at ena.com] 
Sent: Friday, July 25, 2003 12:25 PM
To: Martin, Stanley G [GMG]; nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] Getting to Macros from script

I have created a number of tools that work just fine in ~nagios/sbin. There's nothing really special about that directory as opposed to any others that have +ExecCGI specified. A google search for your error message seems to indicate a couple of possibilities --

1) you may be specifying a #! Line in your script (which isn't necessary for php).
2) php isn't installed correctly (check httpd.conf for the required php definitions).

--
Marc

> -----Original Message-----
> From: Martin, Stanley G [GMG] [mailto:Stanley.G.Martin at mail.sprint.com]
> Sent: Friday, July 25, 2003 12:15 PM
> To: Marc Powell; nagios-users at lists.sourceforge.net
> 
> If I write the old standby Hello World script using PHP, it won't run if I
> put it in the same directory as all the other .cgi scripts.
> 
> Errors from Apache error log
> [Fri Jul 25 12:11:21 2003] [error] (8)Exec format error: exec of
> /usr/local/nagios/sbin/hello.php failed
> [Fri Jul 25 12:11:21 2003] [error] [client 10.65.5.28] Premature end of
> script headers: /usr/local/nagios/sbin/hello.php
> 
> I'm sure this is an Apache problem.  I was just trying to see if anyone
> else had written some custom stuff for Nagios and tried to run it from the
> same sbin directory.  If I don't have any luck soon, I'll try writing it
> in Perl and see if that works.
> 
> Thanks,
> 
> Stanley G. Martin
> System Administrator
> Sprint - EIS3 Customer Care
> Stanley.G.Martin at mail.sprint.com
> 
> -----Original Message-----
> From: Marc Powell [mailto:mpowell at ena.com]
> Sent: Friday, July 25, 2003 8:29 AM
> To: Martin, Stanley G [GMG]; nagios-users at lists.sourceforge.net
> Subject: RE: [Nagios-users] Getting to Macros from script
> 
> 
> -----Original Message-----
> From: Martin, Stanley G [GMG] [mailto:Stanley.G.Martin at mail.sprint.com]
> Sent: Fri 7/25/2003 8:12 AM
> To: nagios-users at lists.sourceforge.net
> Cc:
> Subject: [Nagios-users] Getting to Macros from script
> 1) The Author defaults to the user logged in.  How do I get to that
> variable?
> Since Nagios uses .htaccess, it's stuffed into the CGI environment
> variable REMOTE_USER by the webserver and accessible by any httpd spawned
> process.
> 
> 2) I can run my script from one of my other websites, but when I drop it
> into the ~nagios/sbin directory, I get an execution failure.  How can I
> get my script to run from under the nagios directory structure?
> This is kind of an odd question since we didn't write your script nor do
> we have any idea of it's requirements. All I can suggest are basic
> troubleshooting ideas : verify permissions are correct, try running it as
> the user your web server runs as, verify paths in your script are sane and
> check you httpd error log for clues.
> 
> --
> Marc


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
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