Page 1 of 1
contact templates not applying correctly
Posted: Wed Jun 03, 2020 2:49 pm
by dariopalermo
We set up contact templates with alert settings (host and service notifications timeperiods) in them.
We then tried to apply them to some contact groups (there a button for it in the contact template page, so...):
Contact Template 1 > Contact Group A > Contact X
Contact Template 2 > Contact Group B > Contact Y
Notifications will not be sent with this configuration
If the do this:
User X > Contact Template 1
User Y > Contact Template 2
all is working. But we lose the "manage-by-group" logic.
Why?
Thanks in advance.
Bye, Dario
Re: contact templates not applying correctly
Posted: Thu Jun 04, 2020 3:45 pm
by ssax
I think this may be a misunderstanding. You cannot apply a contact template to a contact group. You can apply a contactgroup to a contact with a contact template though (which is likely what you're doing).
Once you define anything locally on the contact it overrides any inherited settings per the inheritance logic:
Code: Select all
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/objectinheritance.html
Could that be the case?
What do you mean by manage by group logic?
Re: contact templates not applying correctly
Posted: Thu Jun 04, 2020 6:36 pm
by dariopalermo
ssax wrote:I think this may be a misunderstanding. You cannot apply a contact template to a contact group. You can apply a contactgroup to a contact with a contact template though (which is likely what you're doing).
Once you define anything locally on the contact it overrides any inherited settings per the inheritance logic:
Code: Select all
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/objectinheritance.html
Could that be the case?
What do you mean by manage by group logic?
Ok, we're talking about Nagios XI
Go to CCM > Contact Templates (under Templates)
create a new shining template and define Alert Settings (in my case, host and service notification were particularly relevant here)
going back to the Common Settings tab, you'll fine 2 buttons:
Manage Contact Groups
Manage Contact Templates
The second one is clearly for template nesting purposes. But the first one seems to be there to apply this contact template to one or more Contact Groups. If you click it, you can select and add them!
And it makes sense: you create a contact group with contacts that need to share the same alert settings and link the contact template to it. Next time you have to add a new contact that needs the same settings, you simply add it to the group.
Yes, you could also apply the template to the contacts in the first place and do the same later for the new contact but it will require at least a step more (you have to check an existing contact for the applied template).
Manage by group logic means that: you work as much as possible (possibly always) on the group. Single objects should only have their specific settings (name, description, email, etc.) and group membership.
Nagios is lacking this kind of approach (servicegroups cannot be linked to hostgroups, to show another example) but in this case that button is there... why?
bye, Dario
Re: contact templates not applying correctly
Posted: Fri Jun 05, 2020 9:23 am
by ssax
I apologize but that's not what the Manage Contact Groups button on the Contact Template does.
Contact templates only apply to Contacts (not contact groups)
Host templates only apply to Hosts (not host groups)
Service templates only apply to Services (not service groups)
The contact template is just for defining what you would usually define on a contact in a template that you can apply to other contacts so you don't have to set them manually on the contact, it does not apply that contact template to the contact group, it only applies to the contacts assigned the template. So when you select the contact group under Manage Contact Groups on that contact template page you're really saying that you want any contact assigned to this template to be a part of that contact group (it doesn't assign that template to a contact group, it assigns the contact that the template is applied to that contact group).
Nagios is lacking this kind of approach (servicegroups cannot be linked to hostgroups, to show another example) but in this case that button is there... why?
The button works the same way as the other buttons in the templates, it only assigns things to a contact that has that template applied.
Let us know if you have any questions.
Thank you
Re: contact templates not applying correctly
Posted: Mon Jun 08, 2020 3:38 pm
by dariopalermo
Oooooohhh ok, I got it backwards...
My issue with the Nagios overall logic still applies anyway: grouping is not as powerful as it should be (and as it is pretty much everywhere else).
Thanks for the explanation.
Bye, Dario
Re: contact templates not applying correctly
Posted: Tue Jun 09, 2020 9:49 am
by lmiltchev
Oooooohhh ok, I got it backwards...
...
Thanks for the explanation.
I am glad that we clarified the issue. I will be locking this topic now. If you have any further questions, please start a new thread. Thank you!