<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Marc Powell wrote:
<blockquote
 cite="midA7B0A9F02975A74A845FE85D0B95B8FA6A0B4D@misex01.ena.com"
 type="cite">
  <pre wrap="">
  </pre>
  <blockquote type="cite">
    <pre wrap="">-----Original Message-----
From: John McGowan [<a class="moz-txt-link-freetext" href="mailto:mcgowan@lynch2.com">mailto:mcgowan@lynch2.com</a>]
Sent: Wednesday, April 27, 2005 11:18 AM
To: Marc Powell
Cc: <a class="moz-txt-link-abbreviated" href="mailto:nagios-users@lists.sourceforge.net">nagios-users@lists.sourceforge.net</a>
Subject: Re: [Nagios-users] External Commands not working

I'm running FC3, so SELinux is probably the issue?  But What?  Do I
    </pre>
  </blockquote>
  <pre wrap=""><!---->need
  </pre>
  <blockquote type="cite">
    <pre wrap="">to do something else to the configuration to make it work?  Is there
something else written up on SELinux and how it affects nagios?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
The problems to date have been related to executing the CGI's (ala
<a class="moz-txt-link-freetext" href="http://64.233.187.104/search?q=cache:npfOizO28JIJ:www.meulie.net/forum_v">http://64.233.187.104/search?q=cache:npfOizO28JIJ:www.meulie.net/forum_v</a>
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
<a class="moz-txt-link-freetext" href="http://fedora.redhat.com/docs/selinux-apache-fc3/sn-debugging-and-custom">http://fedora.redhat.com/docs/selinux-apache-fc3/sn-debugging-and-custom</a>
izing.html#sn-policy-debugging, specifically at audit2allow to help
determine policy changes.
  </pre>
</blockquote>
Well, I thought It might be SELinux, but alas I disabled it when i
installed FC3.   :)  <br>
<br>
[root@gob log]# cat /etc/selinux/config<br>
SELINUX=disabled<br>
<br>
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....<br>
<br>
darnit...<br>
<br>
okay here is my documentation....<br>
<br>
[root@gob rw]# pwd<br>
/usr/local/nagios/var/rw<br>
[root@gob rw]# ls -al<br>
total 8<br>
drwxrwsr-x  2 nagios nagiocmd 4096 Apr 27 11:04 .<br>
drwxrwxr-x  4 nagios nagios   4096 Apr 27 11:49 ..<br>
prw-rw----  1 nagios nagiocmd    0 Apr 27 11:04 nagios.cmd<br>
<br>
<br>
[root@gob rw]# cat /etc/group | grep nagios<br>
nagios:x:502:<br>
nagiocmd:x:503:nagios,nobody<br>
<br>
<br>
[root@gob rw]# ps -ef | grep httpd<br>
root     20389     1  0 Apr22 ?        00:00:00
/usr/local/apache2/bin/httpd -k start<br>
nobody    9430 20389  0 11:07 ?        00:00:00
/usr/local/apache2/bin/httpd -k start<br>
nobody    9431 20389  0 11:07 ?        00:00:00
/usr/local/apache2/bin/httpd -k start<br>
nobody    9432 20389  0 11:07 ?        00:00:00
/usr/local/apache2/bin/httpd -k start<br>
nobody    9433 20389  0 11:07 ?        00:00:00
/usr/local/apache2/bin/httpd -k start<br>
nobody    9434 20389  0 11:07 ?        00:00:00
/usr/local/apache2/bin/httpd -k start<br>
nobody    9446 20389  0 11:08 ?        00:00:00
/usr/local/apache2/bin/httpd -k start<br>
nobody    9495 20389  0 11:09 ?        00:00:00
/usr/local/apache2/bin/httpd -k start<br>
root     10431  6343  0 11:50 pts/1    00:00:00 grep httpd<br>
<br>
<br>
[root@gob rw]# ps -ef | grep nagios<br>
nagios    9319     1  0 11:04 ?        00:00:00
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg<br>
root     10442  6343  0 11:51 pts/1    00:00:00 grep nagios<br>
<br>
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...<br>
<br>
<br>
I compiled and installed nagios 1.2 on the same machine with a pretty
standard ./configure, make, make install.... <br>
<br>
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...<br>
<br>
<br>
The last place I can think of to dump out here is my nagios.cfg file...<br>
<br>
[root@gob etc]# cat nagios.cfg | grep exter<br>
[snip]<br>
check_external_commands=1<br>
[snip]<br>
log_external_commands=1<br>
<br>
<br>
<blockquote type="cite">
  <div class="errorMessage">Error: Could not open command file
'/usr/local/nagios/var/rw/nagios.cmd' for update!</div>
  <p>
  </p>
  <div class="errorDescription">The permissions on the external command
file and/or directory may be incorrect. Read the FAQs on how to setup
proper permissions. </div>
  <p>
  </p>
  <div class="errorMessage">An error occurred while attempting to
commit your command for processing.</div>
</blockquote>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<blockquote
 cite="midA7B0A9F02975A74A845FE85D0B95B8FA6A0B4D@misex01.ena.com"
 type="cite">
  <pre wrap="">
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
<a class="moz-txt-link-freetext" href="http://fedora.redhat.com/docs/selinux-apache-fc3/">http://fedora.redhat.com/docs/selinux-apache-fc3/</a> 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 
  </pre>
  <blockquote type="cite">
    <pre wrap="">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
    </pre>
  </blockquote>
  <pre wrap=""><!---->FC,
  </pre>
  <blockquote type="cite">
    <pre wrap="">i probably just need a little more info about how SELinux affects
    </pre>
  </blockquote>
  <pre wrap=""><!---->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!  <a class="moz-txt-link-freetext" href="http://www.idcswdc.com/cgi-bin/survey?id5hix">http://www.idcswdc.com/cgi-bin/survey?id5hix</a>
_______________________________________________
Nagios-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null

  </pre>
</blockquote>
</body>
</html>