Commit af2bedd4 authored by Walter Heck's avatar Walter Heck

Use a generic templates.conf for icinga so we can standardise certain things

parent 9848f9cf
Pipeline #341 passed with stages
in 2 minutes and 57 seconds
/*
* Generic template examples.
*/
/**
* Provides default settings for hosts. By convention
* all hosts should import this template.
*
* The CheckCommand object `hostalive` is provided by
* the plugin check command templates.
* Check the documentation for details.
*/
template Host "generic-host" {
max_check_attempts = 3
check_interval = 1m
retry_interval = 30s
check_command = "hostalive"
}
template Host "linux-host" {
import "generic-host"
vars.os = "Linux"
vars.disks["disk /"] = {
disk_partition = "/"
}
}
template Host "postgres-dbms" {
}
/**
* Provides default settings for services. By convention
* all services should import this template.
*/
template Service "generic-service" {
max_check_attempts = 5
check_interval = 1m
retry_interval = 30s
}
/**
* Provides default settings for users. By convention
* all users should inherit from this template.
*/
template User "generic-user" {
}
/**
* Provides default settings for host notifications.
* By convention all host notifications should import
* this template.
*/
template Notification "mail-host-notification" {
command = "mail-host-notification"
states = [ Up, Down ]
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd,
DowntimeStart, DowntimeEnd, DowntimeRemoved ]
period = "24x7"
}
/**
* Provides default settings for service notifications.
* By convention all service notifications should import
* this template.
*/
template Notification "mail-service-notification" {
command = "mail-service-notification"
states = [ OK, Warning, Critical, Unknown ]
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd,
DowntimeStart, DowntimeEnd, DowntimeRemoved ]
period = "24x7"
}
......@@ -53,12 +53,24 @@ class opstheater::profile::icinga::client (
tag => 'icinga2::zone',
}
$icinga_host = hiera_hash(icinga2::host, {
'vars' => {
'os' => 'Linux',
'disks' => {
'disk /' => {
'disk_partition' => '/'
}
}
},
'import' => ['linux-host']
})
@@::icinga2::object::host { $::fqdn:
* => merge({
display_name => $::hostname,
address => $agent_ip,
target => "/etc/icinga2/zones.d/${parent_zone}/${::hostname}.conf",
}, hiera_hash(icinga2::host, undef)),
}, $icinga_host),
}
@firewall { '201 allow access to icinga client':
......
......@@ -69,12 +69,21 @@ class opstheater::profile::icinga::server (
}
}
File <<| tag == "icinga2::zone" |>>
File <<| tag == 'icinga2::zone' |>>
::Icinga2::Object::Host <<| |>>
::Icinga2::Object::Service <<| |>>
::Icinga2::Object::Zone <<| |>>
# Static config files
file { '/etc/icinga2/zones.d/global-templates/templates.conf':
ensure => file,
owner => 'icinga',
group => 'icinga',
mode => '0640',
source => 'puppet:///modules/opstheater/icinga2/templates.conf',
}
@firewall { '201 allow access to icinga master':
chain => 'INPUT',
jump => 'OPSTHEATER',
......
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