Phantom contacts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
hhlodge
Posts: 206
Joined: Tue Mar 08, 2011 2:13 pm

Re: Phantom contacts

Post by hhlodge »

I can't gleen that from this doc and I am using notify-service-by-email for notifications so I think it would be moot. If I am the cause, then so be it, but I think some weird stuff is going on "in there". I am just going to manually add the desired contact groups to each service so I know what's what succinctly.
- Kyle
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Phantom contacts

Post by mguthrie »

XI is setup to use the "xi_host/service_notification_handler" commands for notifications. The "notifiy-host/service-by-email" commands still work, but they should only be added in addition to the "xi_.." commands. It is also recommended to add the custom macros outlined in the document as well for each contact, and the user-specific timeperiods.

With that said, if you get a system figured out that's working and you'd rather not mess with it, by all means stick with it. If there's some unpredictable behavior going on, I generally recommend that people recreate the contacts through the Admin->Manage Users page so that the correct values auto-populate.
hhlodge
Posts: 206
Joined: Tue Mar 08, 2011 2:13 pm

Re: Phantom contacts

Post by hhlodge »

I'll have to look into how I would use those combined. The reason I don't use the xi service handler is because not all macros are available that I want in notifications, namely:

Notified: $NOTIFICATIONRECIPIENTS$
Additional Info: $SERVICEOUTPUT$\n$LONGSERVICEOUTPUT$
Acknowledged by: $SERVICEACKAUTHOR$
Comment: $SERVICEACKCOMMENT$
- Kyle
hhlodge
Posts: 206
Joined: Tue Mar 08, 2011 2:13 pm

Re: Phantom contacts

Post by hhlodge »

So now I am seeing not enough recipients for what I think I have configured. So I must ask an embarrassingly basic question - if I have a contact_groups directive in a template and then add another contact group in XI in the alerts tab, is the XI value added to the list or does it replace the one in the template? It seems to be the latter but that goes against what I've always believed to be the Nagios way for configured objects.
- Kyle
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Phantom contacts

Post by mguthrie »

If you change a setting on a specific host or service, by default it will override a template setting. What you're needing to do is use additive inheritance, and currently this can only be done through the CCM.


Taken from:
http://nagios.sourceforge.net/docs/3_0/ ... tance.html
Additive Inheritance of String Values

Nagios gives preference to local variables instead of values inherited from templates. In most cases local variable values override those that are defined in templates. In some cases it makes sense to allow Nagios to use the values of inherited and local variables together.

This "additive inheritance" can be accomplished by prepending the local variable value with a plus sign (+). This features is only available for standard (non-custom) variables that contain string values. Take the following example:

Code: Select all

	define host{

		hostgroups		all-servers

		name			generichosttemplate

		register			0

		}



	define host{

		host_name			linuxserver1

		hostgroups		+linux-servers,web-servers

		use			generichosttemplate

		}
In this case, the host linuxserver1 will append the value of its local hostgroups variable to that from generichosttemplate. The resulting effective definition of linuxserver1 is the following:

Code: Select all

	define host{

		host_name			linuxserver1

		hostgroups		all-servers,linux-servers,web-servers

		}
hhlodge
Posts: 206
Joined: Tue Mar 08, 2011 2:13 pm

Re: Phantom contacts

Post by hhlodge »

Shoot! Bitten by my own ignorance. :)
- Kyle
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Phantom contacts

Post by mguthrie »

No worries, let us know if you have additional questions : )
Locked