Email and/or pager notifications for different groups

Currently, my Nagios configuration will send email and pager alerts to members of a contact_group specified in a host or service definition. See my contact definition below.

I’d like to modify this configuration so that our Unix Administrators receive email and pager notifications for the mission critical services, but only receive email notifications for other, less critical services. A second group may receive pager notifications for the ‘less critical’ services in the future. I don’t want to limit the notifications by a timeperiod.

Is it possible to configure the kind of Notifications within a service or host definitions?

It seems like my best option is to take the contactgroup ‘admin’, and break it into two new contactgroups called ‘admin-email-only’, and ‘admin-pager-only’ and then send the notifications to one or both of those contact groups.

Here is my example configuration.

[code]define contact{
contact_name joeadmin
alias Joe Unix Admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email,notify-by-epager
host_notification_commands host-notify-by-email,host-notify-by-epager
email [email protected]
pager [email protected]
}

define contactgroup{
contactgroup_name admin
alias Unix Administrators
members joeadmin, janeadmin
}

define service{
use generic-service
host_name web1, web2
service_description Mission Critical Web Servers
contact_groups admin
check_command check_host
}

define service{
use generic-service
host_name db1, db2
service_description Less Critical Database Servers
contact_groups admin
check_command check_host
}
[/code]

-= Stefan

Hi - I believe that is the best way to do it - we have something similar based on time/day for our 9-5 staff and our 24x7 staff…

didn’t you already make the same question in a different thread?

No, I haven’t asked this same question recently. That must have been someone else. I would love to see that other thread, however.

-= Stefan

oh, sorry :slight_smile:

I’ve seen something very similar quite recently (last two weeks), somebody wanted to have different notifications for the same service…

but the solution is the one you indicated, i don’t think there’s much more which can be done. :slight_smile:

Ah, oh well.

Thanks for the suggestions!

-= Stefan