Page 1 of 1

Mass import of Service Templates in Nagios XI?

Posted: Fri May 18, 2018 8:12 am
by riahc3
Ive found out about importing service templates into Nagios XI and I want to go ahead and use the functionality.

I thought that putting a file in "/usr/local/nagios/etc/import" and then running "/usr/local/nagiosxi/scripts/reconfigure_nagios.sh" it would automatically import it...but I dont see any indication in Nagios XI that does this.

I didnt get any error message when I ran the script.

The file is like so:

define service {
name Check Some Service Service Template
service_description Check Some Service Service Template
check_command check_nrpe!check_service!-n -a 'service=service' 'warn=none' "crit=state='stopped'"!!!!!!
register 0

}

define service {
name Check Some Service Process Template
service_description Check Some Service Process Template
check_command check_nrpe!check_process!-n -a 'process=service.exe' 'show-all'!!!!!!
register 0

}

I would have expected the service templates menu to be populated but nothing…

How can I correctly import all these?

Re: Mass import of Service Templates in Nagios XI?

Posted: Fri May 18, 2018 10:19 am
by scottwilkerson
I did exactly this, placed the following in /usr/local/nagios/etc/import/templates.cfg

Code: Select all

define service {
name Check Some Service Service Template
service_description Check Some Service Service Template
check_command check_nrpe!check_service!-n -a 'service=service' 'warn=none' "crit=state='stopped'"!!!!!!
register 0

}

define service {
name Check Some Service Process Template
service_description Check Some Service Process Template
check_command check_nrpe!check_process!-n -a 'process=service.exe' 'show-all'!!!!!!
register 0

}
ran Apply Configuration through the UI
There were no errors

If I go to Configure -> CCM -> Service Templates
Upper right Search for "Check Some Service Service Template" OR "Check Some Service Process Template"

I see the newly imported template

Re: Mass import of Service Templates in Nagios XI?

Posted: Sun May 20, 2018 3:18 pm
by riahc3
Is the name of the file important?

Re: Mass import of Service Templates in Nagios XI?

Posted: Mon May 21, 2018 10:04 am
by tmcdonald
Not really, as long as it is in the /usr/local/nagios/etc/import/ directory (and is a valid file) it should import no matter what it is named.