OP#672 add sshd nagios check
This commit is contained in:
@@ -7,4 +7,8 @@ class confdroid_ssh::main::config (
|
||||
) inherits confdroid_ssh::params {
|
||||
require confdroid_selinux
|
||||
include confdroid_ssh::main::service
|
||||
|
||||
if $ssh_manage_nagios == true {
|
||||
include confdroid_ssh::monitoring::target
|
||||
}
|
||||
}
|
||||
|
||||
22
manifests/monitoring/target.pp
Normal file
22
manifests/monitoring/target.pp
Normal file
@@ -0,0 +1,22 @@
|
||||
## confdroid_ssh::monitoring::target.pp
|
||||
# Module name: confdroid_ssh
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages Nagios monitoring settings
|
||||
##############################################################################
|
||||
class confdroid_ssh::monitoring::target (
|
||||
) inherits confdroid_ssh::params {
|
||||
if $ssh_manage_nagios == true {
|
||||
@@nagios_service { "check_ssh_${fqdn}":
|
||||
check_command => "check_nrpe!check_ssh!${ssh_procs_allowed}!sshd",
|
||||
use => 'generic-service',
|
||||
host_name => $fqdn,
|
||||
notification_period => '24x7',
|
||||
service_description => "${fqdn}_check_ssh",
|
||||
target => $ssh_target_service,
|
||||
owner => 'nagios',
|
||||
group => 'nagios',
|
||||
mode => '0640',
|
||||
contacts => $ssh_target_contacts,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,13 @@ class confdroid_ssh::params (
|
||||
String $ssh_fw_order = '50',
|
||||
String $ssh_source_range = '0.0.0.0/0',
|
||||
|
||||
# monitoring
|
||||
|
||||
Boolean $ssh_manage_nagios = false,
|
||||
String $ssh_target_service = '/etc/nagios/conf.d/sshd_service.cfg',
|
||||
String $ssh_target_contacts = 'nagiosadmin',
|
||||
String $ssh_procs_allowed = '1:',
|
||||
|
||||
) {
|
||||
# default facts
|
||||
$fqdn = $facts['networking']['fqdn']
|
||||
|
||||
Reference in New Issue
Block a user