Getting to Macros from script

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


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