Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
docker_nagios
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Le Filament
Ansible Roles
docker_nagios
Commits
7acca7e9
Commit
7acca7e9
authored
2 years ago
by
Théo - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
templates/templates.cfg.j2
+15
-5
15 additions, 5 deletions
templates/templates.cfg.j2
templates/timeperiods.cfg.j2
+12
-0
12 additions, 0 deletions
templates/timeperiods.cfg.j2
templates/vps.cfg.j2
+3
-3
3 additions, 3 deletions
templates/vps.cfg.j2
with
30 additions
and
8 deletions
templates/templates.cfg.j2
+
15
−
5
View file @
7acca7e9
...
@@ -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 {
...
...
This diff is collapsed.
Click to expand it.
templates/timeperiods.cfg.j2
+
12
−
0
View file @
7acca7e9
...
@@ -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
}
This diff is collapsed.
Click to expand it.
templates/vps.cfg.j2
+
3
−
3
View file @
7acca7e9
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment