OP#672 add nagios monitoring
This commit is contained in:
@@ -11,4 +11,8 @@ class confdroid_puppet::main::config (
|
||||
if $pt_use_r10k == true {
|
||||
include confdroid_puppet::r10k::install
|
||||
}
|
||||
|
||||
if $pt_manage_nagios == true {
|
||||
include confdroid_puppet::monitoring::target
|
||||
}
|
||||
}
|
||||
|
||||
23
manifests/monitoring/target.pp
Normal file
23
manifests/monitoring/target.pp
Normal file
@@ -0,0 +1,23 @@
|
||||
## confdroid_puppet::monitoring::target.pp
|
||||
# Module name: confdroid_puppet
|
||||
# Author: 12ww1160 (12ww1160@puppetsoft.com)
|
||||
# @summary class manages exports for nagios monitoring
|
||||
##############################################################################
|
||||
class confdroid_puppet::monitoring::target (
|
||||
|
||||
) inherits confdroid_puppet::params {
|
||||
if $pt_manage_nagios == true {
|
||||
@@nagios_service { "check_puppet_${fqdn}":
|
||||
check_command => "check_nrpe!check_puppet!${pt_procs_allowed}!puppet",
|
||||
use => 'generic-service',
|
||||
host_name => $fqdn,
|
||||
notification_period => '24x7',
|
||||
service_description => "${fqdn}_check_puppet",
|
||||
target => $pt_target_service,
|
||||
owner => 'nagios',
|
||||
group => 'nagios',
|
||||
mode => '0640',
|
||||
contacts => $pt_target_contacts,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,9 @@
|
||||
# @param [String] pt_pptdb_server_crt placeholder for the server.crt
|
||||
# @param [String] pt_pptdb_server_key placeholder for the server.crt
|
||||
# @param [String] pt_pptdb_log_max_age the max age for puppetdb logs in days
|
||||
# @param [Boolean] pt_manage_nagios whether to manage nagios settings
|
||||
# @param [String] pt_target_service the nagios service config file
|
||||
# @param [Array] pt_target_contacts the nagios contacts to notify
|
||||
###############################################################################
|
||||
class confdroid_puppet::params (
|
||||
|
||||
@@ -141,6 +144,12 @@ class confdroid_puppet::params (
|
||||
String $pt_r10k_basedir = '/etc/puppetlabs/code/environments',
|
||||
String $pt_r10k_webhook_port = '8085',
|
||||
|
||||
# nagios
|
||||
Boolean $pt_manage_nagios = false,
|
||||
String $pt_target_service = '/etc/nagios/conf.d/puppet_service.cfg',
|
||||
Array $pt_target_contacts = ['nagiosadmin'],
|
||||
String $pt_procs_allowed = '1:'
|
||||
|
||||
) {
|
||||
# facts
|
||||
$fqdn = $facts['networking']['fqdn']
|
||||
|
||||
Reference in New Issue
Block a user