patch: safe reload

Matthew Kent mkent at magoazul.com
Thu Nov 11 05:41:37 CET 2004


Followup patch from the discussion a week ago about having nagios not
die on HUP when the configs contain errors.

This patch does a few things, but mainly adds a function similar to
xodtemplate_cache_objects which stores the running config in it's own
'running_config.cache' file. This requires reading a few more config
options from nagios.cfg into memory first, but has the benefit of adding
some sanity checking to them which didn't exist in the xdata/ functions
which reference them. It should also keep an invalid 'objects.cache'
from being written which the cgis could try to read and error out.

So on a HUP from the web interface or command line, if a config error is
encountered in the main nagios.cfg, it will print the problems and an
error about not being able to load the new config to the log and
console, then read 'running_config.cache' and 'objects.cache' back into
memory and keep going. If the error is just in the object definitions,
the new config will be read in and used, while the objects will come
from the cache.  

The more I think about it, the more I believe this is a good
feature/behaviour, if there's anything as an admin you don't want
stopped it's probably your monitoring.

Patch is against latest cvs. 2nd patch for documentation included as
well.
-- 
Matthew Kent <mkent at magoazul.com>
http://magoazul.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios-2.0a1-safe_reload.patch
Type: text/x-patch
Size: 28218 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20041110/c72ce336/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios-2.0a1-safe_reload_docs.patch
Type: text/x-patch
Size: 4495 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20041110/c72ce336/attachment-0001.bin>


More information about the Developers mailing list