I have a bunch of non-server gear for which I would like to track downtimes, and therefore I have integrated them in my Nagios collection (so that I can generate availability reports). However, I don't want to be alerted by email if they are unreachable. Therefore, my entries for these machines look as follows:

define host{
host_name     Moni_MacBook_Pro
use        generic-host
notifications_enabled   0

However, I still get notifications! I suspect that this is related to the fact that the template "genetic-host" contains the following line:

 check_command      check-host-alive

and, in turn, the "generic-service" template looks as follows:

define service{
    name                            generic-service     ; The 'name' of this service template
    active_checks_enabled           1               ; Active service checks are enabled
    passive_checks_enabled          1               ; Passive service checks are enabled/accepted
    parallelize_check               1               ; 
    obsess_over_service             1               ; We should obsess 
    check_freshness                 0               ; Default is to NOT check service 'freshness'
    notifications_enabled           1               ; Service notifications are enabled
    event_handler_enabled           1               ; Service event handler is enabled
    flap_detection_enabled          1               ; Flap detection is enabled
    process_perf_data               1               ; Process performance data
    retain_status_information       1               ; Retain status information
    retain_nonstatus_information    1               ; Retain non-status information 
    is_volatile                     0               ; The service is not volatile
    check_period                    24x7            ; 
    max_check_attempts              3           ; 
    normal_check_interval           10          ; 
    retry_check_interval            2           ; Re-check the service every two minutes
    contact_groups                  admins          ; Notifications get sent out to everyone in
    notification_options            u,c         ;   
    notification_interval           1440            ; Re-notify about service problems every hour
    notification_period             24x7            ; Notifications can be sent out at any time
    register                        0               ; DONT REGISTER THIS DEFINITION 

My diagnosis is that the line "notification_options u,c" in the service template somehow overrides my request NOT to send notifications in the host definition. How is it possible to fix that, if at all?


I think that I have sorted it out. I have the following service:

#Check that ping-only hosts are up
define service {
  hostgroup_name                  all
  service_description             PING
  check_command                   check_ping!100.0,20%!500.0,60%
  use                             generic-service
  notification_options            d,u,r
  notification_interval           0

That was probably where all the unwanted mails were coming from. It is probably not needed, since the "check_command" in the host definition is also just a ping. I have changed the "notification_options" here to "n" (none).

  • It's important to keep in mind that host checks and service checks are almost completely unrelated. They each have their own schedules, contacts, options, commands, and other settings. – Keith Jan 12 '15 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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