sending alert to multiple contact group
sending alert to multiple contact group
Hi,
I am trying to make notifications to be sent to various contact groups. I need an alert from on specific server in one host groups to be sent to multiple contact groups. When, I add contact_groups with a group name in hosts.cfg file alert is being sent only to contact group specified in the template.cfg template.
What is correct procedure and the syntax for setting up things like those? I am sure I am not the only who is trying to have this setup.
Thanks in advance!
I am trying to make notifications to be sent to various contact groups. I need an alert from on specific server in one host groups to be sent to multiple contact groups. When, I add contact_groups with a group name in hosts.cfg file alert is being sent only to contact group specified in the template.cfg template.
What is correct procedure and the syntax for setting up things like those? I am sure I am not the only who is trying to have this setup.
Thanks in advance!
Re: sending alert to multiple contact group
Please post your relevant configurations for the host and template.
The definition is like so:
The definition is like so:
Code: Select all
contact_groups admins,anothergroup
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: sending alert to multiple contact group
Works as expected:
Code: Select all
define contactgroup {
contactgroup_name contactgroup_a
alias A
members andy
}
define contactgroup {
contactgroup_name contactgroup_b
alias B
members bill
}
define host {
host_name host_a
use template_a
address 192.168.145.1
contact_groups contactgroup_a
}
define host {
host_name host_b
use template_b
address 192.168.145.1
contact_groups contactgroup_b
}
define host {
host_name host_c
use template_a
address 192.168.145.1
contact_groups contactgroup_a, contactgroup_b
}
Re: sending alert to multiple contact group
In my case I have one contact group defined in the template
this is host definition
host template definition
As you can see I want to add another contacts group for mobile.demo host and keep sys-admins in the host template
this is host definition
Code: Select all
define host{
host_name mobile.demo
use linux-server
hostgroups demo
alias mobile.demo
address 172.x.x.x
check_command check-host-alive
check_interval 3
retry_interval 1
max_check_attempts 2
check_period 24x7
contact_groups mobile
process_perf_data 0
retain_nonstatus_information 0
notification_interval 10
notification_period 24x7
notification_options d,u,r
}
Code: Select all
define host{
name mobile_demo
use generic-host
hostgroups
check_period 24x7
check_interval 5
max_check_attempts 10
check_command check-host-alive,
notification_period 24x7
notification_interval 10
notification_options d,u,r
contact_groups sys-admins
register 0
}
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: sending alert to multiple contact group
In your host definition you want:
Code: Select all
contact_groups +mobile
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: sending alert to multiple contact group
I made the change (both suggestions) and now I am not getting any alerts. Just changed URL within in command.cfg to trigger and nothing happened...
This is how everything looks like now:
hosts template:
contact template:
Thanks for help again!
This is how everything looks like now:
Code: Select all
define host{
host_name mobile.demo
use linux-server
hostgroups demo
alias mobile.demo.couchbase.com
address 172.23.105.16
check_command check-host-alive
check_interval 3
retry_interval 1
max_check_attempts 2
check_period 24x7
contact_groups +mobile
process_perf_data 0
retain_nonstatus_information 0
notification_interval 10
notification_period 24x7
notification_options d,u,r,f
}
Code: Select all
define host{
name mobile_demo
use generic-host
hostgroups
check_period 24x7
check_interval 5
max_check_attempts 10
check_command check-host-alive,
notification_period 24x7
notification_interval 10
notification_options d,u,r,f,s
contact_groups sys-admins
register 0
}
Code: Select all
define contact{
contact_name pl33g0r
use generic-contact
alias pl33g0r
email pl33g0r@gmail.com
}
define contactgroup{
contactgroup_name mobile
alias mobile-devs
members pl33g0r
}
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: sending alert to multiple contact group
A great way to test if a notification will work is to go to the object itself in the GUI and under Host Commands click "Send custom host notification".
Also, have a look in /usr/local/nagios/var/objects.cache and find the definition for the host mobile.demo, post it here.
Also, have a look in /usr/local/nagios/var/objects.cache and find the definition for the host mobile.demo, post it here.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: sending alert to multiple contact group
Sorry for such a late reply on this issue:
Code: Select all
define host {
host_name mobile.demo
alias mobile.demo.couchbase.com
address 172.23.105.16
check_period 24x7
check_command check-host-alive
contact_groups mobile-devs,sys-admins
notification_period 24x7
initial_state o
importance 0
check_interval 3.000000
retry_interval 1.000000
max_check_attempts 2
active_checks_enabled 1
passive_checks_enabled 1
obsess 1
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 1
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options r,d,u,f
notifications_enabled 1
notification_interval 10.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 0
retain_status_information 1
retain_nonstatus_information 0
}
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: sending alert to multiple contact group
Did this work?
It might be easier if you could PM me a copy of /usr/local/nagios/var/objects.cache and I'll go over everthing to make sure it is OK.
The host object looks good, we can see it is correctly getting both groups: "mobile-devs,sys-admins".Box293 wrote:A great way to test if a notification will work is to go to the object itself in the GUI and under Host Commands click "Send custom host notification".
It might be easier if you could PM me a copy of /usr/local/nagios/var/objects.cache and I'll go over everthing to make sure it is OK.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.