Contact Group doesn´t work properly

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
abagutla
Posts: 4
Joined: Fri Feb 13, 2015 4:09 am

Contact Group doesn´t work properly

Post by abagutla »

Hi,

I have Nagios Core 4.0.7 and I have a problem with group mail alerts.

I don´t know what´s the issue exactly, but the alerts only are sent to the first member of the group... but no to the rest...

Could anyone help me? I´ll be glad. I need it...

Thanks in advance.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Contact Group doesn´t work properly

Post by abrist »

Alright. Can you start by posting the contactgroup and contact configs in question?
Also, post the host and service object config for the service object you are testing.
I have seen this behavior when the contactgroup is set on the host, but the service itself has a different contactgroup and the service contactgroup overrides the host contactgroup. But there are also many other things that can cause this behavior.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
abagutla
Posts: 4
Joined: Fri Feb 13, 2015 4:09 am

Re: Contact Group doesn´t work properly

Post by abagutla »

These are my definitions:

In contacts.cfg (the mail adresses are simbolic ones):

define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
email mail1@mail.es
}

define contact{
contact_name joselico
use generic-contact
alias Gengis Khan
email mail2@mail.es
}

define contactgroup{
contactgroup_name lj
alias Laura y Jose
members nagiosadmin, joselico
}

And I use the contact_group in the definition of the host:

define host{
use linux-server
host_name aeexprxxx.ae.xxx.es
alias aeexprxxx
address xx.xx.xx.xx
check_command check-host-alive
check_interval 5
retry_interval 1
max_check_attempts 5
contact_groups lj
hostgroups SASIC
notification_interval 1440
notification_period workhours
notification_options d,u,r
}

But only the first member of the group receives the alerts...

Thanks.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Contact Group doesn´t work properly

Post by abrist »

Were the alerts in question host or service alerts? I ask because if it was a service and you have just one group assigned on the service, that group will override the two on the host.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
abagutla
Posts: 4
Joined: Fri Feb 13, 2015 4:09 am

Re: Contact Group doesn´t work properly

Post by abagutla »

I have host alerts.

But what it really hapens, is that the email is only sent to the first member of the group. I changed the order and I tested it...
User avatar
millisa
Posts: 69
Joined: Thu Jan 16, 2014 11:13 pm
Location: Austin, TX
Contact:

Re: Contact Group doesn´t work properly

Post by millisa »

This is not a solution, but does the behavior change if you put a + sign in front of the contact group name in the host and service definition? ( this should give it an additive inheritance with anything defined above it in a template).

I think what'd help the most at this point is to pick a specific alert and find its corresponding entries in the nagios.log file. See if it shows multiple notifications or a single notification. If it shows multiple there, we look at the issue being in the notification command definition, possibly the command itself, or the mail server. There should be a specific line for notification for each member in a contact group. If it only shows the single notification in the nagios.log, we look at the host and service command associated with that specific notification and every template in the chain for that service and/or host. ( if you see a 'use' line we want to see the config for that template: ie 'linux-servers','generic contact'; if those templates also have templates, we want to see those, too.).

Post the relevant sanitized log excerpts with config and maybe we can spot it.
abagutla
Posts: 4
Joined: Fri Feb 13, 2015 4:09 am

Re: Contact Group doesn´t work properly

Post by abagutla »

I found the problem... :(

I didn´t realize I had a contact_group included in the service template definition, so, every notification was done only by this group...

Most time the worst problems have a very silly solution... and I'm a beginner... :(

Thank you very much.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Contact Group doesn´t work properly

Post by abrist »

abagutla wrote:I didn´t realize I had a contact_group included in the service template definition, so, every notification was done only by this group...
I figured it had to be something related to inheritance for the contact_group directive.
abagutla wrote:Most time the worst problems have a very silly solution... and I'm a beginner...

No worries, our support forum exists for a reason!
abagutla wrote:Thank you very much.
You are most welcome.

EDIT: Good catch Millisa!
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked