Hello,
I had a bunch of Windows servers which are now migrated to Linux hosts.
So I copied their configuration files to /usr/local/nagios/etc/import directory, ran a quick one liner to replace all xiwizard_windowsserver_host instances with xiwizard_linuxserver_host, applied configuration and all done. But when I look at the configuration file it now has the following directive
use xiwizard_windowsserver_host,xiwizard_linuxserver_host
while it should have been
use xiwizard_linuxserver_host
I can't seem to figure out how to fix it.
Am I missing something?
Any pointers would be appreciated.
Nagios XI and configuration
Re: Nagios XI and configuration
That's due to a feature of NagiosQL, where changes to referenced templates ADD to the existing list of templates, rather than REPLACE the old ones. The feature can sometimes be useful, but it can also be problematic, as you have seen.
At this point, the solution would be to modify your windows host definitions and manually remove the xiwizard_windowsserver_host template. This is hardly ideal, but I'm not sure there's another way around this with NagiosQL.
At this point, the solution would be to modify your windows host definitions and manually remove the xiwizard_windowsserver_host template. This is hardly ideal, but I'm not sure there's another way around this with NagiosQL.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Ethan Galstad
President
Ethan Galstad
President
Re: Nagios XI and configuration
Did you mean:
# cd /usr/local/nagios/etc/hosts
# perl -i -pe 'one liner here'
# service nagios restart
?
# cd /usr/local/nagios/etc/hosts
# perl -i -pe 'one liner here'
# service nagios restart
?
Re: Nagios XI and configuration
So could I use the import method to add a contact group to a couple hundred service checks without fear of replacing them?
- Kyle
Re: Nagios XI and configuration
Try not to use the import tool for configuration changes. That wasn't what it was made for and can at times have unpredictable results.
The best way to implement that change would be to add a contact group to a common template for your selected services. You can have multiple templates applied to a host or service.
The best way to implement that change would be to add a contact group to a common template for your selected services. You can have multiple templates applied to a host or service.
Re: Nagios XI and configuration
Understood, I just wanted to avoid updating 200 services via the GUI. I don't want the other hundreds of services affected by the template change, so I'd have to create a new service template and applied it one by one.
- Kyle
Re: Nagios XI and configuration
Just an FYI, you can also apply a service or service template to a hostgroup or servicegroup, and it will affect all members of that group. Not sure if that helps.
Re: Nagios XI and configuration
It would if I could target all the services for the hosts in the host group. 
- Kyle
Re: Nagios XI and configuration
Hmm,
Once I applied a custom service template to a host group, I got all kinds of attempts for service checks on hosts that didn't have those services configured, as well as a bunch of these once I backed it out and Nagios restarted.
Thu Jul 28 12:43:22 2011 Warning: Check result queue contained results for service ......
The custom template is just one that inherits generic-service with some changed attempts and has a contact group for alerts.
Either my configuration is messed up or the QL database can't be trusted. I say the latter based on what's happening to me in the Phantom Contacts thread.
Once I applied a custom service template to a host group, I got all kinds of attempts for service checks on hosts that didn't have those services configured, as well as a bunch of these once I backed it out and Nagios restarted.
Thu Jul 28 12:43:22 2011 Warning: Check result queue contained results for service ......
The custom template is just one that inherits generic-service with some changed attempts and has a contact group for alerts.
Either my configuration is messed up or the QL database can't be trusted. I say the latter based on what's happening to me in the Phantom Contacts thread.
- Kyle