External Commands not working

John McGowan mcgowan at lynch2.com
Wed Apr 27 18:57:09 CEST 2005



Marc Powell wrote:

>  
>
>>-----Original Message-----
>>From: John McGowan [mailto:mcgowan at lynch2.com]
>>Sent: Wednesday, April 27, 2005 11:18 AM
>>To: Marc Powell
>>Cc: nagios-users at lists.sourceforge.net
>>Subject: Re: [Nagios-users] External Commands not working
>>
>>I'm running FC3, so SELinux is probably the issue?  But What?  Do I
>>    
>>
>need
>  
>
>>to do something else to the configuration to make it work?  Is there
>>something else written up on SELinux and how it affects nagios?
>>    
>>
>
>The problems to date have been related to executing the CGI's (ala
>http://64.233.187.104/search?q=cache:npfOizO28JIJ:www.meulie.net/forum_v
>iewtopic.php%3F21.729+nagios+selinux&hl=en) but it would still be my
>first, best guess as to the cause of your problem. You'll probably find
>messages in one of your system log files containing with "avc:  denied
>..." with the specific reason for the denial. I'd suggest you take a
>look at
>http://fedora.redhat.com/docs/selinux-apache-fc3/sn-debugging-and-custom
>izing.html#sn-policy-debugging, specifically at audit2allow to help
>determine policy changes.
>  
>
Well, I thought It might be SELinux, but alas I disabled it when i 
installed FC3.   :) 

[root at gob log]# cat /etc/selinux/config
SELINUX=disabled

Which makes sense, because external commands are the ONLY thing I'm 
having a problem with.  All the other CGI stuff seems to be working 
fine, and I didn't see anything in /var/log/messages....

darnit...

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


[root at gob rw]# cat /etc/group | grep nagios
nagios:x:502:
nagiocmd:x:503:nagios,nobody


[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


[root at gob rw]# ps -ef | grep nagios
nagios    9319     1  0 11:04 ?        00:00:00 
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root     10442  6343  0 11:51 pts/1    00:00:00 grep nagios

And when I try to do something simple like add a comment to a host or 
acknowledge a notification via the web interface i get this...


I compiled and installed nagios 1.2 on the same machine with a pretty 
standard ./configure, make, make install....

I looked at the ./configure --help to see if I missed an enable option 
to support external command, but I couldn't find anything like that...


The last place I can think of to dump out here is my nagios.cfg file...

[root at gob etc]# cat nagios.cfg | grep exter
[snip]
check_external_commands=1
[snip]
log_external_commands=1


> 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.
>
> An error occurred while attempting to commit your command for processing.










>You're the first that I know of to have problems with external commands.
>I don't use SELinux so I can't be specific but perhaps those links, plus
>http://fedora.redhat.com/docs/selinux-apache-fc3/ will be useful to you.
>Perhaps someone else who uses SELinux can chime in as well.
>
>If you do determine that it's SELinux that's the problem, a synopsis
>back to the list for the archives would be useful.
>
>Thanks,
>
>--
>Marc 
>  
>
>>I'm running 1.2 and I compiled it myself.  Everything is running very
>>smoothly except for external commands...
>>
>>I could give you all of what you ask for below, but since i'm running
>>    
>>
>FC,
>  
>
>>i probably just need a little more info about how SELinux affects
>>    
>>
>nagios.
>
>If you're going to leave SELinux enabled you should probably understand
>more about it than just how it affects Nagios.
>
>
>-------------------------------------------------------
>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/aaf3692b/attachment.html>


More information about the Users mailing list