Changing config files while nagios is running causes webinterface to mess up

Cook, Garry GWCOOK at mactec.com
Tue Jun 8 16:41:21 CEST 2004


This is really a question for Nagios-Users, so I've cross posted. Please
continue thread there if necessary.

nagios-devel-admin at lists.sourceforge.net wrote:
> Dear all,
> 
> currently, I often change the configuration files of Nagios (Ver. 1.1)
> because we get a lot of new equipment these days.
> If I change the config files while Nagios is running, the Nagios web
> page starts to mess up, e.g. several devices disappear.
> 
> My question: Am I doing something against the good practices
> if I edit
> the config files without stopping the Nagios service first?

That depends, does it annoy you or other Nagios users during the time
that you start editing the configs and when you restart Nagios? If not,
don't worry about it, I don't believe that it will hurt anything to do
it the way that you are.

> 
> I don't understand too much about the architecture of Nagios, but
> according to chapter "Stopping And Restarting Nagios" of the online
>     documentation
> http://nagios.sourceforge.net/docs/1_0/stoprestart.html 
> Nagios should only check the config files and (re)read them
> if I start,
> restart or reload the service.
> So, maybe, it's just the web interface which gets confused about my
> config changes? 

I believe that this is correct. Perhaps someone else can confirm.

> 
> Of course, I could use a second set of config files to work
> on. Then, I
> would write a script which checks the copied set of config
> files, stops
> the service, copies them to the directory used by Nagios and
> start the
> service again....

Here's what I do. First, I copy my original config to <config_file>.orig
and <config_file>.new, with the .orig file only being used if I should
happen to really screw up and need to back out. Then, I edit the .new
file. There is no need to write a script, as you can simply run nagios
with the -v (verify, I think) option against your new config to see if
it works:
/path/to/nagios/bin/nagios -v /path/to/nagios/etc/nagios.cfg
If there are no errors reported, copy <config_file>.new to
<config_file>.cfg and restart.

HTH

Garry W. Cook, CCNA
Network Infrastructure Manager
MACTEC, Inc. - http://www.mactec.com/
303.308.6228 (Office) - 720.220.1862 (Mobile)


-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite!  GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org




More information about the Users mailing list