Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
}
share|improve this question

marked as duplicate by Sandra, RobM, Ward, MDMarra, Scott Pack Jul 6 '13 at 12:59

This question was marked as an exact duplicate of an existing question.

1  
maybe related? serverfault.com/questions/433887/…. please reread and edit you question. The first sentance is very hard to follow. – Zoredache Jul 5 '13 at 15:39
    
@Zoredache Sorry my laziness got the best of me and didn't even search for a duplicate. – user Jul 5 '13 at 16:01
    
-1. I don't understand what you're asking. – quanta Jul 5 '13 at 16:14

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

share|improve this answer
    
This will apply it to all hosts and services and the question is a little more fine grained. Please read the OP again. – Sandra Jul 5 '13 at 15:29
    
Made a slight edit you should add contacts +sandradebug on your host definition. That won't apply to all hosts and services. As for the second option again it won't apply it everywhere. – user Jul 5 '13 at 15:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.