Nagios notification not working for passive service checks

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
biboubier
Posts: 1
Joined: Sat Feb 23, 2019 7:29 am

Nagios notification not working for passive service checks

Post by biboubier »

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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Nagios notification not working for passive service chec

Post by npolovenko »

Hello, @biboubier. Do passive services go into a HARD Critical state after a critical passive result was recieved? Please open the service check in Core GUI and take a screenshot of the Service State Information table.
Also, please upload the /usr/local/nagios/var/objects.cache file in this thread or send it to me in a PM.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked