External Commands not working

John McGowan mcgowan at lynch2.com
Wed Apr 27 20:47:07 CEST 2005



Marc Powell wrote:

>  
>
>>-----Original Message-----
>>From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
>>admin at lists.sourceforge.net] On Behalf Of John McGowan
>>Sent: Wednesday, April 27, 2005 11:57 AM
>>To: nagios-users at lists.sourceforge.net
>>Subject: Re: [Nagios-users] External Commands not working
>>
>>    
>>
>
>[snip]
>  
>
>>okay here is my documentation....
>>
>>[root at gob rw]# pwd
>>/usr/local/nagios/var/rw
>>[root at gob rw]# ls -al
>>total 8
>>drwxrwsr-x  2 nagios nagiocmd 4096 Apr 27 11:04 .
>>drwxrwxr-x  4 nagios nagios   4096 Apr 27 11:49 ..
>>prw-rw----  1 nagios nagiocmd    0 Apr 27 11:04 nagios.cmd
>>    
>>
>
>Looks good. How about permissions on /usr/local/nagios/var? Is it at
>least 755? Everything above that should be fine as you've indicated your
>CGI's work so Apache has access to /usr/local/nagios at the least. 
>  
>
The "dot dot" entry above shows that...  Here's the whole directory, 
just in case...

[root at gob var]# cd /usr/local/nagios
[root at gob nagios]# ls -al
total 36
drwxr-xr-x   8 root   root   4096 Apr 22 22:02 .
drwxr-xr-x  16 root   root   4096 Apr 22 17:14 ..
drwxrwxr-x   2 nagios nagios 4096 Apr 22 16:58 bin
drwxrwxr-x   2 nagios nagios 4096 Apr 22 22:43 etc
drwxr-xr-x   2 root   root   4096 Apr 22 20:34 libexec
drwxrwxr-x   2 nagios nagios 4096 Apr 22 16:58 sbin
drwxrwxr-x   9 nagios nagios 4096 Apr 22 20:34 share
drwxrwxr-x   4 nagios nagios 4096 Apr 27 12:24 var

>>[root at gob rw]# cat /etc/group | grep nagios
>>nagios:x:502:
>>nagiocmd:x:503:nagios,nobody
>>    
>>
>
>Yep. Good here as well.
>
> 
>  
>
>>[root at gob rw]# ps -ef | grep httpd
>>root     20389     1  0 Apr22 ?        00:00:00
>>/usr/local/apache2/bin/httpd -k start
>>nobody    9430 20389  0 11:07 ?        00:00:00
>>/usr/local/apache2/bin/httpd -k start
>>nobody    9431 20389  0 11:07 ?        00:00:00
>>/usr/local/apache2/bin/httpd -k start
>>nobody    9432 20389  0 11:07 ?        00:00:00
>>/usr/local/apache2/bin/httpd -k start
>>nobody    9433 20389  0 11:07 ?        00:00:00
>>/usr/local/apache2/bin/httpd -k start
>>nobody    9434 20389  0 11:07 ?        00:00:00
>>/usr/local/apache2/bin/httpd -k start
>>nobody    9446 20389  0 11:08 ?        00:00:00
>>/usr/local/apache2/bin/httpd -k start
>>nobody    9495 20389  0 11:09 ?        00:00:00
>>/usr/local/apache2/bin/httpd -k start
>>root     10431  6343  0 11:50 pts/1    00:00:00 grep httpd
>>    
>>
>
>April 22nd was the last restart. I know you said you've restarted
>multiple times but since I don't know when you modified the groups file,
>I'd suggest stopping and restarting (reload or HUP isn't sufficient).
>This is my next best guess.
> 
>[more snips]
>  
>
Ah ha I thought we were on to something there... I was doing and 
"apachectl restart" to restart the web server.  I completely shutdown 
the web server and started it back up again, but I'm still seeing the 
same problem.

[root at gob nagios]# ps -ef | grep httpd
root     11081     1  0 12:21 ?        00:00:00 
/usr/local/apache2/bin/httpd -k start
nobody   11082 11081  0 12:21 ?        00:00:00 
/usr/local/apache2/bin/httpd -k start
....


>  
>
>>	Error: Could not open command file
>>'/usr/local/nagios/var/rw/nagios.cmd' for update!
>>
>>
>>
>>	The permissions on the external command file and/or directory
>>    
>>
>may be
>  
>
>>incorrect. Read the FAQs on how to setup proper permissions.
>>    
>>
>
>This really is indicative of a file system permissions issue. Does your
>apache error_log provide any more useful information? 
>
No, nothing is showing up in the error_log

I see this in the access log...

206.137.122.225 - - [27/Apr/2005:12:29:36 -0500] "GET 
/nagios/cgi-bin/cmd.cgi?cmd_typ=25&host=downserver HTTP/1.1" 200 2605
206.137.122.225 - - [27/Apr/2005:12:29:37 -0500] "POST 
/nagios/cgi-bin/cmd.cgi HTTP/1.1" 200 1393

And the latest error_log shows the hard reset of apache, and nothing more...

[root at gob logs]# tail error_log
[Wed Apr 27 11:05:25 2005] [notice] Digest: done
[Wed Apr 27 11:05:26 2005] [notice] Apache/2.0.52 (Unix) DAV/2 
configured -- resuming normal operations
[Wed Apr 27 11:07:56 2005] [notice] SIGHUP received.  Attempting to restart
[Wed Apr 27 11:07:56 2005] [notice] Digest: generating secret for digest 
authentication ...
[Wed Apr 27 11:07:56 2005] [notice] Digest: done
[Wed Apr 27 11:07:57 2005] [notice] Apache/2.0.52 (Unix) DAV/2 
configured -- resuming normal operations
[Wed Apr 27 12:21:11 2005] [notice] caught SIGTERM, shutting down
[Wed Apr 27 12:21:19 2005] [notice] Digest: generating secret for digest 
authentication ...
[Wed Apr 27 12:21:19 2005] [notice] Digest: done
[Wed Apr 27 12:21:20 2005] [notice] Apache/2.0.52 (Unix) DAV/2 
configured -- resuming normal operations


>Is that were the stat() error came from? 
>
The error I'm seeing  is in the browser...

>Everything else looks fine with the exception of the possible need for a hard restart of apache.
>  
>
That's a shame, because I did a hard restart and it's still not working...

Should I recompile with some debugging options or something to figure 
out what cmd.cgi is having a problem with?

> 
>
>--
>Marc
>
>
>-------------------------------------------------------
>SF.Net email is sponsored by: Tell us your software development plans!
>Take this survey and enter to win a one-year sub to SourceForge.net
>Plus IDC's 2005 look-ahead and a copy of this survey
>Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id5hix
>_______________________________________________
>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
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050427/91b9c005/attachment.html>


More information about the Users mailing list