Page 1 of 1

Bulk modify host templates

Posted: Wed Mar 27, 2019 1:56 pm
by jvaira
Hello,
I am looking for a way to modify host template settings in bulk. There is a single setting that I need to change across all of my host templates but have about two hundred of them per XI instance to change for a total of about 1000. I am not seeing a straight forward way to do this but am hoping there may be a work around. My first thought was to set the setting in a master template and then link that to all of the host templates but not seeing a way to do that in bulk either.

Re: Bulk modify host templates

Posted: Wed Mar 27, 2019 2:27 pm
by lmiltchev
Currently, there is no way to modify templates in bulk in the GUI. This would be a nice feature request candidate though.

For the time being, you would need to modify the hosttemplates.cfg, and re-import the config. You could use a sed command modify your templates, drop the hosttemplates.cfg in the /usr/local/nagios/etc/import directory, and run /usr/local/nagiosxi/scripts/reconfigure_nagios.sh script. This would be probably the easiest way to accomplish your goal. Hope this helps.