How to breakup notifications types to separate user groups

Each host has snmp load,mem,storage as services. Somehow I want just to have the snmp-storage service warn/recover notify an email only group while the rest of service states for snmp-storage use the main user group. What is the best way to tackle this scenario ?

you can define the mailing address in the [ vars. ] associated to that service

But how do I define a mailing address for warning/recovery and separate address for critical/recovery ?

You may want to define 2 users, one that has notification type warning only ( recover is always sent to a notified user), and the other is the critical .

When an event is triggered for the service, both users are evaluated, and only the one matching the notification specification will get the alert and recovery.

To make it scale able, you may want the listing to be user_groups and that way you can add users to the groups and not have to change the service every time a new member is added to a team.

Hi,

there’s two possibilities:

  • Create two notification apply rules where you filter the states away
  • Or have one notification apply rule with different users which filter the states then

If you prefer to not specifically filter on the user level, I’d suggest to use the first method.

Grouping the users into groups can be e.g. done with group assign rules based on a custom variable on the user objects.

object UserGroup "ug-soft" {
  assign where user.vars.notification_level = "soft"
}
object UserGroup "ug-all" {
  assign where user.vars.notification_level = "all"
}

object User "u1" {
  email = "u1@host.com"
  vars.notification_level = "soft"
}

object User "u2" {
  email = "u2@host.com"
  vars.notification_level = "all"
}

Then use the groups for specific notification apply rules.

apply Notification "warn-recover" to Service {
  states = [ Warning, OK]
  types = [ Problem, Recovery ]

  user_groups = [ "ug-soft" ]

  assign where ...
}

apply Notification "all" to Service {
  states = [ Warning, Critical, Unknown, OK]
  types = [ Problem, Recovery ]

  user_groups = [ "ug-all" ]

  assign where ...
}

Cheers,
Michael

Thank you so much. This is all I needed get me headed in the right direction. Now off to the lab I go. Thanks.