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 (
Boolean $tls = false,
Icinga2::CustomAttributes $vars = {},
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
......@@ -73,9 +77,13 @@ class profile::monitoring::server (
$_vars = deep_merge($defaults, $vars)
Icinga2::Object::Host {
check_interval => '5m',
retry_interval => '1m',
icinga2::object::host { 'generic-host':
template => true,
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:
......@@ -94,7 +102,12 @@ class profile::monitoring::server (
include profile::monitoring::server::agents
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
# add admin user
......
......@@ -9,6 +9,8 @@ class profile::monitoring::services (
Hash $services = {},
Hash $service_groups = {},
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,
......@@ -19,9 +21,13 @@ class profile::monitoring::services (
## services running on the monitoring server
Icinga2::Object::Service {
check_interval => '5m',
retry_interval => '1m',
icinga2::object::service { 'generic-service':
template => true,
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
......
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