Documentation by YARD 0.9.36
+Alphabetic Index
+ +Puppet Class Listing A-Z
+ + +
+
+
+
|
+
File Listing
+-
+
+
+
- README + + +
diff --git a/doc/_index.html b/doc/_index.html new file mode 100644 index 0000000..23ab099 --- /dev/null +++ b/doc/_index.html @@ -0,0 +1,158 @@ + + +
+ + +
+
+
+
|
+
| t |
+ + + +6 +7 +8+ |
+
+ # File 'manifests/init.pp', line 6
+
+class confdroid_nagios {
+ include confdroid_nagios::params
+}
+ |
+
confdroid_nagios::client::target.pp Module name: confdroid_nagios Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10+ |
+
+ # File 'manifests/client/target.pp', line 6
+
+class confdroid_nagios::client::target (
+
+) inherits confdroid_nagios::params {
+ # Manage target configuration here
+}
+ |
+
confdroid_nagios::main::config.pp Module name: confdroid_nagios Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11+ |
+
+ # File 'manifests/main/config.pp', line 6
+
+class confdroid_nagios::main::config (
+
+) inherits confdroid_nagios::params {
+ include confdroid_nagios::server::service
+ include confdroid_nagios::client::target
+}
+ |
+
confdroid_nagios::main::dirs.pp Module name: confdroid_nagios Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194+ |
+
+ # File 'manifests/main/dirs.pp', line 6
+
+class confdroid_nagios::main::dirs (
+
+) inherits confdroid_nagios::params {
+ require confdroid_nagios::main::user
+
+ # main directory
+ file { $ng_main_dir:
+ ensure => directory,
+ path => $ng_main_dir,
+ owner => 'root',
+ group => 'root',
+ mode => '0755',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_etc_t,
+ seluser => system_u,
+ }
+
+ # /usr/lib64/nagios dir required for plugins
+ file { $ng_lib_dir:
+ ensure => directory,
+ path => $ng_lib_dir,
+ owner => 'root',
+ group => 'root',
+ mode => '0755',
+ selrange => s0,
+ selrole => object_r,
+ seltype => lib_t,
+ seluser => system_u,
+ }
+
+ # /var/spool/nagios
+ file { $ng_spool_dir:
+ ensure => directory,
+ path => $ng_spool_dir,
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0755',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_spool_t,
+ seluser => system_u,
+ }
+
+ if $fqdn == $ng_nagios_server {
+ # /etc/nagios/conf.d
+ file { $ng_conf_d_dir:
+ ensure => directory,
+ path => $ng_conf_d_dir,
+ owner => 'root',
+ group => $ng_user,
+ mode => '0750',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_etc_t,
+ seluser => system_u,
+ }
+
+ # /etc/nagios/objects
+ file { $ng_objects_dir:
+ ensure => directory,
+ path => $ng_objects_dir,
+ owner => 'root',
+ group => $ng_user,
+ mode => '0750',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_etc_t,
+ seluser => system_u,
+ }
+
+ # /etc/nagios/private
+ file { $ng_private_dir:
+ ensure => directory,
+ path => $ng_private_dir,
+ owner => 'root',
+ group => $ng_user,
+ mode => '0750',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_etc_t,
+ seluser => system_u,
+ }
+
+ # include dir
+ file { $ng_usr_incl:
+ ensure => directory,
+ path => $ng_usr_incl,
+ owner => 'root',
+ group => 'root',
+ mode => '0755',
+ selrange => s0,
+ selrole => object_r,
+ seltype => usr_t,
+ seluser => system_u,
+ }
+
+ # log dir
+ file { $ng_log_dir:
+ ensure => directory,
+ path => $ng_log_dir,
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0750',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_log_t,
+ seluser => system_u,
+ }
+
+ # log archives
+ file { $ng_log_archives:
+ ensure => directory,
+ path => $ng_log_archives,
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0750',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_log_t,
+ seluser => system_u,
+ }
+
+ # /usr/share/nagios
+ file { $ng_usr_share:
+ ensure => directory,
+ path => $ng_usr_share,
+ owner => 'root',
+ group => 'root',
+ mode => '0755',
+ selrange => s0,
+ selrole => object_r,
+ seltype => usr_t,
+ seluser => system_u,
+ }
+
+ # /usr/share/nagios/html
+ file { $ng_share_html:
+ ensure => directory,
+ path => $ng_share_html,
+ owner => 'root',
+ group => 'root',
+ mode => '0755',
+ selrange => s0,
+ selrole => object_r,
+ seltype => usr_t,
+ seluser => system_u,
+ }
+
+ # run dir for pid file
+ file { $ng_run_dir:
+ ensure => directory,
+ path => $ng_run_dir,
+ owner => 'nagios',
+ group => 'nagios',
+ mode => '0750',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_var_run_t,
+ seluser => system_u,
+ }
+
+ # cmd dir
+ file { $ng_cmd_dir:
+ ensure => directory,
+ path => $ng_cmd_dir,
+ owner => 'nagios',
+ group => 'nagios',
+ mode => '0775',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_spool_t,
+ seluser => system_u,
+ }
+
+ # checkresults dir
+ file { $ng_checkresults_dir:
+ ensure => directory,
+ path => $ng_checkresults_dir,
+ owner => 'nagios',
+ group => 'nagios',
+ mode => '0770',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_spool_t,
+ seluser => system_u,
+ }
+ }
+}
+ |
+
confdroid_nagios::main::install.pp Module name: confdroid_nagios Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35+ |
+
+ # File 'manifests/main/install.pp', line 6
+
+class confdroid_nagios::main::install (
+
+) inherits confdroid_nagios::params {
+ require confdroid_resources
+
+ if $ng_nagios_server == $fqdn {
+ # if our FQDN matches the configured Nagios server FQDN, install both server-
+ # and client packages.We'll need httpd installed
+ require confdroid_apache
+
+ package { $ng_reqpackages_server:
+ ensure => $ng_pkg_ensure,
+ }
+ package { $ng_reqpackages_client:
+ ensure => $ng_pkg_ensure,
+ }
+ }
+
+ # if we are not the nagios server, install only client packages
+ if $fqdn != $ng_nagios_server {
+ package { $ng_reqpackages_client:
+ ensure => $ng_pkg_ensure,
+ }
+
+ # if we want to use NRPE on clients, install it
+ if $ng_include_nrpe == true {
+ require confdroid_nrpe
+ }
+ }
+}
+ |
+
confdroid_nagios::main::user.pp Module name: confdroid_nagios Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33+ |
+
+ # File 'manifests/main/user.pp', line 6
+
+class confdroid_nagios::main::user (
+
+) inherits confdroid_nagios::params {
+ require confdroid_nagios::main::install
+
+ if $ng_nagios_server == $fqdn {
+ group { $ng_user:
+ ensure => present,
+ name => $ng_user,
+ gid => $ng_u_uid,
+ allowdupe => false,
+ }
+
+ user { $ng_user:
+ ensure => present,
+ name => $ng_user,
+ allowdupe => false,
+ comment => $ng_u_comment,
+ uid => $ng_u_uid,
+ gid => $ng_u_uid,
+ groups => $ng_u_groups,
+ managehome => true,
+ home => $ng_u_home,
+ shell => $ng_u_shell,
+ require => Group[$ng_user],
+ }
+ }
+}
+ |
+
confdroid_nagios::params.pp Module name: confdroid_nagios Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150+ |
+
+ # File 'manifests/params.pp', line 34
+
+class confdroid_nagios::params (
+
+# main
+ String $ng_nagios_server = 'nagios.example.net',
+ Array $ng_reqpackages_server = ['nagios','nagios-devel'],
+ Array $ng_reqpackages_client = ['net-snmp-utils','nagios-plugins','nagios-plugins-all','nagios-plugins-nrpe','nagios-common'],
+ String $ng_pkg_ensure = 'present',
+ Boolean $ng_include_nrpe = true,
+
+# user
+ String $ng_user = 'nagios',
+ String $ng_u_comment = 'Nagios User',
+ String $ng_u_groups = 'nagios',
+ String $ng_u_shell = '/sbin/nologin',
+ String $ng_u_home = '/home/nagios',
+ Integer $ng_u_uid = 1004,
+
+# nagios_cfg settings
+ String $ng_event_broker_module = '',
+
+# httpd
+ Boolean $ng_use_https = false,
+
+) {
+# Default facts
+ $fqdn = $facts['networking']['fqdn']
+ $domain = $facts['networking']['domain']
+ $os_name = $facts['os']['name']
+ $os_release = $facts['os']['release']['major']
+
+# service
+ $ng_nagios_service = 'nagios'
+
+# directories
+ $ng_main_dir = '/etc/nagios'
+ $ng_conf_d_dir = "${ng_main_dir}/conf.d"
+ $ng_objects_dir = "${ng_main_dir}/objects"
+ $ng_private_dir = "${ng_main_dir}/private"
+ $ng_usr_incl = '/usr/include/nagios'
+ $ng_lib_dir = '/usr/lib64/nagios'
+ $ng_log_dir = '/var/log/nagios'
+ $ng_log_archives = "${ng_log_dir}/archives"
+ $ng_spool_dir = '/var/spool/nagios'
+ $ng_usr_share = '/usr/share/nagios'
+ $ng_share_html = "${ng_usr_share}/html"
+ $ng_run_dir = '/var/run/nagios'
+ $ng_cmd_dir = "${ng_spool_dir}/cmd"
+ $ng_checkresults_dir = "${ng_spool_dir}/checkresults"
+
+# files
+ $ng_nagios_cfg_file = "${ng_main_dir}/nagios.cfg"
+ $ng_nagios_cfg_erb = 'confdroid_nagios/nagios/nagios_cfg.erb'
+
+## old
+ $ng_main_config = "${ng_main_dir}/nagios.cfg"
+ $ng_cgi_cfg_file = "${ng_main_dir}/cgi.cfg"
+ $ng_cgi_cfg_erb = 'confdroid_nagios/nagios/cgi_cfg.erb'
+ $ng_htpasswd_file = "${ng_main_dir}/passwd"
+ $ng_htpasswd_head = 'confdroid_nagios/nagios/htpasswd_head.erb'
+ $ng_htpasswd_rule = 'confdroid_nagios/nagios/htpasswd_rule.erb'
+ $ng_taccgi_erb = 'confdroid_nagios/selinux/taccgi.erb'
+ $ng_statcgi_erb = 'confdroid_nagios/selinux/statuscgi.erb'
+ $ng_statdat_erb = 'confdroid_nagios/selinux/statusdat.erb'
+ $ng_checknrpe_erb = 'confdroid_nagios/selinux/checknrpe.erb'
+ $ng_checknagios_erb = 'confdroid_nagios/selinux/checknagios.erb'
+ $ng_nagios_conf = '/etc/httpd/conf.d/nagios.conf'
+ $ng_nagios_conf_erb = 'confdroid_nagios/httpd/nagios_conf.erb'
+ $ng_welcome_conf = '/etc/httpd/conf.d/welcome.conf'
+ $ng_welcome_conf_erb = 'confdroid_nagios/httpd/welcome_conf.erb'
+ $ng_forward_conf = '/etc/httpd/conf.d/nagios_forward.conf'
+ $ng_forward_conf_erb = 'confdroid_nagios/httpd/forward_conf.erb'
+ $ng_get_cert_erb = 'confdroid_nagios/certbot/get_cert.erb'
+ $ng_unless_get_cert = 'confdroid_nagios/certbot/unless_get_cert.erb'
+ $ng_unless_renew_erb = 'confdroid_nagios/certbot/unless_renew_cert.erb'
+ $ng_index_html_file = '/var/www/html/index.html'
+ $ng_index_html_erb = 'confdroid_nagios/httpd/index_html.erb'
+ $ng_ssl_vhost_file = '/etc/httpd/conf.d/nagios_ssl.conf'
+ $ng_ssl_vhost_erb = 'confdroid_nagios/httpd/nagios_ssl_vhost.erb'
+ $ng_resource_erb = 'confdroid_nagios/nagios/resource_cfg.erb'
+ $ng_grep_erb = 'confdroid_nagios/selinux/grep.erb'
+
+# nagios
+ $ng_target_templates = "${ng_conf_d_dir}/nagios_templates.cfg"
+ $ng_templates_head_erb = 'confdroid_nagios/nagios/templates_cfg_head.erb'
+ $ng_templates_rule_erb = 'confdroid_nagios/nagios/templates_cfg_rule.erb'
+ $ng_tgt_timeperiods_base = "${ng_conf_d_dir}/nagios_timeperiods.cfg"
+ $ng_tgt_timep_add = "${ng_conf_d_dir}/nagios_timeperiods_add.cfg"
+ $ng_tgt_timep_head_erb = 'confdroid_nagios/nagios/timeperiods_cfg_head.erb'
+ $ng_tgt_timep_rule_erb = 'confdroid_nagios/nagios/timeperiods_cfg_rule.erb'
+ $ng_target_localhost = "${ng_conf_d_dir}/nagios_localhost.cfg"
+ $ng_target_host = "${ng_conf_d_dir}/nagios_host.cfg"
+ $ng_target_hostgroup_base = "${ng_conf_d_dir}/nagios_hostgroups_base.cfg"
+ $ng_tgt_hostgroup_add = "${ng_conf_d_dir}/nagios_hostgroups_add.cfg"
+ $ng_tgt_hostgrp_head_erb = 'confdroid_nagios/nagios/hostgroups_cfg_head.erb'
+ $ng_tgt_hostgrp_rule_erb = 'confdroid_nagios/nagios/hostgroups_cfg_rule.erb'
+ $ng_target_hostdep = "${ng_conf_d_dir}/nagios_hostdependency.cfg"
+ $ng_target_hostesc = "${ng_conf_d_dir}/nagios_hostescalation.cfg"
+ $ng_target_hostext = "${ng_conf_d_dir}/nagios_hostextinfo.cfg"
+ $ng_target_service = "${ng_conf_d_dir}/nagios_service.cfg"
+ $ng_target_svcgrp_base = "${ng_conf_d_dir}/nagios_servicegroups_base.cfg"
+ $ng_tgt_servicegroup_add = "${ng_conf_d_dir}/nagios_servicegroups_add.cfg"
+ $ng_tgt_svcgrp_head_erb = 'confdroid_nagios/nagios/svcgroups_cfg_head.erb'
+ $ng_tgt_svcgrp_rule_erb = 'confdroid_nagios/nagios/svcgroups_cfg_rule.erb'
+ $ng_target_base_contact = "${ng_conf_d_dir}/nagios_contact_base.cfg"
+ $ng_target_add_contact = "${ng_conf_d_dir}/nagios_contact_add.cfg"
+ $ng_contacts_head_erb = 'confdroid_nagios/nagios/contacts_cfg_head.erb'
+ $ng_contacts_rule_erb = 'confdroid_nagios/nagios/contacts_cfg_rule.erb'
+ $ng_tgt_contactgroup_base = "${ng_conf_d_dir}/nagios_contactgroup_base.cfg"
+ $ng_tgt_contactgroup_add = "${ng_conf_d_dir}/nagios_contactgroup_add.cfg"
+ $ng_cntctgrps_head_erb = 'confdroid_nagios/nagios/contactgroups_cfg_head.erb'
+ $ng_cntctgrps_rule_erb = 'confdroid_nagios/nagios/contactgroups_cfg_rule.erb'
+ $ng_target_command = "${ng_conf_d_dir}/nagios_commands_base.cfg"
+ $ng_nagios_service_cmd = 'check_nagios!/var/log/nagios/status.dat!5!/usr/sbin/nagios'
+
+# includes must be last
+ include confdroid_nagios::main::config
+}
+ |
+
confdroid_nagios::server::files.pp Module name: confdroid_nagios Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20+ |
+
+ # File 'manifests/server/files.pp', line 6
+
+class confdroid_nagios::server::files (
+
+) inherits confdroid_nagios::params {
+ require confdroid_nagios::main::dirs
+ if $ng_nagios_server == $fqdn {
+ file { $ng_nagios_cfg_file:
+ ensure => file,
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0644',
+ content => template($ng_nagios_cfg_erb),
+ notify => Service[$ng_nagios_service],
+ }
+ }
+}
+ |
+
confdroid_nagios::server::nagios.pp Module name: confdroid_nagios Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10+ |
+
+ # File 'manifests/server/nagios.pp', line 6
+
+class confdroid_nagios::server::nagios (
+
+) inherits confdroid_nagios::params {
+ # config here
+}
+ |
+
confdroid_nagios::server::service.pp Module name: confdroid_nagios Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19+ |
+
+ # File 'manifests/server/service.pp', line 6
+
+class confdroid_nagios::server::service (
+
+) inherits confdroid_nagios::params {
+ require confdroid_nagios::server::files
+ if $ng_nagios_server == $fqdn {
+ service { $ng_nagios_service:
+ ensure => running,
+ name => $ng_nagios_service,
+ enable => true,
+ hasrestart => true,
+ hasstatus => true,
+ }
+ }
+}
+ |
+