Bulk modify host templates

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jvaira
Posts: 59
Joined: Tue Dec 22, 2015 7:40 pm

Bulk modify host templates

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Bulk modify host templates

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked