I check my server on WAN with ping and https by Nagios Core 3.5.1. Here is the host alert history.

June 23, 2015 18:00     

Service Ok[06-23-2015 18:13:47] SERVICE ALERT: webserver;PING;OK;HARD;3;PING OK - Packet loss = 0%, RTA = 33.72 ms
Service Ok[06-23-2015 18:13:40] SERVICE ALERT: webserver;HTTPS;OK;HARD;3;HTTP OK: HTTP/1.1 200 OK - 359 bytes in 0.201 second response time
Host Up[06-23-2015 18:06:29] HOST ALERT: webserver;UP;SOFT;8;PING OK - Packet loss = 0%, RTA = 33.92 ms
Host Down[06-23-2015 18:05:25] HOST ALERT: webserver;DOWN;SOFT;7;CRITICAL - Time to live exceeded (1.2.)
Host Down[06-23-2015 18:04:19] HOST ALERT: webserver;DOWN;SOFT;6;PING CRITICAL - Packet loss = 100%
Service Critical[06-23-2015 18:03:53] SERVICE ALERT: webserver;PING;CRITICAL;HARD;3;PING CRITICAL - Packet loss = 100%
Host Down[06-23-2015 18:03:49] HOST ALERT: webserver;DOWN;SOFT;5;PING CRITICAL - Packet loss = 100%
Service Critical[06-23-2015 18:03:49] SERVICE ALERT: webserver;HTTPS;CRITICAL;HARD;3;CRITICAL - Socket timeout after 10 seconds
Host Down[06-23-2015 18:02:19] HOST ALERT: webserver;DOWN;SOFT;4;(Host check timed out after 30.01 seconds)
Service Critical[06-23-2015 18:01:53] SERVICE ALERT: webserver;PING;CRITICAL;SOFT;2;PING CRITICAL - Packet loss = 100%
Service Critical[06-23-2015 18:01:49] SERVICE ALERT: webserver;HTTPS;CRITICAL;SOFT;2;CRITICAL - Socket timeout after 10 seconds
Host Down[06-23-2015 18:01:48] HOST ALERT: webserver;DOWN;SOFT;3;(Host check timed out after 30.01 seconds)
Host Down[06-23-2015 18:00:18] HOST ALERT: webserver;DOWN;SOFT;2;PING CRITICAL - Packet loss = 100%

June 23, 2015 17:00     

Service Critical[06-23-2015 17:59:53] SERVICE ALERT: webserver;PING;CRITICAL;SOFT;1;PING CRITICAL - Packet loss = 100%
Service Critical[06-23-2015 17:59:49] SERVICE ALERT: webserver;HTTPS;CRITICAL;SOFT;1;CRITICAL - Socket timeout after 10 seconds
Host Down[06-23-2015 17:58:48] HOST ALERT: webserver;DOWN;SOFT;1;(Host check timed out after 30.02 seconds)
Service Ok[06-23-2015 17:29:48] SERVICE ALERT: webserver;PING;OK;SOFT;2;PING OK - Packet loss = 0%, RTA = 34.72 ms

So, 17:29 o'clock was everthing all right. 17:58 o'clock till 18:05 o'clock was Packet loss = 100% and Socket timeout.

My Question is, why didn't I get a notification?

Some days bevor and today I get "warning" notifications just fine, but I never get a "critical" notification.

Here is my contact.cfg

define contact{
    contact_name                    nagiosadmin             ; Short name of user
    use                             generic-contact         ; Inherit default values from generic-contact template (defined above)
    alias                           Nagios Admin            ; Full name of user
    email                           user@localhost     ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******

Here is my templates.cfg

define contact{
    name                            generic-contact         ; The name of this contact template
    service_notification_period     24x7                    ; service notifications can be sent anytime
    host_notification_period        24x7                    ; host notifications can be sent anytime
    service_notification_options    w,u,c,r,f,s             ; send notifications for all service states, flapping events, and scheduled downtime events
    host_notification_options       d,u,r,f,s               ; send notifications for all host states, flapping events, and scheduled downtime events
    service_notification_commands   notify-service-by-email ; send service notifications via email
    host_notification_commands      notify-host-by-email    ; send host notifications via email
    register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!

That you did not receive notifications is because all the reported states are SOFT. Notifications are only sent out for HARD states.

You need to look into the service configuration and check the value of max_check_attempts for your service.

| improve this answer | |
  • there are 2 HARD states PING;CRITICAL;HARD;3; and HTTPS;CRITICAL;HARD;3; at 18:03 o'clock. What about them? – JaMaBing Jun 25 '15 at 10:57
  • Sorry, I first thought it was about the Host down states and overlooked the Service ones. Can you confirm that nagios did not sent the notification or that it might be a mailer issue? Look at the 'View notifications for this host` for the specific day and see if it indeed does not show a notification for the Ping service event. You might have a mailer issue so please verify your mail log also. – Lambert Jun 25 '15 at 12:24
  • Nagios didn't send a notification, not in View Notifications For This Host nor in var/nagios.log. But your hint with max_check_attempts is good. For Service it is obviously 3 but for host it is 10. So I guess it will not send notification about services because of host is unreachable, so Nagios will wait until host is also in HARD state – JaMaBing Jun 25 '15 at 13:43

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.