Skip to content
Snippets Groups Projects
Commit 7acca7e9 authored by Théo - Le Filament's avatar Théo - Le Filament
Browse files

fix: notification for host checks and backup check every morning

parent 73531e27
No related branches found
No related tags found
No related merge requests found
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
define contact{ define contact{
name generic-contact ; The name of this contact template name generic-contact ; The name of this contact template
service_notification_period heures-ouvres ; service notifications can be sent anytime during working hours host_notification_period 24x7 ; host notifications can be sent anytime
host_notification_period heures-ouvres ; host notifications can be sent anytime during working hours
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 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 host_notification_commands notify-host-by-email ; send host notifications via email
service_notification_period 24x7 ; service 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
service_notification_commands notify-service-by-email ; send service notifications via email
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE! register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
} }
...@@ -64,6 +64,7 @@ define host{ ...@@ -64,6 +64,7 @@ define host{
check_interval 10 ; Actively check the host every 10 minutes check_interval 10 ; Actively check the host every 10 minutes
retry_interval 2 ; Schedule host check retries at 2 minute intervals retry_interval 2 ; Schedule host check retries at 2 minute intervals
max_check_attempts 3 ; Check each host 3 times (max) max_check_attempts 3 ; Check each host 3 times (max)
contact_groups admins ; Notifications get sent out to everyone in the 'admins' group
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
} }
...@@ -199,7 +200,8 @@ define service{ ...@@ -199,7 +200,8 @@ define service{
name daily-service name daily-service
use generic-service use generic-service
max_check_attempts 2 max_check_attempts 2
check_interval 1440 check_period morning
check_interval 120
retry_interval 5 retry_interval 5
notification_interval 1440 notification_interval 1440
register 0 register 0
...@@ -217,6 +219,14 @@ define service{ ...@@ -217,6 +219,14 @@ define service{
register 0 register 0
} }
# Everytine notification service.
define service{
name everytime-notification
use generic-service
notification_period 24x7
register 0
}
# Graph service definition template - This is NOT a real service, just a template! # Graph service definition template - This is NOT a real service, just a template!
define service { define service {
......
...@@ -75,3 +75,15 @@ define timeperiod{ ...@@ -75,3 +75,15 @@ define timeperiod{
} }
# Morning, before people start to work.
define timeperiod{
timeperiod_name morning
alias Morning
sunday 07:00-08:00
monday 07:00-08:00
tuesday 07:00-08:00
wednesday 07:00-08:00
thursday 07:00-08:00
friday 07:00-08:00
saturday 07:00-08:00
}
...@@ -106,21 +106,21 @@ define service{ ...@@ -106,21 +106,21 @@ define service{
{% endif %} {% endif %}
{% endfor %} {% endfor %}
define service{ define service{
use daily-service use daily-service,everytime-notification
host_name {{ groups['backup_server'] | map('extract', hostvars, ['inventory_hostname']) | sort | join(',') }} host_name {{ groups['backup_server'] | map('extract', hostvars, ['inventory_hostname']) | sort | join(',') }}
service_description Backup Odoo Dockers service_description Backup Odoo Dockers
check_command check_nrpe!check_odoo_storage check_command check_nrpe!check_odoo_storage
} }
define service{ define service{
use daily-service use daily-service,everytime-notification
host_name {{ groups['backup_server'] | map('extract', hostvars, ['inventory_hostname']) | sort | join(',') }} host_name {{ groups['backup_server'] | map('extract', hostvars, ['inventory_hostname']) | sort | join(',') }}
service_description Backup2 Odoo Dockers service_description Backup2 Odoo Dockers
check_command check_nrpe!check_odoo2_storage check_command check_nrpe!check_odoo2_storage
} }
define service{ define service{
use daily-service,graphed-service use daily-service,everytime-notification,graphed-service
host_name {{ groups['backup_server'] | map('extract', hostvars, ['inventory_hostname']) | sort | join(',') }} host_name {{ groups['backup_server'] | map('extract', hostvars, ['inventory_hostname']) | sort | join(',') }}
service_description Backup Cloud Files service_description Backup Cloud Files
check_command check_nrpe!check_cloud_storage check_command check_nrpe!check_cloud_storage
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment