Trouble with Nagios

10 posts / 0 new
Last post
#1 Thu, 05/21/2009 - 16:11
Denverb

Trouble with Nagios

I am having what appears to be permission issues with Nagios on Centos. After I create a virtual server in Virtualmin, I get 402 errors when accessing any side bar options (anything from the cgi-bin). I have checked and triple checked all my script aliases, permissions, libraries, etc. Also tried different versions of Nagios, including the current beta. I also tried setting up a domain nagios.mydomain.com and pointing the web root to the nagios install, thinking it may be a host header setting. I got the exact same behavior.

I am out of ideas of what could be causing this.

Thu, 05/21/2009 - 16:13
Joe
Joe's picture

Check the error_log.

--

Check out the forum guidelines!

Fri, 05/22/2009 - 11:25 (Reply to #2)
Denverb

[Tue May 19 23:18:52 2009] [alert] getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive

This is a recurring error in the httpd/error_log

And that is basically the behavior I get, like the user is begin denied access.

Fri, 05/22/2009 - 18:01 (Reply to #3)
andreychek

What does the Apache VirtualHost section look like for your Nagios install?

And, do you have any .htaccess files in the DocumentRoot for Nagios?

Also, do other Virtual Servers work okay?
-Eric

Mon, 05/25/2009 - 16:48 (Reply to #4)
Denverb

Here is my Virtual Host section

[code:1]<VirtualHost *>
DocumentRoot /usr/local/nagios/share
<Directory "/usr/local/nagios/share">
allow from all
Options FollowSymLinks Includes IncludesNOEXEC +Indexes
</Directory>
<Directory "/usr/local/nagios/sbin">
Options ExecCGI
</Directory>
SuexecUserGroup nagios nagios
Alias /nagios/ "/usr/local/nagios/share/"
ScriptAlias /cgi-bin/ "/usr/local/nagios/sbin/"
Options ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes MultiViews SymLinksIfOwnerMatch
</VirtualHost>[/code:1]

I do not have an .htaccess in my document root.

Other virtual server do work correctly.

Mon, 05/25/2009 - 18:23 (Reply to #5)
andreychek

Hmm, okay, a few thoughts.

First, while I don't think this is the problem, it may cause issues down the road... using <VirtualHost *> can cause trouble... rather than that, you might want to use:

<VirtualHost 1.2.3.4:80>

Listing your actual IP address and the port number, rather than just a * in there.

Regarding your issue -- poking in the docs, they mention that when not accessed in CGI mode, that the SuexecUserGroup isn't used, and that it falls back to the User directive.

So in your main httpd.conf or apache2.conf file, what is the User directive set to? And does that particular user exist on your system?
-Eric

Tue, 05/26/2009 - 03:04 (Reply to #6)
Denverb

The User is set to apache.
This user does exist and is part of the nagios command group/

Tue, 05/26/2009 - 07:36 (Reply to #7)
andreychek

Hmm, well, it seems like something is up with the user Apache is trying to use for that Virtual Server. I'd try 3 things:

1. Comment out the SuexecUserGroup line, restart Apache, and try it again

2. Verify that there isn't another User directive in your Apache config somewhere that's confusing things

3. Make sure that the "apache" user is working as expected -- on the command line, type "id apache" and make sure it returns some sane information

Thu, 05/28/2009 - 16:29 (Reply to #8)
Denverb

Still no change in the behavior.
There are no other User directives.
id apache returns all correct information.

Thu, 05/28/2009 - 20:12 (Reply to #9)
Joe
Joe's picture

suexec can't work in /usr/local. You'll have to either move nagios to some place in the suexec_docroot, or run it as the Apache user. You cannot use suexec outside of the suexec_docroot.

--

Check out the forum guidelines!

Topic locked