Nagios not sending out notifications HARD

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
FierUser
Posts: 5
Joined: Mon Jun 01, 2015 3:14 pm

Nagios not sending out notifications HARD

Post by FierUser »

I've been trying to setup inheritance for large scale deployment and along the way it seems I screwed up my configuration. It doesn't seem to work anymore for explicit configuration files. There's nothing wrong with the sendmail and the commands.cfg since I haven't change anything there. I suspect I must've broken my template definitions somewhere.

client.cfg

Code: Select all

define host {
use                                     linux-server
host_name                               CLIENT
alias                                   Test server to monitor stuff
address                                 #.#.#.#
flap_detection_enabled                  0
contacts                                nagiosadmin
}
templates.cfg

Code: Select all

define host{
        name                            generic-host    ; The name of this host template
        notifications_enabled           1               ; Host notifications are enabled
        event_handler_enabled           1               ; Host 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
        notification_period             24x7            ; Send host notifications at any time
        contact_groups                  admins          ; Notifications get sent to the admins by default
        register                        0               ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
        }

define host{
        name                            linux-server    ; The name of this host template
        use                             generic-host    ; This template inherits other values from the generic-host template
        check_period                    24x7            ; By default, Linux hosts are checked round the clock
        check_interval                  5               ; Actively check the host every 5 minutes
        retry_interval                  1               ; Schedule host check retries at 1 minute intervals
        max_check_attempts              10              ; Check each Linux host 10 times (max)
        check_command                   check-host-alive ; Default command to check Linux hosts
        notification_interval           5               ; Resend notifications every 1 hours
        retry_interval                  2               ; Retry host check
        notification_options            d,u,r           ; Notify when down, unreachable, and recovery
        register                        0               ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
        }
contacts.cfg

Code: Select all

define contact{
        contact_name                            nagiosadmin ; Short name of user
        alias                                   Nagios Admin            ; Full name of user
        email                                   x@x.com      ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
        service_notifications_enabled           1
        service_notification_period             24x7
        service_notification_options            w,u,c,r,f,s
        service_notification_commands           notify-service-by-email
        host_notifications_enabled              1
        host_notification_period                24x7
        host_notification_options               d,u,r,f,s
        host_notification_commands              notify-host-by-email
        }

define contactgroup{
        contactgroup_name       admins
        alias                   Nagios Administrators
        members                 nagiosadmin

        }

User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios not sending out notifications HARD

Post by Box293 »

I would look in the /usr/local/nagios/var/objects.cache file to see what the "final object" settings are.

Does the host command "Send a custom host notification" work, does that notification get received?

Can you show us a screenshot of "View Alert History For This Host" for a period when a host went into a HARD state.
Can you show us a screenshot of "View Availability Report For This Host" for a period when a host went into a HARD state.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
FierUser
Posts: 5
Joined: Mon Jun 01, 2015 3:14 pm

Re: Nagios not sending out notifications HARD

Post by FierUser »

Thank you Box293, I think I figured it out. I had a stray
host_notification_options
service_nofication_options

declared else where with the n options which overrode everything else and was why it was stopping everything. D'oh. Thank you for pointing out objects.cache though Will help in the future!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios not sending out notifications HARD

Post by Box293 »

Excellent, glad we got you working ... objects.cache really helps understand what the final objects is.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked