Nagios .. this can save your config

nagios-virt-hostgroup-smallTips of the day : That can save your life if you have a running Nagios but the config file is corrupted. In fact this  happens if you remotely edit the file with WinSCP / Notepad++ and the file is erased with the wrong one.

1. Get the configuration back

  1. Always do backup , but will never save you 4 hours of file editing.
  2. Always use “nagios3 reload” command instead of “nagios3 restart”, it will keep your Nagios alive, even if your configuration file (or one its component  is corrupted).
  3. If you are in trouble, no need for a disk forensic … go directly to the “Object Cache File” from Nagios /usr/local/nagios/var/objects.cache . This is the compiled result of all your config files.

2. Extra info

  • Format: object_cache_file=<file_name>
  • Example: object_cache_file=/usr/local/nagios/var/objects.cache

This directive is used to specify a file in which a cached copy of object definitions should be stored. The cache file is (re)created every time Nagios is (re)started and is used by the CGIs.
It is intended to speed up config file caching in the CGIs and allow you to edit the source object config files while Nagios is running without affecting the output displayed in the CGIs.

Be the first to comment

Leave a Reply

Your email address will not be published.