Nagios Core Startup Issue

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nagios Core Startup Issue

Post by sreinhardt »

Directories likely will need X, actual config files should only need nagios user and group(at least one that nagios is a part of, not necessarily the nagios group) read access. Also make sure that all of those files and directories listed in nagios.cfg do exist even if they are empty. It would make sense if your verifications were done as root, that you didn't see this before, as nagios will drop permissions before verification.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
xcomm
Posts: 10
Joined: Fri Dec 20, 2013 12:21 am

Re: Nagios Core Startup Issue

Post by xcomm »

so just to test permission of nagios I chmod 777 -R the objects and private dir.
The script still failed on the same objects and private/resources.cfg
I dropped to the nagios user and ran nagios -v (nagios.cfg path), and the validation passes.
Is the script being run as the from the init.d NagiosUser=
I have it set to nagios currently.

-PS Thanks for all the help
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios Core Startup Issue

Post by slansing »

What were you running it with before? Another random user, or root? I believe you should only be able to control the init script as root or nagios. If you can verify that it did not work as the root user then we might have another issue.
xcomm
Posts: 10
Joined: Fri Dec 20, 2013 12:21 am

Re: Nagios Core Startup Issue

Post by xcomm »

have been trying to execute the init script "service nagios start" as root.
The init.d/nagios is configure as user/group nagios.
The file permissions are 100% out of the way and it still errors on those two dir.

right now i am just running nagios -d (configpath)
then killing the process and removing the files that are specified under the init scripts stop section.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core Startup Issue

Post by scottwilkerson »

What do you get if you run the following

Code: Select all

su nagios -c 'ls -la /etc/nagios/private/resource.cfg'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
xcomm
Posts: 10
Joined: Fri Dec 20, 2013 12:21 am

Re: Nagios Core Startup Issue

Post by xcomm »

-rwxr-xr-x. 1 root root 892 Mar 18 13:36 /etc/nagios/private/resource.cfg
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core Startup Issue

Post by scottwilkerson »

The dot at the end of the file permissions leads me to believe we migh have SELinux permissions set on the file...
Is SELINUX enabled on the machine?

Code: Select all

getenforce
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
xcomm
Posts: 10
Joined: Fri Dec 20, 2013 12:21 am

Re: Nagios Core Startup Issue

Post by xcomm »

BAM!!!

Works once I know the system was running SELINUX.
Why its always good idea to check the installed packages when you dont install the OS.

Thanks again for all the help when it came down to a system issue.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Core Startup Issue

Post by tmcdonald »

Good to hear! I'll be locking this thread now but feel free to open another if you need help in the future.
Former Nagios employee
Locked