Setting notification_commands Via Template

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Deantwo
Posts: 52
Joined: Thu Mar 03, 2016 8:39 am

Re: Setting notification_commands Via Template

Post by Deantwo »

Ok, I seemingly just fixed it by removing the other templates.
I don't see how this makes sense as none of them change the host_notification_commands and service_notification_commands directives are not set anymore on any of them.
At least they don't anymore, my generic template did once have the directives set, but I changed that when I recreated the xi_contact_generic template.

They are only:

Code: Select all

define contact {
    name                                A-contact
    contactgroups                       +A Contacts
    use                                 generic
    register                            0
    }

define contact {
    name                                B-contact
    contactgroups                       +B Contacts
    use                                 generic
    register                            0
    }

define contact {
    name                                C-contact
    contactgroups                       +C Contacts
    use                                 generic
    register                            0
    }

define contact {
    name                                D-contact
    contactgroups                       +D Contacts
    use                                 generic
    register                            0
    }

define contact {
    name                                generic
    contactgroups                       +contactgroup_all
    register                            0
    }
I am gonna just remove these contact templates and simply add the contactgroups directly to each contact.

Gonna try and apply with these changes and see if it fixes the problem all over...
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Setting notification_commands Via Template

Post by ssax »

Ok, let us know the results.

One thing that I see is that you're using the + on those contacts, are you also using that on the templates for anything? I didn't see the templates posted so I'm unable to review what they were.


Thank you
Deantwo
Posts: 52
Joined: Thu Mar 03, 2016 8:39 am

Re: Setting notification_commands Via Template

Post by Deantwo »

ssax wrote:Ok, let us know the results.
Yeah, it works for all users now.
Not sure why this was an issue, since none of the other templates changed those directives.
ssax wrote:One thing that I see is that you're using the + on those contacts, are you also using that on the templates for anything? I didn't see the templates posted so I'm unable to review what they were.
The plus sign ("+") is used to allow the template's specified directive to be append to the existing list, rather than the standard where it is ignored if the directive is already defined on the inheritor.
I have however been a little confused as to which end of the relationship had to have the plus sign, so I may have used it a little excessively. It seems to be just the inheritor that should have the plus sign, I'll correct that in my configuration.

See: https://assets.nagios.com/downloads/nag ... tance.html

I was not using a plus sign on the host_notification_commands or service_notification_commands directives, so I doubt it was related to the issue I had.

In the templates I posted in my last post, the only plus sign I didn't need was the one in the generic template.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Setting notification_commands Via Template

Post by ssax »

Glad it's working, I was just referencing the + sign because I've seen customers sometimes use it on everything and it can cause unexpected behavior, just doing my due diligence. Are we okay to mark this as resolved and lock the topic?
Deantwo
Posts: 52
Joined: Thu Mar 03, 2016 8:39 am

Re: Setting notification_commands Via Template

Post by Deantwo »

ssax wrote:Glad it's working, I was just referencing the + sign because I've seen customers sometimes use it on everything and it can cause unexpected behavior, just doing my due diligence.
Yeah, you mentioning it made me look it up again.
So thanks. ^^
ssax wrote:Are we okay to mark this as resolved and lock the topic?
Yes you can lock the thread.
Locked