OP#429 initial commit after fork
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
## cd_nrpe::commands::definition_rules.pp
|
||||
# Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
## confdroid_nrpe::commands::definition_rules.pp
|
||||
# Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@ConfDroid.com)
|
||||
# @summary manage command definitions via define and Puppet rules.
|
||||
# @example
|
||||
# cd_nrpe::commands::definitions { 'check_users':
|
||||
# confdroid_nrpe::commands::definitions { 'check_users':
|
||||
# ne_check_cmd => 'check_users',
|
||||
# ne_cmd_argstring => '-w $ARG1$ -c $ARG2$',
|
||||
# ne_cmd_comment => 'check the amount of user logged in locally',
|
||||
# }
|
||||
###############################################################################
|
||||
class cd_nrpe::commands::definition_rules (
|
||||
class confdroid_nrpe::commands::definition_rules (
|
||||
|
||||
) inherits cd_nrpe::params {
|
||||
) inherits confdroid_nrpe::params {
|
||||
if $ne_manage_cmds == true {
|
||||
require cd_nrpe::main::files
|
||||
require confdroid_nrpe::main::files
|
||||
|
||||
# manage the commands.cfg file
|
||||
|
||||
@@ -40,28 +40,28 @@ class cd_nrpe::commands::definition_rules (
|
||||
|
||||
# basic example rules
|
||||
|
||||
cd_nrpe::commands::definitions { 'check_users':
|
||||
confdroid_nrpe::commands::definitions { 'check_users':
|
||||
ne_check_cmd => 'check_users',
|
||||
ne_cmd_argstring => '-w $ARG1$ -c $ARG2$',
|
||||
ne_cmd_comment => 'check the amount of user logged in locally',
|
||||
}
|
||||
|
||||
cd_nrpe::commands::definitions { 'check_load':
|
||||
confdroid_nrpe::commands::definitions { 'check_load':
|
||||
ne_check_cmd => 'check_load',
|
||||
ne_cmd_argstring => '-w $ARG1$ -c $ARG2$',
|
||||
}
|
||||
|
||||
cd_nrpe::commands::definitions { 'check_disk':
|
||||
confdroid_nrpe::commands::definitions { 'check_disk':
|
||||
ne_check_cmd => 'check_disk',
|
||||
ne_cmd_argstring => '-w $ARG1$ -c $ARG2$ -p $ARG3$',
|
||||
}
|
||||
|
||||
cd_nrpe::commands::definitions { 'check_procs':
|
||||
confdroid_nrpe::commands::definitions { 'check_procs':
|
||||
ne_check_cmd => 'check_procs',
|
||||
ne_cmd_argstring => '-w $ARG1$ -c $ARG2$ -s $ARG3$',
|
||||
}
|
||||
|
||||
cd_nrpe::commands::definitions { 'check_swap':
|
||||
confdroid_nrpe::commands::definitions { 'check_swap':
|
||||
ne_check_cmd => 'check_swap',
|
||||
ne_cmd_argstring => '-w $ARG1$ -c $ARG2$',
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## cd_nrpe::commands::definitions.pp
|
||||
# Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
## confdroid_nrpe::commands::definitions.pp
|
||||
# Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@ConfDroid.com)
|
||||
# @summary Populate command definitions through external puppet rules, i.e.
|
||||
# from other modules.
|
||||
# @param [String] ne_check_cmd Specify the check_command to use.
|
||||
@@ -13,7 +13,7 @@
|
||||
# @param [String] ne_cmd_comment Specify an optional comment for your command
|
||||
# definition
|
||||
###############################################################################
|
||||
define cd_nrpe::commands::definitions (
|
||||
define confdroid_nrpe::commands::definitions (
|
||||
|
||||
Optional[String] $ne_check_cmd = undef,
|
||||
String $ne_cmd_path = '/usr/lib64/nagios/plugins/',
|
||||
@@ -21,9 +21,9 @@ define cd_nrpe::commands::definitions (
|
||||
String $ne_cmd_comment = '',
|
||||
|
||||
) {
|
||||
$ne_cmd_file = $cd_nrpe::params::ne_cmd_file
|
||||
$ne_cmd_rule_erb = $cd_nrpe::params::ne_cmd_rule_erb
|
||||
$ne_manage_cmds = $cd_nrpe::params::ne_manage_cmds
|
||||
$ne_cmd_file = $confdroid_nrpe::params::ne_cmd_file
|
||||
$ne_cmd_rule_erb = $confdroid_nrpe::params::ne_cmd_rule_erb
|
||||
$ne_manage_cmds = $confdroid_nrpe::params::ne_manage_cmds
|
||||
|
||||
if $ne_manage_cmds == true {
|
||||
concat::fragment { $name:
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## cd_nrpe::firewall::iptables.pp #
|
||||
# Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
## confdroid_nrpe::firewall::iptables.pp #
|
||||
# Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@ConfDroid.com)
|
||||
|
||||
# @summary manage firewall settings through puppetlabs-firewall
|
||||
###############################################################################
|
||||
class cd_nrpe::firewall::iptables (
|
||||
class confdroid_nrpe::firewall::iptables (
|
||||
|
||||
) inherits cd_nrpe::params {
|
||||
) inherits confdroid_nrpe::params {
|
||||
if $ne_incl_fw == true {
|
||||
firewall { "${ne_fw_order_no}${ne_nrpe_port} port ${ne_nrpe_port}":
|
||||
# source => $nagios_server,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
## cd_nrpe::init.pp
|
||||
# Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class initializes the cd_nrpe Module.
|
||||
## confdroid_nrpe::init.pp
|
||||
# Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class initializes the confdroid_nrpe Module.
|
||||
##############################################################################
|
||||
class cd_nrpe {
|
||||
include cd_nrpe::params
|
||||
class confdroid_nrpe {
|
||||
include confdroid_nrpe::params
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
## cd_nrpe::main::config.pp
|
||||
# Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
## confdroid_nrpe::main::config.pp
|
||||
# Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@ConfDroid.com)
|
||||
|
||||
# @summary Class manages the module logic for cd_nrpe.
|
||||
# @summary Class manages the module logic for confdroid_nrpe.
|
||||
##############################################################################
|
||||
class cd_nrpe::main::config (
|
||||
class confdroid_nrpe::main::config (
|
||||
|
||||
) inherits cd_nrpe::params {
|
||||
include cd_nrpe::main::service
|
||||
) inherits confdroid_nrpe::params {
|
||||
include confdroid_nrpe::main::service
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## cd_nrpe::main::dirs.pp
|
||||
# Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# @summary Class manages all directories required for cd_nrpe.
|
||||
## confdroid_nrpe::main::dirs.pp
|
||||
# Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@ConfDroid.com)
|
||||
# @summary Class manages all directories required for confdroid_nrpe.
|
||||
###############################################################################
|
||||
class cd_nrpe::main::dirs (
|
||||
class confdroid_nrpe::main::dirs (
|
||||
|
||||
) inherits cd_nrpe::params {
|
||||
require cd_nrpe::main::user
|
||||
) inherits confdroid_nrpe::params {
|
||||
require confdroid_nrpe::main::user
|
||||
|
||||
# manage main conf_d_dir
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## cd_nrpe::main::files.pp
|
||||
# Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# @summary Class manages all configuration files required for cd_nrpe.
|
||||
## confdroid_nrpe::main::files.pp
|
||||
# Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@ConfDroid.com)
|
||||
# @summary Class manages all configuration files required for confdroid_nrpe.
|
||||
##############################################################################
|
||||
class cd_nrpe::main::files (
|
||||
class confdroid_nrpe::main::files (
|
||||
|
||||
) inherits cd_nrpe::params {
|
||||
require cd_nrpe::main::dirs
|
||||
) inherits confdroid_nrpe::params {
|
||||
require confdroid_nrpe::main::dirs
|
||||
|
||||
# manage /etc/nagios/nrpe.cfg
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## cd_nrpe::main::install.pp
|
||||
# Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# @summary Class manages installing binaries required for cd_nrpe
|
||||
## confdroid_nrpe::main::install.pp
|
||||
# Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@ConfDroid.com)
|
||||
# @summary Class manages installing binaries required for confdroid_nrpe
|
||||
###############################################################################
|
||||
class cd_nrpe::main::install (
|
||||
class confdroid_nrpe::main::install (
|
||||
|
||||
) inherits cd_nrpe::params {
|
||||
require cd_resources
|
||||
) inherits confdroid_nrpe::params {
|
||||
require confdroid_resources::main::epel
|
||||
|
||||
package { $reqpackages:
|
||||
ensure => $pkg_ensure,
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
## cd_nrpe::main::service.pp
|
||||
# Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# @summary Class manages the service(s) for cd_nrpe.
|
||||
## confdroid_nrpe::main::service.pp
|
||||
# Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@ConfDroid.com)
|
||||
# @summary Class manages the service(s) for confdroid_nrpe.
|
||||
#############################################################################
|
||||
class cd_nrpe::main::service (
|
||||
class confdroid_nrpe::main::service (
|
||||
|
||||
) inherits confdroid_nrpe::params {
|
||||
require confdroid_nrpe::main::files
|
||||
|
||||
) inherits cd_nrpe::params {
|
||||
if $ne_incl_fw == true {
|
||||
require cd_nrpe::firewall::iptables
|
||||
require confdroid_nrpe::firewall::iptables
|
||||
}
|
||||
|
||||
require cd_nrpe::main::files
|
||||
|
||||
if $ne_manage_cmds == true {
|
||||
require cd_nrpe::commands::definition_rules
|
||||
require confdroid_nrpe::commands::definition_rules
|
||||
}
|
||||
|
||||
if $ne_include_selinux == true {
|
||||
require cd_nrpe::selinux::config
|
||||
require confdroid_nrpe::selinux::config
|
||||
}
|
||||
|
||||
service { $ne_service:
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## cd_nrpe::main::user.pp
|
||||
# Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# @summary Class manages service users for cd_nrpe.
|
||||
## confdroid_nrpe::main::user.pp
|
||||
# Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@ConfDroid.com)
|
||||
# @summary Class manages service users for confdroid_nrpe.
|
||||
#############################################################################
|
||||
class cd_nrpe::main::user (
|
||||
class confdroid_nrpe::main::user (
|
||||
|
||||
) inherits cd_nrpe::params {
|
||||
require cd_nrpe::main::install
|
||||
) inherits confdroid_nrpe::params {
|
||||
require confdroid_nrpe::main::install
|
||||
|
||||
group { $ne_user:
|
||||
ensure => present,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## cd_nrpe::params.pp
|
||||
# Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# @summary Class holds all parameters for the cd_nrpe module and is
|
||||
## confdroid_nrpe::params.pp
|
||||
# Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@ConfDroid.com)
|
||||
# @summary Class holds all parameters for the confdroid_nrpe module and is
|
||||
# inherited by all classes except defines.
|
||||
# @see https://www.nagios.org/documentation/
|
||||
# @param [String] pkg_ensure
|
||||
@@ -43,10 +43,6 @@
|
||||
# this version but will be changed in a later version of NRPE.
|
||||
# @param [String] ne_ssl_cacert_file path and name of the ssl certificate
|
||||
# authority (ca) file / chain. must be full path.
|
||||
# @param [String] ne_ssl_cert_file path and name of the server ssl certificate.
|
||||
# must include full path.
|
||||
# @param [String] ne_ssl_privatekey_file path and name of the server ssl
|
||||
# private key. Must include full path.
|
||||
# @param [String] ne_ssl_client_certs determines client certificate usage.
|
||||
# Values: 0 = Don't ask for or require client certificates
|
||||
# 1 = Ask for client certificates
|
||||
@@ -82,9 +78,9 @@
|
||||
# @param [Boolean] ne_manage_cmds Whether to manage command rules for NRPE
|
||||
# checks, to allow dynamic check & command rules.
|
||||
###############################################################################
|
||||
class cd_nrpe::params (
|
||||
class confdroid_nrpe::params (
|
||||
|
||||
String $pkg_ensure = 'latest',
|
||||
String $pkg_ensure = 'present',
|
||||
Array $reqpackages = ['nrpe','nrpe-selinux'],
|
||||
|
||||
Boolean $ne_manage_cmds = true,
|
||||
@@ -104,7 +100,7 @@ class cd_nrpe::params (
|
||||
String $ne_nrpe_port = '5666',
|
||||
String $ne_server_address = '0.0.0.0',
|
||||
String $ne_listen_queue_size = '5',
|
||||
String $ne_nagios_server = $::nagios_server,
|
||||
String $ne_nagios_server = 'nagios.example.net',
|
||||
String $ne_dont_blame_nrpe = '1',
|
||||
String $ne_allow_bash_cmd_subst = '1',
|
||||
Boolean $ne_allow_sudo = true,
|
||||
@@ -117,8 +113,6 @@ class cd_nrpe::params (
|
||||
String $ne_ssl_use_adh = '1',
|
||||
String $ne_ssl_cipher_list = 'ALL:!aNULL:!eNULL:!SSLv2:!LOW:!EXP:!RC4:!MD5:@STRENGTH',
|
||||
String $ne_ssl_cacert_file = '/etc/pki/tls/certs/ca-chain.crt.pem',
|
||||
String $ne_ssl_cert_file = "/etc/pki/tls/certs/${::fqdn}.crt.pem",
|
||||
String $ne_ssl_privatekey_file = "/etc/pki/tls/private/${::fqdn}.key.pem",
|
||||
String $ne_ssl_client_certs = '2',
|
||||
String $ne_ssl_logging = '0x00',
|
||||
Array $ne_nasty_metachars = ["|`&><'\\[]{};\r\n"],
|
||||
@@ -135,6 +129,12 @@ class cd_nrpe::params (
|
||||
Boolean $ne_include_selinux = true,
|
||||
|
||||
) {
|
||||
# Default facts
|
||||
$fqdn = $facts['networking']['fqdn']
|
||||
$domain = $facts['networking']['domain']
|
||||
$os_name = $facts['os']['name']
|
||||
$os_release = $facts['os']['release']['major']
|
||||
|
||||
# service
|
||||
$ne_service = 'nrpe'
|
||||
|
||||
@@ -144,22 +144,24 @@ class cd_nrpe::params (
|
||||
|
||||
# files
|
||||
$ne_main_conf_file = '/etc/nagios/nrpe.cfg'
|
||||
$ne_main_conf_erb = 'cd_nrpe/nrpe_cfg.erb'
|
||||
$ne_main_conf_erb = 'confdroid_nrpe/nrpe_cfg.erb'
|
||||
$ne_nrpe_pid_file = "${ne_run_dir}/nrpe.pid"
|
||||
$ne_nrpe_conf_file = '/etc/sysconfig/nrpe'
|
||||
$ne_nrpe_conf_erb = 'cd_nrpe/nrpe_conf.erb'
|
||||
$ne_nrpe_conf_erb = 'confdroid_nrpe/nrpe_conf.erb'
|
||||
$ne_cmd_file = "${ne_main_conf_d_dir}/commands.cfg"
|
||||
$ne_cmd_head_erb = 'cd_nrpe/cmd_head.erb'
|
||||
$ne_cmd_rule_erb = 'cd_nrpe/cmd_rule.erb'
|
||||
$ne_cmd_head_erb = 'confdroid_nrpe/cmd_head.erb'
|
||||
$ne_cmd_rule_erb = 'confdroid_nrpe/cmd_rule.erb'
|
||||
$ne_sudo_file = '/etc/sudoers.d/nagios_sudo'
|
||||
$ne_sudo_rule_erb = 'cd_nrpe/sudo_rule.erb'
|
||||
$ne_sudo_rule_erb = 'confdroid_nrpe/sudo_rule.erb'
|
||||
$ne_nrpe_te_file = "${ne_main_conf_d_dir}/nrpe.te"
|
||||
$ne_nrpe_te_erb = 'cd_nrpe/nrpe.te.erb'
|
||||
$ne_nrpe_te_erb = 'confdroid_nrpe/nrpe.te.erb'
|
||||
$ne_nrpe_mod_file = "${ne_main_conf_d_dir}/nrpe.mod"
|
||||
$ne_checkmodule_nrpe_erb = 'cd_nrpe/checkmodule_nrpe.erb'
|
||||
$ne_checkmodule_nrpe_erb = 'confdroid_nrpe/checkmodule_nrpe.erb'
|
||||
$ne_nrpe_pp_file = "${ne_main_conf_d_dir}/nrpe.pp"
|
||||
$ne_semodule_erb = 'cd_nrpe/semodule_nrpe.erb'
|
||||
$ne_semodule_erb = 'confdroid_nrpe/semodule_nrpe.erb'
|
||||
$ne_ssl_cert_file = "/etc/pki/tls/certs/${fqdn}.crt.pem"
|
||||
$ne_ssl_privatekey_file = "/etc/pki/tls/private/${fqdn}.key.pem"
|
||||
|
||||
# includes must be last
|
||||
include cd_nrpe::main::config
|
||||
include confdroid_nrpe::main::config
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
## cd_nrpe::selinux::config.pp # Module name: cd_nrpe
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
## confdroid_nrpe::selinux::config.pp # Module name: confdroid_nrpe
|
||||
# Author: 12ww1160 (12ww1160@ConfDroid.com)
|
||||
# @summary Class manages all aspects of configuring selinux for NRPE.
|
||||
##############################################################################
|
||||
class cd_nrpe::selinux::config (
|
||||
class confdroid_nrpe::selinux::config (
|
||||
|
||||
) inherits cd_nrpe::params {
|
||||
) inherits confdroid_nrpe::params {
|
||||
if $ne_include_selinux == true {
|
||||
# manage allow nagios sudo
|
||||
|
||||
|
||||
Reference in New Issue
Block a user