adding more parameters

This commit is contained in:
Arne Teuke
2017-07-24 16:00:07 +01:00
parent 62c755dcd3
commit 9602eb550c
6 changed files with 1268 additions and 229 deletions

View File

@@ -37,6 +37,20 @@ class cd_nagios::server::files (
# manage nagios.cfg
file { $ng_nagios_cfg_file:
ensure => file,
path => $ng_nagios_cfg_file,
owner => 'root',
group => 'root',
mode => '0644',
selrange => s0,
selrole => object_r,
seltype => nagios_etc_t,
seluser => system_u,
content => template($ng_nagios_cfg_erb),
notify => Service[$ng_service],
}
# manage cgi.cfg
file { $ng_cgi_cfg_file:
@@ -53,20 +67,11 @@ class cd_nagios::server::files (
notify => Service[$ng_service],
}
# manage nagios.conf for httpd
# since we use vhost files, we do not want the regular file to appear
# after upgrades to avoid conflicts
file { $ng_nagios_conf:
ensure => absent,
# path => $ng_nagios_conf,
# owner => 'root',
# group => 'root',
# mode => '0644',
# selrange => s0,
# selrole => object_r,
# seltype => httpd_config_t,
# seluser => system_u,
# content => template($ng_nagios_conf_erb),
# notify => Service[$ae_service],
}
file { $ng_forward_conf:

View File

@@ -35,5 +35,55 @@ class cd_nagios::server::service (
hasrestart => true,
enable => true,
}
@@nagios_service { "check_nagios${::hostname}":
check_command => 'check_nagios!/var/log/nagios/status.dat!5!/usr/sbin/nagios',
use => 'generic-service',
host_name => $::fqdn,
notification_period => '24x7',
target => $ng_target_service,
owner => 'nagios',
group => 'nagios',
mode => '660',
contacts => 'DevOps',
}
resources { [ 'nagios_host',
'nagios_hostgroup',
'nagios_hostdependency',
'nagios_hostescalation',
'nagios_hostextinfo',
'nagios_service',
'nagios_servicegroup',
'nagios_servicedependency',
'nagios_serviceescalation',
'nagios_serviceextinfo',
'nagios_contact',
'nagios_contactgroup',
'nagios_command',
'nagios_timeperiod' ]:
purge => true,
}
# collect resources and populate /etc/nagios/conf.d/nagios_*.cfg
Nagios_host <<||>> { notify => Service['nagios'] }
Nagios_hostgroup <<||>> { notify => Service['nagios'] }
Nagios_hostdependency <<||>> { notify => Service['nagios'] }
Nagios_hostescalation <<||>> { notify => Service['nagios'] }
Nagios_hostextinfo <<||>> { notify => Service['nagios'] }
Nagios_service <<||>> { notify => Service['nagios'] }
Nagios_servicegroup <<||>> { notify => Service['nagios'] }
Nagios_servicedependency <<||>> { notify => Service['nagios'] }
Nagios_serviceescalation <<||>> { notify => Service['nagios'] }
Nagios_serviceextinfo <<||>> { notify => Service['nagios'] }
Nagios_contact <<||>> { notify => Service['nagios'] }
Nagios_contactgroup <<||>> { notify => Service['nagios'] }
Nagios_command <<||>> { notify => Service['nagios'] }
Nagios_timeperiod <<||>> { notify => Service['nagios'] }
}
}
}