Hi, I'm trying to configure templates for my nagios xi system.
I tried 'Service Template' & 'Contact Template'
So for the service template I edited 'generic-service' template and added all the check settings and alerts settings for what I need.
Then I save and apply, and goes to a service and then from 'Manage Templates' I select the template I made and save & apply.
I thought it should update my service with the service template settings but it just doesn't change anything.. it doesn't import any settings from the template to the service.
Same for the 'Contact Templates' I edited 'generic-contact' template and edited with my own settings, Then I create a new contact and selects the 'generic-contact' template, Also no settings are applied to the new contact.
Am I missing something? I'm doing it wrong?
I'm just trying to create a template for check settings & alert settings for services / hosts / contacts so I don't need to manually change it for every new object.
Thanks
Templates not working..
Re: Templates not working..
Do you have the same variables (as the ones you have in the template) defined locally, on the service level? Local variables will take precedent over inherited variables from a template. Read more on object inheritance here:
https://assets.nagios.com/downloads/nag ... tance.html
Also, to be sure what are your actual settings of an object, you will need to view the service config in the /usr/local/nagios/var/objects.cache file.
If you have any further (specific) questions, please post the configs for the service, and the template this service is currently using. Explain what variables in your opinion should be inherited, but they are not. Thanks!
https://assets.nagios.com/downloads/nag ... tance.html
Also, to be sure what are your actual settings of an object, you will need to view the service config in the /usr/local/nagios/var/objects.cache file.
If you have any further (specific) questions, please post the configs for the service, and the template this service is currently using. Explain what variables in your opinion should be inherited, but they are not. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Templates not working..
Hi, Thank you for the reply.lmiltchev wrote:Do you have the same variables (as the ones you have in the template) defined locally, on the service level? Local variables will take precedent over inherited variables from a template. Read more on object inheritance here:
https://assets.nagios.com/downloads/nag ... tance.html
Also, to be sure what are your actual settings of an object, you will need to view the service config in the /usr/local/nagios/var/objects.cache file.
If you have any further (specific) questions, please post the configs for the service, and the template this service is currently using. Explain what variables in your opinion should be inherited, but they are not. Thanks!
I just finished reading the article you provided and I followed the instructions, I still can't get it working.. I will try to explain what I'm doing:
So I'm using a fresh install of Nagios XI and I'm only monitoring "Nagios" host.
I edited the service template "local-service" like this:
Code: Select all
define service {
name local-service
use generic-service
max_check_attempts 3
check_interval 3
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options w,c,r,f,
notifications_enabled 1
contact_groups Tech
register 0
}
Code: Select all
define service {
host_name Nagios
service_description Nagios-Test-Service
use local-service
check_command check-host-alive!!!!!!!!
register 1
}I suppose I should see the template settings in my new created service, no?
Am I missing something again? :X
Re: Templates not working..
"local-service" template is located in "/usr/local/nagios/etc/servicetemplates.cfg"
and "Nagios-Test-Service" is located in "/usr/local/nagios/etc/services/Nagios.cfg"
and "Nagios-Test-Service" is located in "/usr/local/nagios/etc/services/Nagios.cfg"
Re: Templates not working..
No, if you don't have max_check_attempts, check_interval, retry_interval, check_period, etc. defined locally (in the service config), you are not going to be able to see them in the actual config. You would see this line:I suppose I should see the template settings in my new created service, no?
Code: Select all
use local-serviceYou haven't modified the configs from the command line, have you? You must do all of the changes under the Core Config Manager (CCM), then apply configuration. If you modified configs manually (from the CLI), as soon as you apply configuration, all of the changes that you made would be overwritten with whatever is in the database (CCM). FYI.
Be sure to check out our Knowledgebase for helpful articles and solutions!