LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-13-2009, 06:11 PM   #1
Wenceslao
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Rep: Reputation: 0
Getting Nagios to work on CentOS 5.3


Hello, everybuddy.

I have installed nagios on a freshly installed CentOS 5.3 by following the instructions in this page:

<http://wiki.centos.org/HowTos/Nagios>

and some pages linked there to install the repos, etc.

Everything seems to be in place. I have not yet modified the config files, so it's just what came in the rpm's.

If I run:

nagios -v /etc/nagios/nagios.cfg

I get:
------------------------------------------
Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 12-01-2008
License: GPL

Reading configuration data...

Running pre-flight check on configuration data...

Checking services...
...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
-----------------------------------------------

However:

service nagios start
Starting nagios:CONFIG ERROR! Start aborted. Check your Nagios configuration.

Or if I remove the output redirection from line 125 of /etc/init.d/nagios which is:
$NagiosBin -v $NagiosCfgFile > /dev/null 2>&1;
then I get this:

------------------------------------
Starting nagios:
Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 12-01-2008
License: GPL

Reading configuration data...

Error in configuration file '/etc/nagios/nagios.cfg' - Line 465 (Check result path is not a valid directory)

***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data definitions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

CONFIG ERROR! Start aborted. Check your Nagios configuration.
---------------------------------


I've checked and the check_result_path directive in the nagios.cfg file points to a valid directory, where nagios has rwx.

And when I log into the Nagios web page, using nagiosadmin and the password I created for it, most of the links on the left give me an error page:


------------------------------------
Whoops!

Error: Could not read host and service status information!

The most common cause of this error message (especially for new users), is the fact that Nagios is not actually running. If Nagios is indeed not running, this is a normal error message. It simply indicates that the CGIs could not obtain the current status of hosts and services that are being monitored. If you've just installed things, make sure you read the documentation on starting Nagios.

Some other things you should check in order to resolve this error include:

1. Check the Nagios log file for messages relating to startup or status data errors.
2. Always verify configuration options using the -v command-line option before starting or restarting Nagios!

Make sure you read the documentation on installing, configuring and running Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at http://www.nagios.org.
------------------------------------


If I comment out the check (line 125) and start nagios anyway, I still get this page.

Any clues, anyone?
 
Old 08-13-2009, 06:15 PM   #2
Wenceslao
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Okay, I posted and I realised what the problem was just five secs later after strugling with this for days:

selinux

I had forgotten to reboot after editing /etc/selinux/config to look like this:

----------------------------
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled <------------HERE'S THE DIFF
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0
----------------------------

So selinux was still enabled and enforing. As soon as I disabled it, service nagios start started working, and so did it's page.

So if you find the same situation, this one's on me!


Thanks anyway to all those who came here to help.
 
Old 08-13-2009, 07:22 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Wenceslao View Post
So selinux was still enabled and enforing. As soon as I disabled it, service nagios start started working, and so did it's page.

So if you find the same situation, this one's on me!
No it isn't the solution. SELinux policy violations are there to be fixed.
 
Old 08-17-2009, 11:30 AM   #4
Wenceslao
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Well... no, technically that's only a work around. It would be a lot better in a security sensitive environment to fix the selinux problem, no doubt about that.
Also, it would be nice if the rpm included whatever fix is necessary, or if at least the tutorials said what it is. But it seams the guys writing the tutorials also have selinux disabled or in permissive mode, because they don't even mention the problem.

I'm writing to rpmforge. Perhaps they can fix this in the rpm.
 
Old 08-17-2009, 12:11 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If you could post the Sealert / AVC messages we could have a look at it, NP.
 
Old 08-17-2009, 12:58 PM   #6
Wenceslao
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Sure! But...eh... uhhh... could you give me another clue? :-)

How do I find it? Do I need to enable SElinux again... Sorry, but I'm really without a clue with SELinux. I'll gladly RTFM, but which one?
 
Old 08-17-2009, 01:07 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Wenceslao View Post
How do I find it? Do I need to enable SElinux again...
I'm afraid that enabling SELinux and running auditd + setroubleshootd (+ sealert if you run a desktop) would be easiest since I don't know what it'll be about (http_t context labelling, http CGI boolean, et cetera).


Quote:
Originally Posted by Wenceslao View Post
Sorry, but I'm really without a clue with SELinux. I'll gladly RTFM, but which one?
I'd love to give you a Fine Manual to Read but let's first try to get some messages?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Nagios and Oreon (Nagios web front end) installation and Configuration LXer Syndicated Linux News 1 05-31-2016 07:26 AM
Help with Nagios (CentOS 5.2) sxa Linux - Software 2 02-28-2009 04:53 AM
Which ports do I need to unblock for dhcp/nagios (dhcp_check) to work. MikeyCarter Linux - Software 3 08-29-2008 12:22 PM
LXer: Nagios 2.5 and Oreon 1.3 (Nagios web front end) installation with screenshots LXer Syndicated Linux News 0 08-11-2006 05:33 PM
nagios doesn't work after an upgrade on RH9 ntoughe Linux - Software 2 11-04-2005 01:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration