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.
Contact Group doesn´t work properly
Re: Contact Group doesn´t work properly
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.
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.
"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.
Re: Contact Group doesn´t work properly
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.
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.
Re: Contact Group doesn´t work properly
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.
"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.
Re: Contact Group doesn´t work properly
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...
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...
Re: Contact Group doesn´t work properly
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.
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.
Re: Contact Group doesn´t work properly
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.
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.
Re: Contact Group doesn´t work properly
I figured it had to be something related to inheritance for the contact_group directive.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...
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!
You are most welcome.abagutla wrote:Thank you very much.
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.
"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.