Puppet Class: icingaweb2::module::monitoring
- Defined in:
- manifests/module/monitoring.pp
Summary
Manages the monitoring module. This module is deprecated.Overview
Requirements:
* IDO feature in Icinga 2 (MySQL or PostgreSQL)
* `ApiUser` object in Icinga 2 with proper permissions
class {'icingaweb2::module::monitoring':
ido_host => 'localhost',
ido_type => 'mysql',
ido_db_name => 'icinga2',
ido_db_username => 'icinga2',
ido_db_password => 'supersecret',
commandtransports => {
icinga2 => {
transport => 'api',
username => 'icingaweb2',
password => 'supersecret',
}
}
}
Note:
At first have a look at the [Monitoring module documentation](www.icinga.com/docs/icingaweb2/latest/modules/monitoring/doc/01-About/).
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'manifests/module/monitoring.pp', line 97
class icingaweb2::module::monitoring (
Enum['absent', 'present'] $ensure,
Variant[String[1], Array[String[1]]] $protected_customvars,
Hash $commandtransports,
Hash[String[1], Any] $settings,
Enum['mysql', 'pgsql'] $ido_type,
Stdlib::Host $ido_host,
String $ido_resource_name,
String $ido_db_name,
String $ido_db_username,
Optional[Stdlib::Port] $ido_port = undef,
Optional[Icinga::Secret] $ido_db_password = undef,
Optional[String[1]] $ido_db_charset = undef,
Optional[Boolean] $use_tls = undef,
Optional[Stdlib::Absolutepath] $tls_key_file = undef,
Optional[Stdlib::Absolutepath] $tls_cert_file = undef,
Optional[Stdlib::Absolutepath] $tls_cacert_file = undef,
Optional[Stdlib::Absolutepath] $tls_capath = undef,
Optional[Icinga::Secret] $tls_key = undef,
Optional[String[1]] $tls_cert = undef,
Optional[String[1]] $tls_cacert = undef,
Optional[Boolean] $tls_noverify = undef,
Optional[String[1]] $tls_cipher = undef,
) {
require icingaweb2
$module_conf_dir = "${icingaweb2::globals::conf_dir}/modules/monitoring"
$cert_dir = "${icingaweb2::globals::state_dir}/monitoring/certs"
$db = {
type => $ido_type,
database => $ido_db_name,
host => $ido_host,
port => $ido_port,
username => $ido_db_username,
password => $ido_db_password,
}
$tls = icinga::cert::files(
$ido_db_username,
$cert_dir,
$tls_key_file,
$tls_cert_file,
$tls_cacert_file,
$tls_key,
$tls_cert,
$tls_cacert,
)
$backend_settings = {
'type' => 'ido',
'resource' => $ido_resource_name,
}
$security_settings = {
'protected_customvars' => $protected_customvars ? {
String => $protected_customvars,
Array[String] => join($protected_customvars, ','),
},
}
$_settings = {
'module-monitoring-backends' => {
'section_name' => 'backends',
'target' => "${module_conf_dir}/backends.ini",
'settings' => delete_undef_values($backend_settings),
},
'module-monitoring-security' => {
'section_name' => 'security',
'target' => "${module_conf_dir}/config.ini",
'settings' => delete_undef_values($security_settings),
},
'module-monitoring-general' => {
'section_name' => 'settings',
'target' => "${module_conf_dir}/config.ini",
'settings' => delete_undef_values($settings),
},
}
class { 'icingaweb2::module::monitoring::install': }
-> class { 'icingaweb2::module::monitoring::config': }
contain icingaweb2::module::monitoring::install
contain icingaweb2::module::monitoring::config
}
|