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?
Mass import of Service Templates in Nagios XI?
-
- 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?
I did exactly this, placed the following in /usr/local/nagios/etc/import/templates.cfg
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
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
}
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?
Is the name of the file important?
Re: Mass import of Service Templates in Nagios XI?
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