In the recent version of Nagios XI (5.8.4) I create/copy new *.cfg
file and put it into /usr/local/nagios/etc/import
. The click on "Apply Configuration". The file will be moved from /usr/local/nagios/etc/import
to /usr/local/nagios/etc/services
. The name of the file will not be changed so overwriting the existing configuration files is prevented. The content of the file (new services) will be imported into the internal database. If you make any mistake in the cfg file, the existing configuration will not be changed (the revert mechanism will be used) but your cfg file will be removed from /usr/local/nagios/etc/import
. Just have a spare copy somewhere.
There is no problem if a service with the same name exists in some other cfg file. The existing one will not be changed. You will end with both services active, they will have different "Config Name" parameter.
If you want to change properties of the existing services (those defined in /usr/local/nagios/etc/services/*.cfg
) then copy the corresponding cfg file to import folder, change the content, and do "Apply Configuration". For me, this operation does not change history of the manipulated service.
I still have to find out how to remove user-defined services (those defined in /usr/local/nagios/etc/services/*.cfg
) without GUI.
All these are completely undocumented features, and the official answer from Nagios is that the user should not touch any cfg files by itself. How on the earth they expect that someone will create and/or adapt 1000+ services by clicking GUI when, for example, he needs to duplicate the system on the second server?