Treat contact different depending on contactgroup


#1

I’d like to treat one contact different depending on the current contactgroup.

E.g.:

  • Majestix is a group member of network-admins and server-admins
  • He should see the Network devices once he’s logged into the WUI but he shouldn’t get notifications for the network devices
  • On the other hand he’s also a server admin so I can’t disable notifications completely for Majestix

Snippet of my current config (names changed slightly :wink: )

define contactgroup {
contactgroup_name  network-admins
alias  Network Admins
members  Asterix, Obelix, Idefix, Majestix
}
define contactgroup {
contactgroup_name  server-admins
alias  Server Admins
members  Majestix
}
define contact {
contact_name  Asterix
alias  Asterix
service_notification_period  24x7
host_notification_period  24x7
service_notification_options  c,u,r,f
host_notification_options  d,u,r,f
service_notification_commands  notify-by-email
host_notification_commands  notify-host-by-email
email  asterix@example.com
}
define contact {
contact_name  Majestix
alias  Majestix
service_notification_period  24x7
host_notification_period  24x7
service_notification_options  c,u,r,f
host_notification_options  d,u,r,f
service_notification_commands  notify-by-email
host_notification_commands  notify-host-by-email
email  majestix@example.com
}
define host {
name  switches
notifications_enabled  1
event_handler_enabled  1
flap_detection_enabled  1
process_perf_data  1
retain_status_information  1
retain_nonstatus_information  1
max_check_attempts  3
notification_interval  120
notification_periode  workhours
notication_options  d,u,r
check_command  check-host-alive
contact_groups  network-admins
register  0
}

Maybe I’m just overseeing something but right now I don’t know how to handle this with nagios. BTW I’m currently using version 3.0.6


#2

Sorry, I just woke up and I am still little bit frozen.

But I think that at least one way to do that is Service Escalation and Host Escalation?


#3

Together with escalations, I think you can use the feature “!” to exclude. Maybe you have to redefine contact group memberships or exclude a member when notifying. The exact implementation depends on how you organized groups, but I think you can figure out the best way to start testing with this hint.