Hello! We are running our annual fundraising. Please consider making a donation if you value this freely available service or want to support people around the world working towards liberatory social change. https://riseup.net/donate.

Commit cc0f56f8 authored by drebs's avatar drebs
Browse files

Make Icinga2 default check/retry interval configurable for hosts and services

parent 0e7e2c5a
...@@ -12,6 +12,10 @@ class profile::monitoring::server ( ...@@ -12,6 +12,10 @@ class profile::monitoring::server (
Boolean $tls = false, Boolean $tls = false,
Icinga2::CustomAttributes $vars = {}, Icinga2::CustomAttributes $vars = {},
Boolean $onion_service = false, Boolean $onion_service = false,
String $default_host_check_interval = '1m',
String $default_host_retry_interval = '30s',
String $default_service_check_interval = '1m',
String $default_service_retry_interval = '30s',
) { ) {
include profile::monitoring::server::firewall include profile::monitoring::server::firewall
...@@ -73,9 +77,13 @@ class profile::monitoring::server ( ...@@ -73,9 +77,13 @@ class profile::monitoring::server (
$_vars = deep_merge($defaults, $vars) $_vars = deep_merge($defaults, $vars)
Icinga2::Object::Host { icinga2::object::host { 'generic-host':
check_interval => '5m', template => true,
retry_interval => '1m', target => '/etc/icinga2/conf.d/templates.conf',
check_interval => $default_host_check_interval,
retry_interval => $default_host_retry_interval,
max_check_attempts => 3,
check_command => 'hostalive',
} }
icinga2::object::host { $domain_name: icinga2::object::host { $domain_name:
...@@ -94,7 +102,12 @@ class profile::monitoring::server ( ...@@ -94,7 +102,12 @@ class profile::monitoring::server (
include profile::monitoring::server::agents include profile::monitoring::server::agents
include profile::monitoring::checkcommands include profile::monitoring::checkcommands
include profile::monitoring::services
class { 'profile::monitoring::services':
default_service_check_interval => $default_service_check_interval,
default_service_retry_interval => $default_service_retry_interval,
}
include profile::monitoring::services::extras include profile::monitoring::services::extras
# add admin user # add admin user
......
...@@ -9,6 +9,8 @@ class profile::monitoring::services ( ...@@ -9,6 +9,8 @@ class profile::monitoring::services (
Hash $services = {}, Hash $services = {},
Hash $service_groups = {}, Hash $service_groups = {},
Integer $ssh_port = 22, Integer $ssh_port = 22,
String $default_service_check_interval = '1m',
String $default_service_retry_interval = '30s',
) { ) {
# XXX: Workaround so this class can be compiled by itself. Without this, # XXX: Workaround so this class can be compiled by itself. Without this,
...@@ -19,9 +21,13 @@ class profile::monitoring::services ( ...@@ -19,9 +21,13 @@ class profile::monitoring::services (
## services running on the monitoring server ## services running on the monitoring server
Icinga2::Object::Service { icinga2::object::service { 'generic-service':
check_interval => '5m', template => true,
retry_interval => '1m', target => '/etc/icinga2/conf.d/templates.conf',
check_interval => $default_service_check_interval,
retry_interval => $default_service_retry_interval,
max_check_attempts => 3,
check_command => 'hostalive',
} }
# make sure each host is alive # make sure each host is alive
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment