So I have a script which is able to update NSClient++ to a specific version, generate a nsclient.ini configuration file and generate the host and service config in Nagios. That way I can switch easily between the legacy nsclient and the modern nsclient (>0.4.1.105). Each type (legacy - modern) has a different set of services each using their own template, meaning I can also switch between NRPE versions.. I'm using the import folder on the Nagios XI server to import the update configuration.
Is it possible to force a full overwrite when importing nagios configuration files? At this time when I put Nagios cfg files (in the correct format) in the /usr/local/nagios/etc/import/ folder the new services are added to the old services. This while I expected the new configs to overwrite the existing host and it's services.
If there is no way to force an overwrite with the import folder, is the only other way to clean this up to first delete teh host and it's services with:
This implies I would need two 'apply configurations' for each host I would update to a modern NSCLient version? Knowing that my applies are already a long and painful operation I would really love some way to force overwrite an existing host.Run each of the following scripts from: /usr/local/nagiosxi/scripts
cd /usr/local/nagiosxi/scripts/
./nagiosql_delete_service.php –-config=LOC_MASShost_1
After the services have successfully been deleted, the host can be removed as well:
./nagiosql_delete_host.php –-host=LOC_MASShost_1
Once the host is removed, the new configuration can be applied and verified by running the reconfigure_nagios.sh
./reconfigure_nagios.sh
(see screenshot for the result of the two configs added to each other instead of being overwrited)
Grtz
Willem