Nagios doesn't send services auto-alerts

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
vgnatyuk
Posts: 1
Joined: Wed Jun 30, 2021 4:41 am

Nagios doesn't send services auto-alerts

Post by vgnatyuk »

Hello! I use Nagios Core 4.4.6. I want Nagios to send services email notifications. I've used notify-host-by-email already and now want to use notify-service-by-email. If I use 'Send custom service notification' it success. But auto-alerts doesn't work.

templates.cfg

Code: Select all

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,$
host_notification_options       d,u,r,f,s               ; send notifications for all host states, fl$
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                       ; DON'T REGISTER THIS DEFINITION - ITS NOT A$
}


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          0                       ; Flap detection is enabled
process_perf_data               1                       ; Process performance data
retain_status_information       1                       ; Retain status information across program r$
retain_nonstatus_information    1                       ; Retain non-status information across progr$
notification_period             24x7                    ; Send host notifications at any time
register                        0                       ; DON'T REGISTER THIS DEFINITION - ITS NOT A$
}


define host {

name                            linux-server            ; The name of this host template
use                             generic-host            ; This template inherits other values from t$
check_period                    24x7                    ; By default, Linux hosts are checked round $
check_interval                  5                       ; Actively check the host every 5 minutes
retry_interval                  1                       ; Schedule host check retries at 1 minute in$
max_check_attempts              10                      ; Check each Linux host 10 times (max)
check_command                   check-host-alive        ; Default command to check Linux hosts
notification_period             workhours               ; Linux admins hate to be woken up, so we on$
                                                        ; Note that the notification_period variable$
                                                        ; the value that is inherited from the gener$
notification_interval           120                     ; Resend notifications every 2 hours
notification_options            d,u,r                   ; Only send notifications for specific host $
contact_groups                  admins                  ; Notifications get sent to the admins by de$
register                        0                       ; DON'T REGISTER THIS DEFINITION - ITS NOT A$
}
test_server.cfg

Code: Select all

define host {

use                     linux-server
host_name               test_server
alias                   test_server
address                 111.111.111.11 ; sample address
notification_interval   5
notification_period     24x7
}

define service {

use                     local-service           ; Name of service template to use
host_name               test_server
service_description     PING
check_command           check_ping!100.0,20%!500.0,60%
}

define service {

use                     local-service           ; Name of service template to use
host_name               test_server
service_description     SSH
check_command           check_ssh
notification_interval   5
}



define service {

use                     local-service           ; Name of service template to use
host_name               test_server
service_description     HTTP
check_command           check_http
notification_interval   5


}
contacts.cfg

Code: Select all

define contact {

contact_name            nagiosadmin             ; Short name of user
use                     generic-contact         ; Inherit default values from generic-contact templa$
alias                   Nagios Admin            ; Full name of user
email                   gmail@gmail.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ****$
}

define contactgroup {

contactgroup_name       admins
alias                   Nagios Administrators
members                 nagiosadmin
}
Locked