Nagios XI and configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
TSCAdmin
Posts: 155
Joined: Wed Apr 14, 2010 3:00 pm
Location: India

Nagios XI and configuration

Post by TSCAdmin »

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.
User avatar
admin
Site Admin
Posts: 256
Joined: Mon Oct 12, 2009 8:21 am

Re: Nagios XI and configuration

Post by admin »

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Ethan Galstad
President
TSCAdmin
Posts: 155
Joined: Wed Apr 14, 2010 3:00 pm
Location: India

Re: Nagios XI and configuration

Post by TSCAdmin »

Did you mean:

# cd /usr/local/nagios/etc/hosts
# perl -i -pe 'one liner here'
# service nagios restart

?
hhlodge
Posts: 206
Joined: Tue Mar 08, 2011 2:13 pm

Re: Nagios XI and configuration

Post by hhlodge »

So could I use the import method to add a contact group to a couple hundred service checks without fear of replacing them?
- Kyle
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Nagios XI and configuration

Post by mguthrie »

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.
hhlodge
Posts: 206
Joined: Tue Mar 08, 2011 2:13 pm

Re: Nagios XI and configuration

Post by hhlodge »

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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Nagios XI and configuration

Post by mguthrie »

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.
hhlodge
Posts: 206
Joined: Tue Mar 08, 2011 2:13 pm

Re: Nagios XI and configuration

Post by hhlodge »

It would if I could target all the services for the hosts in the host group. :-)
- Kyle
hhlodge
Posts: 206
Joined: Tue Mar 08, 2011 2:13 pm

Re: Nagios XI and configuration

Post by hhlodge »

Actually, I just noticed that I in fact can!
- Kyle
hhlodge
Posts: 206
Joined: Tue Mar 08, 2011 2:13 pm

Re: Nagios XI and configuration

Post by hhlodge »

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.
- Kyle
Locked