Topic locked Search this topic… 2 posts • Page 1 of 1 Nagi

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
huuanh2811
Posts: 1
Joined: Wed Jul 03, 2019 9:17 pm

Topic locked Search this topic… 2 posts • Page 1 of 1 Nagi

Post by huuanh2811 »

Hello everyone !

First of all thank you for taking the time to read this.
Here is the issue I have :

The email notifications does not seem to work for passive service checks.
It works well for active checks however.

I can see on the web GUI that the state of the passive service goes to warning, critical or OK state when there's a problem.
The service checking works fine, it is just the notifications that don't work.

Here is the definition of my services :

Generic service :

Code: Select all

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                       ; Active service checks should be parallelized (disabling this can lead to major performance problems)
    obsess_over_service             1                       ; We should obsess over this service (if necessary)
    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 across program restarts
    retain_nonstatus_information    1                       ; Retain non-status information across program restarts
    is_volatile                     0                       ; The service is not volatile
    check_period                    24x7                    ; The service can be checked at any time of the day
    max_check_attempts              3                       ; Re-check the service up to 3 times in order to determine its final (hard) state
    check_interval                  10                      ; Check the service every 10 minutes under normal conditions
    retry_interval                  2                       ; Re-check the service every two minutes until a hard state can be determined
    contact_groups                  admins                  ; Notifications get sent out to everyone in the 'admins' group
    notification_options            w,u,c,r                 ; Send notifications about warning, unknown, critical, and recovery events
    notification_interval           60                      ; Re-notify about service problems every hour
    notification_period             24x7                    ; Notifications can be sent out at any time
    register                        0                       ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}

Passive service (notification not working)

Code: Select all

define service {
    name                            passive_sservice
    use                             generic-service
    active_checks_enabled        0
    passive_checks_enabled        1
    flap_detection_enabled        0
    register                    0
    check_period                24x7
    max_check_attempts        1
    check_interval            1
    retry_interval            1
    check_freshness            0
    contact_groups            admins
    check_command            check_dummy!0
    notification_interval    60
    notification_period        24x7
    notification_options        w,u,c,r
}
local-service (notification working fine)

Code: Select all

define service {
    name                            local-service
    use                             generic-service
    max_check_attempts              4 
    check_interval                  1
    retry_interval                  1 
    register                        0
}

The following service will trigger a notification upon a state change :

Code: Select all

define service{
        use                             local-service         ; Name of service template to use
        host                            controller
        service_description             Check RabbitMQ consumers
        check_command                   check_rabbitmq_consumers
}

The following service will NOT trigger a notification upon a state change, even if I can see the state change when navigating to the GUI of nagios

Code: Select all

define service {
    use                    passive_sservice
    service_description    smsd
    host         raspnodeQuent
}


Both passive-service and local-service inherits generic-service, that defines
contact_groups = admins
notifications_enabled = 1

Therefore, I don't understand why notifications are not triggered with the passive_sservice.
Maybe is it because of the check_command dummy_check ?
Nagios version is Nagios Core 4.4.2

I hope I didn't miss anything, if there's any information you need, please don''t hesitate !
Thank you in advance for your help !
Biboubier
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Topic locked Search this topic… 2 posts • Page 1 of 1

Post by ssax »

Sounds like you need to set is_volatile to 1 on the service, see here:

https://assets.nagios.com/downloads/nag ... vices.html
Locked