Server Configuration

This page describes how you would modify Nagios configuration files, so whilst this works with both Nagios Core and Nagios XI it really only applies to the Core edition, with XI you would be using the wizards.

It is recommended that your config files go in your own directory rather than the standard directories or editing the standard files. The first step to doing this is to add your config directory to the main nagios configuration file:

  • Edit the file /usr/local/nagios/etc/nagios.cfg
  • Locate the section starting with the line # OBJECT CONFIGURATION FILE(S)
  • Add a line to the end of this section like this: cfg_dir=/usr/local/nagios/etc/geoffdoesstuff
  • Verify your modified configuration:
    /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
  • Restart Nagios:
    /etc/rc.d/init.d/nagios reload
This means that Nagios will now parse all files with the .cfg extension in the directory /usr/local/nagios/etc/geoffdoesstuff and include them. This helps keep all your stuff isolated and clean as well as aiding backup.