Mass import of Service Templates in Nagios XI?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
riahc3
Posts: 59
Joined: Thu Apr 05, 2018 9:36 am

Mass import of Service Templates in Nagios XI?

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Mass import of Service Templates in Nagios XI?

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
riahc3
Posts: 59
Joined: Thu Apr 05, 2018 9:36 am

Re: Mass import of Service Templates in Nagios XI?

Post by riahc3 »

Is the name of the file important?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Mass import of Service Templates in Nagios XI?

Post 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.
Former Nagios employee
Locked