Weitere ähnliche Inhalte Ähnlich wie Icinga 2 and Puppet automate monitoring (20) Kürzlich hochgeladen (20) Icinga 2 and Puppet automate monitoring7. ●
○ mod 'icingaweb2',
■ :git => 'https://github.com/icinga/puppet-icingaweb2.git'
○ mod 'icinga2',
■ :git => 'https://github.com/icinga/puppet-icinga2.git',
■ :branch => 'develop'
○ mod 'puppetlabs/mysql', '3.6.2'
8. class opstheater::profile::icinga::db {
$icinga2_webdb_password = ‘mypw’
$icinga2_ido_password = ‘mypw’
$mysql_whitelist_range = ‘192.168.%’
mysql::db { 'icinga2_web':
user => 'icinga2_web',
password => $icinga2_webdb_password,
host => $mysql_whitelist_range,
grant => ['ALL'],
}
mysql::db { 'icinga2_data':
user => 'icinga2',
password => $icinga2_ido_password,
host => $mysql_whitelist_range,
grant => ['ALL'],
}
}
10. ●
●
●
class opstheater::profile::icinga::web {
class { 'icingaweb2':
manage_repo => true,
install_method => 'package',
manage_apache_vhost => true,
apache_vhost_name => $icinga2_web_fqdn,
ido_db => 'mysql',
ido_db_host => $icinga2_db_ip,
ido_db_name => 'icinga2_data',
ido_db_user => 'icinga2',
ido_db_pass => $icinga2_ido_pass,
web_db => 'mysql',
web_db_name => 'icinga2_web',
web_db_host => $icinga2_db_ip,
web_db_user => 'icinga2_web',
web_db_pass => $icinga2_webdb_pass,
web_db_port => '3306',
}
11. class opstheater::profile::icinga::client {
include ::icinga2
include ::icinga2::feature::command
class { '::icinga2::feature::api':
accept_commands => true,
accept_config => true,
manage_zone => false,
}
# icinga2::pki::puppet class needs to be
declared
# after the icinga2::feature::api class in order
# to avoid resource duplication
contain ::icinga2::pki::puppet
}
$icinga2_web_fqdn = hiera('opstheater::
icingaweb::fqdn')
@@icinga2::object::zone { $::fqdn:
endpoints => {
$::fqdn => {
host => $::fqdn },
},
parent => 'master',
}
icinga2::object::zone { 'master':
endpoints => {
$icinga2_web_fqdn => {
host => $icinga2_web_fqdn },
},
}
Icinga2::Object::Zone <<| |>>
18. node ‘icinga.olindata.com’ {
Icinga2::Object::Host <<| |>>
Icinga2::Object::Service <<| |>>
Icinga2::Object::Zone <<| |>>
@@icinga2::object::zone { $::fqdn:
endpoints => {
$::fqdn => { host => $::fqdn },
},
parent => 'master',
}
icinga2::object::zone { 'master':
endpoints => {
$icinga2_fqdn => {
host => $icinga2_ip,
},
},
}
}
node ‘web01.olindata.com’ {
@@icinga2::object::zone { $::fqdn:
endpoints => {
$::fqdn => { host => $::fqdn },
},
parent => 'master',
}
icinga2::object::zone { 'master':
endpoints => {
$icinga2_fqdn => {
host => $icinga2_ip,
},
},
}
Icinga2::Object::Zone <<| |>>
@@icinga2::object::host { $::fqdn:
ipv4_address => $::ipaddress,
}
}
19. Icinga2::Object::Apply_service {
assign_where => 'host.address && host.vars.remote == true && host.vars.remote_endpoint',
command_endpoint => 'host.vars.remote_endpoint',
}
icinga2::object::apply_service { 'user':
check_command => 'users',
}
icinga2::object::apply_service { 'load':
check_command => 'load',
}
icinga2::object::apply_service { 'process':
check_command => 'procs',
}