Restarting Nagios via "sudo"

Miner, Jonathan W (CSC) (US SSA) jonathan.w.miner at baesystems.com
Thu Feb 2 15:32:41 CET 2006


Hi -

We've setup the $NAGIOS/etc directory so that all the admins can edit the files, and the files are under RCS control.  I'm pretty comfortable with this, and am pretty sure the permissions are fine. All the files are world-readable except for resource.cfg which is only readable by user (root) and group (admin).

If I try to use "sudo /etc/init.d/nagios force-reload" to restart Nagios, I get no errors on the screen, but in the event log:

Error: Cannot open resource file '/disk0/tools/nagios-2.0rc2/etc/resource.cfg' for reading!

and Nagios starts running, but since $USER1$ is not defined, all the checks start failing.

However, if I "su" to root first, and then run "/etc/init.d/nagios force-reload" everything starts correctly.  Apparently, there is a subtle difference between using "sudo" verses "su". Any ideas?

I've already come up with two possible solutions...

1) Put the "nagios" user into the "admin" group, which would ensure that Nagios could read the files.

2) Change the group ownership of the $NAGIOS/etc files back to "nagios" and add my admin staff into the "nagios" group.  This is likely the better solution, especially if there are certain admins that I don't want messing with the Nagios configuration!

How do other people maintain control over their Nagios configurations?


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
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





More information about the Users mailing list