-1

Who that gets notifications are defined in the service and host definitions, but what I would like is that it is only defined on a pr host level.

So whoever that is in the contact_groups for the host also get all service notifications.

For this particular host definition example would I like the groups admins and sandradebug to receive all host and service notifications.

Is that possible?

Typical host definition

define host {
  use                     linux-host
  host_name               example
  alias                   example
  address                 10.10.10.10
  hostgroups              default-linux-services
  contact_groups          +sandradebug
}

Service check that all Linux hosts get

define service {
  use                     generic-service
  name                    check_disks
  service_description     Check Disk
  check_command           check_nrpe!check_disk
  contact_groups          linux-admins
  hostgroup_name          default-linux-services
}

Don't know what this does, or why it is required

define hostgroup {
  hostgroup_name  default-linux-services
  alias           All Linux hosts shall have these service checks
  members         
}

Service template

define service{
  name                            generic-service
  active_checks_enabled           1
  passive_checks_enabled          1
  parallelize_check               1
  obsess_over_service             1
  check_freshness                 0
  notifications_enabled           1
  event_handler_enabled           1
  flap_detection_enabled          1
  failure_prediction_enabled      1
  process_perf_data               1
  retain_status_information       1
  retain_nonstatus_information    1
  is_volatile                     0
  check_period                    24x7
  max_check_attempts              3
  normal_check_interval           10
  retry_check_interval            2
  contact_groups                  admins
  notification_options            w,u,c,r
  notification_interval           60
  notification_period             24x7
  register                        0
}
Sandra
  • 10,711
  • 41
  • 120
  • 173

1 Answers1

-1

I'd guess adding a contact and then adding contacts +sandradebug on your host definition should do it. Here's the object definitions

You can also set a contactgroup linux-admins and a contact sandradebug

Then create a contactgroup for linux-admins and sandradebug For instance

define contactgroup{
contactgroup_name   everyone
alias   alias
members sandradebug
contactgroup_members    linux-admins
    }

An easier solution might be to just add comma separated contact groups or contacts.

EDIT 2:

Example for a couple of hosts

define host { use linux-host host_name example alias example address 10.10.10.10 hostgroups default-linux-services contacts +sandradebug }

Or you could add it on the service

define service {
  use                     generic-service
  name                    check_disks
  service_description     Check Disk
  check_command           check_nrpe!check_disk
  contact_groups          linux-admins
  hostgroup_name          default-linux-services
  contacts                +sandradebug
}

If you have many hosts that you want to do this create a contactgroup and include it into the host and service groups respectively

user
  • 1,418