Documentation by YARD 0.9.36
-Alphabetic Index
- -Puppet Class Listing A-Z
- - -Defined Type Listing A-Z
- - -
-
-
-
|
-
File Listing
--
-
-
-
- README - - -
From e35b61e131a7b962b3652f607a804f5b1dcb5024 Mon Sep 17 00:00:00 2001 From: 12ww1160 <12ww1160@confdroid.com> Date: Mon, 2 Feb 2026 23:38:50 +0100 Subject: [PATCH] OP#407 initial commit with reset --- .gitignore | 1 + Jenkinsfile | 34 +- README.md | 104 +- doc/_index.html | 302 - doc/css/common.css | 8 - doc/css/full_list.css | 58 - doc/css/style.css | 497 -- doc/file.README.html | 270 - doc/frames.html | 22 - doc/index.html | 270 - doc/js/app.js | 314 -- doc/js/full_list.js | 216 - doc/js/jquery.js | 4 - doc/puppet_class_list.html | 236 - doc/puppet_classes/cd_nagios.html | 121 - .../cd_nagios_3A_3Acertbot_3A_3Acerts.html | 206 - .../cd_nagios_3A_3Aclient_3A_3Atarget.html | 358 -- ...cd_nagios_3A_3Afirewall_3A_3Aiptables.html | 152 - .../cd_nagios_3A_3Amain_3A_3Aconfig.html | 173 - .../cd_nagios_3A_3Amain_3A_3Adirs.html | 526 -- .../cd_nagios_3A_3Amain_3A_3Ainstall.html | 193 - .../cd_nagios_3A_3Amain_3A_3Auser.html | 172 - ...s_3A_3Aobjects_3A_3Aadd_contact_rules.html | 193 - ...Aobjects_3A_3Aadd_contactgroups_rules.html | 189 - ...3A_3Aobjects_3A_3Aadd_hostgroup_rules.html | 188 - ...3Aobjects_3A_3Aadd_servicegroup_rules.html | 188 - ...A_3Aobjects_3A_3Aadd_timeperiod_rules.html | 197 - ...A_3Anagios_3A_3Aobjects_3A_3Acommands.html | 549 -- ..._3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html | 158 - ...agios_3A_3Aobjects_3A_3Acontactgroups.html | 213 - ...A_3Anagios_3A_3Aobjects_3A_3Acontacts.html | 260 - ...3Anagios_3A_3Aobjects_3A_3Ahostgroups.html | 525 -- ...agios_3A_3Aobjects_3A_3Aservicegroups.html | 209 - ...gios_3A_3Aobjects_3A_3Atemplate_rules.html | 279 - ...Anagios_3A_3Aobjects_3A_3Atimeperiods.html | 261 - ...3Anagios_3A_3Aresources_3A_3Aresource.html | 220 - doc/puppet_classes/cd_nagios_3A_3Aparams.html | 4954 ----------------- .../cd_nagios_3A_3Aselinux_3A_3Aconfig.html | 392 -- ..._nagios_3A_3Aserver_3A_3Aaccess_rules.html | 171 - .../cd_nagios_3A_3Aserver_3A_3Afiles.html | 306 - .../cd_nagios_3A_3Aserver_3A_3Aservice.html | 506 -- doc/puppet_defined_type_list.html | 103 - ...Anagios_3A_3Aobjects_3A_3Aadd_contact.html | 261 - ...s_3A_3Aobjects_3A_3Aadd_contactgroups.html | 208 - ...gios_3A_3Aobjects_3A_3Aadd_hostgroups.html | 219 - ...s_3A_3Aobjects_3A_3Aadd_servicegroups.html | 221 - ...ios_3A_3Aobjects_3A_3Aadd_timeperiods.html | 346 -- ..._3Anagios_3A_3Aobjects_3A_3Atemplates.html | 765 --- ...agios_3A_3Aresources_3A_3Aresource_df.html | 227 - .../cd_nagios_3A_3Aserver_3A_3Aaccess.html | 193 - doc/top-level-namespace.html | 98 - manifests/certbot/certs.pp | 48 - manifests/client/target.pp | 124 - manifests/firewall/iptables.pp | 21 - manifests/init.pp | 12 +- manifests/main/config.pp | 32 - manifests/main/dirs.pp | 208 - manifests/main/install.pp | 42 - manifests/main/user.pp | 31 - manifests/nagios/objects/add_contact.pp | 38 - manifests/nagios/objects/add_contact_rules.pp | 40 - manifests/nagios/objects/add_contactgroups.pp | 30 - .../nagios/objects/add_contactgroups_rules.pp | 40 - .../nagios/objects/add_hostgroup_rules.pp | 39 - manifests/nagios/objects/add_hostgroups.pp | 32 - .../nagios/objects/add_servicegroup_rules.pp | 39 - manifests/nagios/objects/add_servicegroups.pp | 35 - .../nagios/objects/add_timeperiod_rules.pp | 45 - manifests/nagios/objects/add_timeperiods.pp | 51 - manifests/nagios/objects/commands.pp | 222 - manifests/nagios/objects/config.pp | 24 - manifests/nagios/objects/contactgroups.pp | 54 - manifests/nagios/objects/contacts.pp | 80 - manifests/nagios/objects/hostgroups.pp | 208 - manifests/nagios/objects/servicegroups.pp | 50 - manifests/nagios/objects/template_rules.pp | 82 - manifests/nagios/objects/templates.pp | 123 - manifests/nagios/objects/timeperiods.pp | 76 - manifests/nagios/resources/resource.pp | 65 - manifests/nagios/resources/resource_df.pp | 28 - manifests/params.pp | 992 +--- manifests/selinux/config.pp | 141 - manifests/server/access.pp | 28 - manifests/server/access_rules.pp | 30 - manifests/server/files.pp | 98 - manifests/server/service.pp | 198 - templates/certbot/get_cert.erb | 1 - templates/certbot/unless_get_cert.erb | 4 - templates/certbot/unless_renew_cert.erb | 7 - templates/httpd/forward_conf.erb | 96 - templates/httpd/index_html.erb | 0 templates/httpd/nagios_ssl_vhost.erb | 126 - templates/nagios/cgi_cfg.erb | 90 - templates/nagios/contactgroups_cfg_head.erb | 6 - templates/nagios/contactgroups_cfg_rule.erb | 6 - templates/nagios/contacts_cfg_head.erb | 8 - templates/nagios/contacts_cfg_rule.erb | 8 - templates/nagios/hostgroups_cfg_head.erb | 5 - templates/nagios/hostgroups_cfg_rule.erb | 6 - templates/nagios/htpasswd_rule.erb | 1 - templates/nagios/nagios_cfg.erb | 214 - templates/nagios/resource_cfg.erb | 5 - templates/nagios/resource_cfg_rule.erb | 3 - templates/nagios/svcgroups_cfg_head.erb | 5 - templates/nagios/svcgroups_cfg_rule.erb | 6 - templates/nagios/templates_cfg_head.erb | 5 - templates/nagios/templates_cfg_rule.erb | 133 - templates/nagios/timeperiods_cfg_head.erb | 5 - templates/nagios/timeperiods_cfg_rule.erb | 12 - templates/selinux/checknagios.erb | 1 - templates/selinux/checknrpe.erb | 1 - templates/selinux/grep.erb | 1 - templates/selinux/statuscgi.erb | 1 - templates/selinux/statusdat.erb | 1 - templates/selinux/taccgi.erb | 1 - 115 files changed, 67 insertions(+), 20933 deletions(-) delete mode 100644 doc/_index.html delete mode 100644 doc/css/common.css delete mode 100644 doc/css/full_list.css delete mode 100644 doc/css/style.css delete mode 100644 doc/file.README.html delete mode 100644 doc/frames.html delete mode 100644 doc/index.html delete mode 100644 doc/js/app.js delete mode 100644 doc/js/full_list.js delete mode 100644 doc/js/jquery.js delete mode 100644 doc/puppet_class_list.html delete mode 100644 doc/puppet_classes/cd_nagios.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Acertbot_3A_3Acerts.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Aclient_3A_3Atarget.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Afirewall_3A_3Aiptables.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Aconfig.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Adirs.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Ainstall.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Auser.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact_rules.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups_rules.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_hostgroup_rules.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_servicegroup_rules.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_timeperiod_rules.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acommands.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontactgroups.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontacts.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Ahostgroups.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aservicegroups.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplate_rules.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atimeperiods.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aresources_3A_3Aresource.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Aparams.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html delete mode 100644 doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html delete mode 100644 doc/puppet_defined_type_list.html delete mode 100644 doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact.html delete mode 100644 doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups.html delete mode 100644 doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_hostgroups.html delete mode 100644 doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_servicegroups.html delete mode 100644 doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_timeperiods.html delete mode 100644 doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplates.html delete mode 100644 doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aresources_3A_3Aresource_df.html delete mode 100644 doc/puppet_defined_types/cd_nagios_3A_3Aserver_3A_3Aaccess.html delete mode 100644 doc/top-level-namespace.html delete mode 100644 manifests/certbot/certs.pp delete mode 100644 manifests/client/target.pp delete mode 100644 manifests/firewall/iptables.pp delete mode 100644 manifests/main/config.pp delete mode 100644 manifests/main/dirs.pp delete mode 100644 manifests/main/install.pp delete mode 100644 manifests/main/user.pp delete mode 100644 manifests/nagios/objects/add_contact.pp delete mode 100644 manifests/nagios/objects/add_contact_rules.pp delete mode 100644 manifests/nagios/objects/add_contactgroups.pp delete mode 100644 manifests/nagios/objects/add_contactgroups_rules.pp delete mode 100644 manifests/nagios/objects/add_hostgroup_rules.pp delete mode 100644 manifests/nagios/objects/add_hostgroups.pp delete mode 100644 manifests/nagios/objects/add_servicegroup_rules.pp delete mode 100644 manifests/nagios/objects/add_servicegroups.pp delete mode 100644 manifests/nagios/objects/add_timeperiod_rules.pp delete mode 100644 manifests/nagios/objects/add_timeperiods.pp delete mode 100644 manifests/nagios/objects/commands.pp delete mode 100644 manifests/nagios/objects/config.pp delete mode 100644 manifests/nagios/objects/contactgroups.pp delete mode 100644 manifests/nagios/objects/contacts.pp delete mode 100644 manifests/nagios/objects/hostgroups.pp delete mode 100644 manifests/nagios/objects/servicegroups.pp delete mode 100644 manifests/nagios/objects/template_rules.pp delete mode 100644 manifests/nagios/objects/templates.pp delete mode 100644 manifests/nagios/objects/timeperiods.pp delete mode 100644 manifests/nagios/resources/resource.pp delete mode 100644 manifests/nagios/resources/resource_df.pp delete mode 100644 manifests/selinux/config.pp delete mode 100644 manifests/server/access.pp delete mode 100644 manifests/server/access_rules.pp delete mode 100644 manifests/server/files.pp delete mode 100644 manifests/server/service.pp delete mode 100644 templates/certbot/get_cert.erb delete mode 100644 templates/certbot/unless_get_cert.erb delete mode 100644 templates/certbot/unless_renew_cert.erb delete mode 100644 templates/httpd/forward_conf.erb delete mode 100644 templates/httpd/index_html.erb delete mode 100644 templates/httpd/nagios_ssl_vhost.erb delete mode 100644 templates/nagios/cgi_cfg.erb delete mode 100644 templates/nagios/contactgroups_cfg_head.erb delete mode 100644 templates/nagios/contactgroups_cfg_rule.erb delete mode 100644 templates/nagios/contacts_cfg_head.erb delete mode 100644 templates/nagios/contacts_cfg_rule.erb delete mode 100644 templates/nagios/hostgroups_cfg_head.erb delete mode 100644 templates/nagios/hostgroups_cfg_rule.erb delete mode 100644 templates/nagios/htpasswd_rule.erb delete mode 100644 templates/nagios/nagios_cfg.erb delete mode 100755 templates/nagios/resource_cfg.erb delete mode 100644 templates/nagios/resource_cfg_rule.erb delete mode 100644 templates/nagios/svcgroups_cfg_head.erb delete mode 100644 templates/nagios/svcgroups_cfg_rule.erb delete mode 100644 templates/nagios/templates_cfg_head.erb delete mode 100644 templates/nagios/templates_cfg_rule.erb delete mode 100644 templates/nagios/timeperiods_cfg_head.erb delete mode 100644 templates/nagios/timeperiods_cfg_rule.erb delete mode 100644 templates/selinux/checknagios.erb delete mode 100644 templates/selinux/checknrpe.erb delete mode 100644 templates/selinux/grep.erb delete mode 100644 templates/selinux/statuscgi.erb delete mode 100644 templates/selinux/statusdat.erb delete mode 100644 templates/selinux/taccgi.erb diff --git a/.gitignore b/.gitignore index a356406..2a1f95d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ Gemfile.lock FileList .scannerwork +.vscode diff --git a/Jenkinsfile b/Jenkinsfile index 1fba99e..ffa4bab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -69,7 +69,7 @@ pipeline { withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) { sh ''' /opt/sonar-scanner/bin/sonar-scanner \ - -Dsonar.projectKey=cd_nagios \ + -Dsonar.projectKey=confdroid_nagios \ -Dsonar.sources=. \ -Dsonar.host.url=https://sonarqube.confdroid.com \ -Dsonar.token=$SONAR_TOKEN @@ -90,16 +90,36 @@ pipeline { sh ''' git config user.name "Jenkins Server" git config user.email jenkins@confdroid.com + git rm -r --cached .vscode || echo "No .vscode to remove from git" git add -A && git commit -am "Recommit for updates in build $BUILD_NUMBER" || echo "No changes to commit" - git push -o merge_request.create \ - -o merge_request.target=master \ - -o merge_request.title="Auto-merge for build $BUILD_NUMBER" \ - -o merge_request.description="Automated changes from Jenkins build $BUILD_NUMBER" \ - -o merge_request.merge_when_pipeline_succeeds=true \ - origin jenkins-build-$BUILD_NUMBER + git push origin HEAD:master ''' } } } + + stage('Mirror to Gitea') { + steps { + withCredentials([usernamePassword( + credentialsId: 'Jenkins-gitea', + usernameVariable: 'GITEA_USER', + passwordVariable: 'GITEA_TOKEN')]) { + script { + // Checkout from GitLab (already done implicitly) + sh ''' + git checkout master + git pull origin master + git branch -D development + git branch -D jenkins-build-$BUILD_NUMBER + git rm -f Jenkinsfile + git rm -r --cached .vscode || echo "No .vscode to remove from git" + git commit --amend --no-edit --allow-empty + git remote add master https://gitea.confdroid.com/confdroid/confdroid_nagios.git + git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ + push master --mirror + ''' + } + } + } } } \ No newline at end of file diff --git a/README.md b/README.md index a132c95..ca941d3 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,27 @@ # Readme -[](https://jenkins.confdroid.com/job/cd_nagios/) -[[_TOC_]] + +- [Readme](#readme) + - [Synopsis](#synopsis) + - [WARNING](#warning) + - [Features](#features) + - [Repo Documentation](#repo-documentation) + - [Dependencies](#dependencies) + - [Deployment](#deployment) + - [PuppetDB](#puppetdb) + - [SELINUX](#selinux) + - [Support](#support) + - [Tests](#tests) + - [Contact Us](#contact-us) + - [Disclaimer](#disclaimer) + ## Synopsis Nagios is a powerful open source software solution for monitoring your IT environments. -`cd_nagios` is a Puppet module allowing to fully automate the setup & configuration of the Nagios server, as well as actively adding client hosts and services to the monitoring environment through defines and `PuppetDB`. +`confdroid_nagios` is a Puppet module allowing to fully automate the setup & configuration of the Nagios server, as well as actively adding client hosts and services to the monitoring environment through defines and `PuppetDB`. ## WARNING @@ -16,54 +29,6 @@ Nagios is a powerful open source software solution for monitoring your IT enviro ## Features -Installation: - -* Nagios Server instance: - * install httpd via cd_apache - * install Nagios server binaries on Nagios server - -* Nagios clients: - * install client binaries like nagios plugins etc. - * include NRPE via `cd_nrpe` (optional) - -Configuration - -* configure all aspects of Nagios on server -* manage nagios service user -* manage directories (filesystem permissions, selinux ) -* manage `cgi.cfg` through parameters -* manage `nagios.cfg` through parameters -* manage Nagios users through external Puppet rules via define -* manage Nagios commands through Puppet exports -* manage Nagios template definitions through external Puppet rules via define -* manage Nagios main contacts through Puppet exports. Additional contacts can be created through external Puppet rules via define, to avoid having to alter the module code. -* manage Nagios main contact groups through Puppet exports. Additional contact groups can be created through external Puppet rules via define, to avoid having to alter the module code. -* manage Nagios main host groups through Puppet exports. Additional host groups can be created through external Puppet rules via define, to avoid having to alter the module code. -* manage Nagios main service groups through Puppet exports. Additional service groups can be created through external Puppet rules via define, to avoid having to alter the module code. -* manage Nagios main time periods through Puppet exports. Additional time periods can be created through external Puppet rules via define, to avoid having to alter the module code. -* configure firewall (optional) -* configure selinux policies (optional) -* configure forwarding http to https (optional) -* manage TLS certificates through certbot (optional) -* manage `$user$` arguments in resource file via define - -Service - -* manage Nagios service on server - -Monitoring - -* monitor Nagios host -* monitor Nagios service -* monitor clients: - * ping - * root partition - * swap usage - * logged-in local users - * amount of total processes - * amount of zombie processes - * current Load - ## Repo Documentation See the full Puppet documentation including parameters in `docs/index.html` @@ -72,14 +37,7 @@ See the full Puppet documentation including parameters in `docs/index.html` All dependencies must be included in the catalogue. -* [cd_resources](https://gitlab.confdroid.com/puppet/cd_resources) for Yum repos. -* [cd_apache](https://gitlab.confdroid.com/puppet/cd_apache) for installing httpd -* [cd_firewall](https://gitlab.confdroid.com/puppet/cd_firewall) or [puppetlabs firewall](https://github.com/puppetlabs/puppetlabs-firewall) (optional) -* [cd_selinux](https://gitlab.confdroid.com/puppet/cd_selinux) for selinux policy adjustments -* [cd_certbot](https://gitlab.confdroid.com/puppet/cd_certbot) to auto-manage TLS certificates (optional) -* [cd_nrpe](https://gitlab.confdroid.com/puppet/cd_nrpe) to manage NRPE (optional) -* [cd_stdlib](https://gitlab.confdroid.com/puppet/cd_stdlib) or [puppetlabs stdlib](https://github.com/puppetlabs/puppetlabs-stdlib) to facilitate concat -* [cd_concat](https://gitlab.confdroid.com/puppet/cd_stdlib) or [puppetlabs concat](https://github.com/puppetlabs/puppetlabs-concat) to concatenate configuration files from different sources. + ## Deployment @@ -89,13 +47,13 @@ via site.pp or nodes.pp ```ruby node 'example.example.net' { - include cd_nagios + include confdroid_nagios } ``` * through Foreman: -In order to apply parameters through Foreman, **__cd_nagios::params__** must be added to the host or host group in question. +In order to apply parameters through Foreman, **__confdroid_nagios::params__** must be added to the host or host group in question. See [more details about class deployment on Confdroid.com](https://confdroid.com/2017/05/deploying-our-puppet-modules/). @@ -107,29 +65,10 @@ A working instance of PuppetDB connected to the Puppet master is required for th All files and directories are configured with correct selinux context. If selinux is disabled, these contexts are ignored. -## Certbot - -This module can optionally setup [certbot](https://certbot.eff.org/) TLS certificate management for the front-end GUI. In order to do so, set `$ng_enable_certbot` as well as `$ng_use_https` to `true` (default). Effectively, this will manage the certs before even installing Nagios, so there will be no problems with the Nagios showing up with a self-signed certificate. Once enabled, the module will go and try to obtain a certificate automatically. For this to work, you need to have proper DNS resolution set up for your domain / nagios server. Certs are also automatically renewed. - -If you prefer to use https but use self-signed certs or your own CA, simply set to false. This will point the SSL vhost config file to the default location for TLS certificates. - -## httpd vHost files - -by default, Nagios creates its own `nagios.conf` file, which is not a vhost file and relies on the main `ssl.conf`. However, as Nagios might be running on a regular web server with various other web instances (not recommended through for performance reasons), we do not want to manage `ssl.conf` directly, hence the module creates a vhost for the SSL host. - -## Client Connections - -In order to monitor clients, NAGIOS must be able to connect to them. There are multiple ways of doing so, the most common ones being NRPE and SSH. -So far this module works through the usage of NRPE, which by default is enabled. Class cd_nagios::client::nrpe configures `nrpe.cfg` and opens the required firewall port on clients (optional,default). - -## Known Problems - -* Collected resources import ordering problem: The module might try to import collected facts before nagios is even installed. - ## Support -* OS: CentOS 7 -* Puppet 5 +* OS: Rocky 9 +* Puppet 8 ## Tests @@ -143,6 +82,7 @@ So far this module works through the usage of NRPE, which by default is enabled. ## Contact Us [contact Us](https://confdroid.com/contact/) +[Feedback portal](https://feedback.confdroid.com/) ## Disclaimer diff --git a/doc/_index.html b/doc/_index.html deleted file mode 100644 index 2c5efde..0000000 --- a/doc/_index.html +++ /dev/null @@ -1,302 +0,0 @@ - - -
- - -
-
-
-
|
-
| t |
- - - -6 -7 -8- |
-
- # File 'manifests/init.pp', line 6
-
-class cd_nagios {
- include cd_nagios::params
-}
- |
-
cd_nagios::certbot::certs.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@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- |
-
- # File 'manifests/certbot/certs.pp', line 6
-
-class cd_nagios::certbot::certs (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- if $ng_use_https == true {
- if $ng_enable_certbot == true {
- require cd_certbot
- require cd_apache
-
- if $ng_include_fw == true {
- require cd_nagios::firewall::iptables
- }
-
- # create cert
-
- exec { 'create_cert':
- command => template($ng_get_cert_erb),
- cwd => '/tmp',
- path => ['/bin','/usr/bin'],
- provider => 'shell',
- unless => template('cd_nagios/certbot/unless_get_cert.erb'),
- notify => Service['httpd'],
- creates => $ng_certbot_check,
- }
-
- # renew certs
-
- exec { 'renew_cert':
- command => 'certbot renew',
- cwd => '/tmp',
- path => ['/bin','/usr/bin','/opt/'],
- provider => 'shell',
- notify => Service['httpd'],
- unless => template($ng_unless_renew_erb),
- }
- }
- }
-
- else {
- # do nothing as we are not using https and certbot is not required then
- }
- }
-}
- |
-
cd_nagios::client::target.pp Module name: nagios Author: Arne Teuke (arne_teuke@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- |
-
- # File 'manifests/client/target.pp', line 6
-
-class cd_nagios::client::target (
-
-) inherits cd_nagios::params {
- if $::fqdn != $ng_nagios_server {
- if $ng_include_nrpe == true {
- require cd_nagios::main::user
- require cd_nrpe
-
- @@nagios_host { $::fqdn:
- ensure => $ng_ping_ensure,
- alias => $::hostname,
- address => $::fqdn,
- use => 'linux-server',
- target => $ng_target_host,
- hostgroups => 'linux-servers',
- contacts => 'ops',
- max_check_attempts => $ng_max_check_attempts,
- notification_period => '24x7',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- check_command => "check_ping!${ng_ping_warn}!${ng_ping_crit}",
- notify => Service[$ng_user],
- }
-
- @@nagios_service { "root_partition_${::hostname}":
- ensure => $ng_disk_ensure,
- check_command => "check_nrpe!check_disk!${ng_disk_warn}!${ng_disk_crit}!/",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_root_partition",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
-
- if $ng_enable_swap_check == true {
- @@nagios_service { "Swap_Usage_${::hostname}":
- ensure => $ng_swap_ensure,
- check_command => "check_nrpe!check_swap!${ng_swap_warn}!${ng_swap_crit}",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_swap_usage",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
- }
-
- @@nagios_service { "Local_Users_${::hostname}":
- ensure => $ng_users_ensure,
- check_command => "check_nrpe!check_users!${ng_users_warn}!${ng_users_crit}",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_local_users",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
-
- @@nagios_service { "Total Processes_${::hostname}":
- ensure => $ng_procs_tot_ens,
- check_command => "check_nrpe!check_procs!${ng_procs_tot_warn}!${ng_procs_tot_crit}!${ng_procs_tot_param}",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_total_processes",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
-
- @@nagios_service { "Zombie Processes_${::hostname}":
- ensure => $ng_procs_z_ensure,
- check_command => "check_nrpe!check_procs!${ng_procs_z_warn}!${ng_procs_z_crit}!${ng_procs_z_param}",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_zombie_processes",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
-
- @@nagios_service { "Current_Load_${::hostname}":
- ensure => $ng_load_ensure,
- check_command => "check_nrpe!check_load!${ng_load_warn}!${ng_load_crit}",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_current_load",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
- }
- }
-}
- |
-
cd_nagios::firewall::iptables.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21- |
-
- # File 'manifests/firewall/iptables.pp', line 6
-
-class cd_nagios::firewall::iptables (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- if $ng_use_https != true {
- include confdroid_infrastructure::firewall::http
-
- if $ng_use_https == true {
- include confdroid_infrastructure::firewall::https
- if $ng_http_https_fw == true {
- include confdroid_infrastructure::firewall::http
- }
- }
- }
- }
-}
- |
-
cd_nagios::main::config.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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- |
-
- # File 'manifests/main/config.pp', line 7
-
-class cd_nagios::main::config (
-
-) inherits cd_nagios::params {
- # manage server configuration
-
- if $::fqdn == $ng_nagios_server {
- include cd_nagios::server::service
-
- if $ng_include_fw == true {
- include cd_nagios::firewall::iptables
- }
-
- if $ng_use_selinux_tools == true {
- include cd_nagios::selinux::config
- }
-
- if $ng_enable_certbot == true {
- require cd_nagios::certbot::certs
- }
- }
-
- if $::fqdn != $ng_nagios_server {
- include cd_nagios::client::target
- }
-
-}
- |
-
cd_nagios::main::dirs.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@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 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208- |
-
- # File 'manifests/main/dirs.pp', line 6
-
-class cd_nagios::main::dirs (
-
-) inherits cd_nagios::params {
- require cd_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,
- }
- }
-}
- |
-
cd_nagios::main::install.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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- |
-
- # File 'manifests/main/install.pp', line 7
-
-class cd_nagios::main::install (
-
-) inherits cd_nagios::params {
-
- require cd_resources
-
- # if our FQDN matches the configured Nagios server FQDN, install both server-
- # and client packages.
-
- if $::fqdn == $ng_nagios_server {
-
- # we'll need httpd installed
- require cd_apache
-
- package {$reqpackages_server:
- ensure => $pkg_ensure,
- }
- package {$reqpackages_client:
- ensure => $pkg_ensure,
- }
- }
-
- # if we are not the nagios server, install client packages
-
- if $::fqdn != $ng_nagios_server {
- package {$reqpackages_client:
- ensure => $pkg_ensure,
- }
-
- # if we want to use NRPE, install it
-
- if $ng_include_nrpe == true {
- require cd_nrpe
- }
- }
-}
- |
-
cd_nagios::main::user.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@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- |
-
- # File 'manifests/main/user.pp', line 6
-
-class cd_nagios::main::user (
-
-) inherits cd_nagios::params {
- require cd_nagios::main::install
-
- 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_user,
- groups => $ng_u_groups,
- managehome => true,
- home => $ng_user_home,
- shell => $ng_user_shell,
- require => Group[$ng_user],
- }
-}
- |
-
cd_nagios::nagios::objects::add_contact_rules.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/add_contact_rules.pp', line 13
-
-class cd_nagios::nagios::objects::add_contact_rules (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- # manage /etc/nagios/conf.d/nagios_add_contacts.cfg
-
- concat { $ng_target_add_contact:
- ensure => present,
- path => $ng_target_add_contact,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- selrange => s0,
- selrole => object_r,
- seltype => nagios_etc_t,
- seluser => system_u,
- notify => Service[$ng_service],
- }
-
- # manage file header
-
- concat::fragment { 'contact_header':
- target => $ng_target_add_contact,
- content => template($ng_contacts_head_erb),
- order => '000',
- }
- }
-}
- |
-
cd_nagios::nagios::objects::add_contactgroups_rules.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/add_contactgroups_rules.pp', line 13
-
-class cd_nagios::nagios::objects::add_contactgroups_rules (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- # manage /etc/nagios/conf.d/nagios_add_contactgroups.cfg
-
- concat { $ng_tgt_contactgroup_add:
- ensure => present,
- path => $ng_tgt_contactgroup_add,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- selrange => s0,
- selrole => object_r,
- seltype => nagios_etc_t,
- seluser => system_u,
- notify => Service[$ng_service],
- }
-
- # manage file header
-
- concat::fragment { 'contactgroups_header':
- target => $ng_tgt_contactgroup_add,
- content => template($ng_cntctgrps_head_erb),
- order => '000',
- }
- }
-}
- |
-
cd_nagios::nagios::objects::add_hostgroup_rules.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/add_hostgroup_rules.pp', line 12
-
-class cd_nagios::nagios::objects::add_hostgroup_rules (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- # manage /etc/nagios_conf.d/nagios_hostgroups_add.cfg
-
- concat { $ng_tgt_hostgroup_add:
- ensure => present,
- path => $ng_tgt_hostgroup_add,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- selrange => s0,
- selrole => object_r,
- seltype => nagios_etc_t,
- seluser => system_u,
- notify => Service[$ng_service],
- }
-
- # manage file header
-
- concat::fragment { 'hostgroups_header':
- target => $ng_tgt_hostgroup_add,
- content => template($ng_tgt_hostgrp_head_erb),
- order => '000',
- }
- }
-}
- |
-
cd_nagios::nagios::objects::add_servicegroup_rules.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/add_servicegroup_rules.pp', line 12
-
-class cd_nagios::nagios::objects::add_servicegroup_rules (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- # manage /etc/nagios_conf.d/nagios_servicegroups_add.cfg
-
- concat { $ng_tgt_servicegroup_add:
- ensure => present,
- path => $ng_tgt_servicegroup_add,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- selrange => s0,
- selrole => object_r,
- seltype => nagios_etc_t,
- seluser => system_u,
- notify => Service[$ng_service],
- }
-
- # manage file header
-
- concat::fragment { 'servicegroups_header':
- target => $ng_tgt_servicegroup_add,
- content => template($ng_tgt_svcgrp_head_erb),
- order => '000',
- }
- }
-}
- |
-
cd_nagios::nagios::objects::add_timeperiod_rules.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com) }
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/add_timeperiod_rules.pp', line 18
-
-class cd_nagios::nagios::objects::add_timeperiod_rules (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- # manage /etc/nagios/conf.d/nagios_timeperiods_add.cfg
-
- concat { $ng_tgt_timep_add:
- ensure => present,
- path => $ng_tgt_timep_add,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- selrange => s0,
- selrole => object_r,
- seltype => nagios_etc_t,
- seluser => system_u,
- notify => Service[$ng_service],
- }
-
- # manage file header
-
- concat::fragment { 'timeperiods_header':
- target => $ng_tgt_timep_add,
- content => template($ng_tgt_timep_head_erb),
- order => '000',
- }
- }
-}
- |
-
- - - -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 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222- |
-
- # File 'manifests/nagios/objects/commands.pp', line 8
-
-class cd_nagios::nagios::objects::commands (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- @@nagios_command { 'notify-host-by-email':
- ensure => present,
- command_name => 'notify-host-by-email',
- command_line => '/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTADDRESS$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTADDRESS$ is $HOSTSTATE$ **" $CONTACTEMAIL$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'notify-service-by-email':
- ensure => present,
- command_name => 'notify-service-by-email',
- command_line => '/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check-host-alive':
- ensure => present,
- command_name => 'check-host-alive',
- command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_disk':
- ensure => present,
- command_name => 'check_disk',
- command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_local_load':
- ensure => present,
- command_name => 'check_local_load',
- command_line => '$USER1$/check_load -w $ARG1$ -c $ARG2$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_local_procs':
- ensure => present,
- command_name => 'check_local_procs',
- command_line => '$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_local_users':
- ensure => present,
- command_name => 'check_local_users',
- command_line => '$USER1$/check_users -w $ARG1$ -c $ARG2$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_local_swap':
- ensure => present,
- command_name => 'check_local_swap',
- command_line => '$USER1$/check_swap -w $ARG1$ -c $ARG2$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_ftp':
- ensure => present,
- command_name => 'check_ftp',
- command_line => '$USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_snmp':
- ensure => present,
- command_name => 'check_snmp',
- command_line => '$USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_http':
- ensure => present,
- command_name => 'check_http',
- command_line => '$USER1$/check_http -I $HOSTADDRESS$ $ARG1$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_ssh':
- ensure => present,
- command_name => 'check_ssh',
- command_line => '$USER1$/check_ssh $ARG1$ $HOSTADDRESS$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_ping':
- ensure => present,
- command_name => 'check_ping',
- command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_tcp':
- ensure => present,
- command_name => 'check_tcp',
- command_line => '$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_udp':
- ensure => present,
- command_name => 'check_udp',
- command_line => '$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_nrpe':
- ensure => present,
- command_name => 'check_nrpe',
- command_line => '$USER1$/check_nrpe -t 30 -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_nagios':
- ensure => present,
- command_name => 'check_nagios',
- command_line => '$USER1$/check_nagios -F $ARG1$ -e $ARG2$ -C $ARG3$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_bandwidth':
- ensure => present,
- command_name => 'check_bandwidth',
- command_line => '$USER1$/check_bandwidth.sh -t 30 -H $HOSTADDRESS$ linux $ARG1$ $ARG2$ $ARG3$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'process-service-perfdata-file':
- ensure => present,
- command_name => 'process-service-perfdata-file',
- command_line => '/bin/mv /var/log/pnp4nagios/service-perfdata /var/spool/pnp4nagios/service-perfdata.$TIMET$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'process-host-perfdata-file':
- ensure => present,
- command_name => 'process-host-perfdata-file',
- command_line => '/bin/mv /var/log/pnp4nagios/host-perfdata /var/spool/pnp4nagios/host-perfdata.$TIMET$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
-
- @@nagios_command { 'check_ntp_time':
- ensure => present,
- command_name => 'check_ntp_time',
- command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$',
- owner => 'nagios',
- group => 'nagios',
- mode => '0640',
- target => $ng_target_command,
- }
- }
-}
- |
-
cd_nagios::server::nagios::objects::config.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24- |
-
- # File 'manifests/nagios/objects/config.pp', line 6
-
-class cd_nagios::nagios::objects::config (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- require cd_nagios::nagios::objects::commands
- require cd_nagios::nagios::objects::template_rules
- require cd_nagios::nagios::objects::contacts
- require cd_nagios::nagios::objects::add_contact_rules
- require cd_nagios::nagios::objects::contactgroups
- require cd_nagios::nagios::objects::add_contactgroups_rules
- require cd_nagios::nagios::objects::hostgroups
- require cd_nagios::nagios::objects::add_hostgroup_rules
- require cd_nagios::nagios::objects::servicegroups
- require cd_nagios::nagios::objects::add_servicegroup_rules
- require cd_nagios::nagios::objects::timeperiods
- require cd_nagios::nagios::objects::add_timeperiod_rules
-
- }
-}
- |
-
cd_nagios::nagios::objects::contactgroups.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/contactgroups.pp', line 17
-
-class cd_nagios::nagios::objects::contactgroups (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- @@nagios_contactgroup { 'admins':
- ensure => present,
- alias => 'Nagios Administrators',
- contactgroup_name => 'admins',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_tgt_contactgroup_base,
- }
-
- @@nagios_contactgroup { 'operations':
- ensure => present,
- alias => 'Operations Team',
- contactgroup_name => 'operations',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_tgt_contactgroup_base,
- }
-
- @@nagios_contactgroup { 'support':
- ensure => present,
- alias => 'Support Team',
- contactgroup_name => 'support',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_tgt_contactgroup_base,
- }
- }
-}
- |
-
cd_nagios::nagios::objects::contacts.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/contacts.pp', line 22
-
-class cd_nagios::nagios::objects::contacts (
-
-
-) inherits cd_nagios::params {
-
- if $::fqdn == $ng_nagios_server {
-
- # admin contact
-
- @@nagios_contact { 'admin':
- ensure => present,
- alias => 'Nagios Admin',
- contact_name => 'admin',
- contactgroups => 'admins',
- email => "admin@${::domain}",
- can_submit_commands => '1',
- register => '1',
- use => 'generic-contact',
- target => $ng_target_base_contact,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
-
- # ops contact
-
- @@nagios_contact { 'ops':
- ensure => present,
- alias => 'Operations',
- contact_name => 'ops',
- contactgroups => 'operations',
- email => "ops@${::domain}",
- can_submit_commands => '1',
- register => '1',
- use => 'generic-contact',
- target => $ng_target_base_contact,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
-
- # support contact
-
- @@nagios_contact { 'support':
- ensure => present,
- alias => 'support',
- contact_name => 'support',
- contactgroups => 'support',
- email => "support@${::domain}",
- can_submit_commands => '1',
- register => '1',
- use => 'generic-contact',
- target => $ng_target_base_contact,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
- }
-}
- |
-
cd_nagios::nagios::objects::hostgroups.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208- |
-
- # File 'manifests/nagios/objects/hostgroups.pp', line 7
-
-class cd_nagios::nagios::objects::hostgroups (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- # linux servers
-
- @@nagios_hostgroup { 'linux-servers':
- ensure => present,
- hostgroup_name => 'linux-servers',
- alias => 'Linux Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
-
- # RHEL servers
-
- @@nagios_hostgroup { 'rhel-servers':
- ensure => present,
- hostgroup_name => 'rhel-servers',
- alias => 'RHEL Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # CentOS servers
-
- @@nagios_hostgroup { 'centos-servers':
- ensure => present,
- hostgroup_name => 'centos-servers',
- alias => 'CentOS Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # SuSE servers
-
- @@nagios_hostgroup { 'suse-servers':
- ensure => present,
- hostgroup_name => 'suse-servers',
- alias => 'SuSE Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # Unix servers
-
- @@nagios_hostgroup { 'unix-servers':
- ensure => present,
- hostgroup_name => 'unix-servers',
- alias => 'Unix Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # Solaris servers
-
- @@nagios_hostgroup { 'solaris-servers':
- ensure => present,
- hostgroup_name => 'solaris-servers',
- alias => 'Solaris Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # AIX servers
-
- @@nagios_hostgroup { 'aix-servers':
- ensure => present,
- hostgroup_name => 'aix-servers',
- alias => 'AIX Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # Windows servers
-
- @@nagios_hostgroup { 'windows-servers':
- ensure => present,
- hostgroup_name => 'windows-servers',
- alias => 'Windows Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # Netware servers
-
- @@nagios_hostgroup { 'netware-servers':
- ensure => present,
- hostgroup_name => 'netware-servers',
- alias => 'Netware Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # DB servers
-
- @@nagios_hostgroup { 'db-servers':
- ensure => present,
- hostgroup_name => 'db-servers',
- alias => 'DB Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # Oracle servers
-
- @@nagios_hostgroup { 'oracle-servers':
- ensure => present,
- hostgroup_name => 'oracle-servers',
- alias => 'Oracle Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # MySQL servers
-
- @@nagios_hostgroup { 'mysql-servers':
- ensure => present,
- hostgroup_name => 'mysql-servers',
- alias => 'MySQL Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # MSSQL servers
-
- @@nagios_hostgroup { 'mssql-servers':
- ensure => present,
- hostgroup_name => 'mssql-servers',
- alias => 'MSSQL Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # NOSQL servers
-
- @@nagios_hostgroup { 'nosql-servers':
- ensure => present,
- hostgroup_name => 'nosql-servers',
- alias => 'NOSQL Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- # Hadoop servers
-
- @@nagios_hostgroup { 'hadoop-servers':
- ensure => present,
- hostgroup_name => 'hadoop-servers',
- alias => 'HADOOP Servers',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_hostgroup_base,
- }
-
- }
-}
- |
-
cd_nagios::nagios::objects::servicegroups.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/servicegroups.pp', line 7
-
-class cd_nagios::nagios::objects::servicegroups (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- # network services
-
- @@nagios_servicegroup { 'network-services':
- ensure => present,
- servicegroup_name => 'network-services',
- alias => 'Network Services',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_svcgrp_base,
- }
-
- # linux services
-
- @@nagios_servicegroup { 'linux-services':
- ensure => present,
- servicegroup_name => 'linux-services',
- alias => 'Linux Services',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_svcgrp_base,
- }
-
- # database services
-
- @@nagios_servicegroup { 'database-services':
- ensure => present,
- servicegroup_name => 'database-services',
- alias => 'Database Services',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_target_svcgrp_base,
- }
- }
-}
- |
-
cd_nagios::nagios::objects::template_rules.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/template_rules.pp', line 11
-
-class cd_nagios::nagios::objects::template_rules (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- # create the templates.cfg file
-
- concat { $ng_target_templates:
- ensure => present,
- path => $ng_target_templates,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- selrange => s0,
- selrole => object_r,
- seltype => nagios_etc_t,
- seluser => system_u,
- notify => Service[$ng_service],
- }
-
- concat::fragment { 'template_header':
- target => $ng_target_templates,
- content => template($ng_templates_head_erb),
- order => '000',
- }
-
- # basic templates
- cd_nagios::nagios::objects::templates { 'generic contact':
- ng_template_object => 'contact',
- ng_template_object_name => 'generic-contact',
- }
- cd_nagios::nagios::objects::templates { 'generic-host':
- ng_template_object => 'host',
- ng_template_object_name => 'generic-host',
- }
- cd_nagios::nagios::objects::templates { 'linux-server':
- ng_template_object => 'host',
- ng_template_object_name => 'linux-server',
- ng_template_object_use => 'generic-host',
- ng_notification_options => 'd,u,r',
- }
- cd_nagios::nagios::objects::templates { 'windows-server':
- ng_template_object => 'host',
- ng_template_object_name => 'windows-server',
- ng_template_object_use => 'generic-host',
- ng_notification_options => 'd,u,r',
- }
- cd_nagios::nagios::objects::templates { 'generic-switch':
- ng_template_object => 'host',
- ng_template_object_name => 'generic-switch',
- ng_template_object_use => 'generic-host',
- ng_notification_options => 'd,u,r',
- }
- cd_nagios::nagios::objects::templates { 'generic-printer':
- ng_template_object => 'host',
- ng_template_object_name => 'generic-printer',
- ng_template_object_use => 'generic-host',
- ng_notification_options => 'd,u,r',
- }
- cd_nagios::nagios::objects::templates { 'generic-service':
- ng_template_object => 'service',
- ng_template_object_name => 'generic-service',
- ng_max_check_attempts => '3',
- ng_notification_options => 'w,u,c,r',
- }
- cd_nagios::nagios::objects::templates { 'local-service':
- ng_template_object => 'service',
- ng_template_object_name => 'local-service',
- ng_max_check_attempts => '4',
- ng_template_object_use => 'generic-service',
- }
- }
-}
- |
-
cd_nagios::nagios::objects::timeperiods.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/timeperiods.pp', line 7
-
-class cd_nagios::nagios::objects::timeperiods (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- @@nagios_timeperiod { '24x7':
- ensure => present,
- timeperiod_name => '24x7',
- alias => '24 Hours A Day, 7 Days A Week',
- monday => '00:00-24:00',
- tuesday => '00:00-24:00',
- wednesday => '00:00-24:00',
- thursday => '00:00-24:00',
- friday => '00:00-24:00',
- saturday => '00:00-24:00',
- sunday => '00:00-24:00',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_tgt_timeperiods_base,
- }
-
- @@nagios_timeperiod { 'office_hours':
- ensure => present,
- timeperiod_name => 'office_hours',
- alias => 'Office hours only, 5 Days A Week 09-05',
- monday => '09:00-17:00',
- tuesday => '09:00-17:00',
- wednesday => '09:00-17:00',
- thursday => '09:00-17:00',
- friday => '09:00-17:00',
- saturday => '00:00-00:00',
- sunday => '00:00-00:00',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_tgt_timeperiods_base,
- }
-
- @@nagios_timeperiod { 'out_of_hours':
- ensure => present,
- timeperiod_name => 'out_of_hours',
- alias => 'Outside Office hours only',
- monday => '17:00-09:00',
- tuesday => '17:00-09:00',
- wednesday => '17:00-09:00',
- thursday => '17:00-09:00',
- friday => '17:00-09:00',
- saturday => '00:00-24:00',
- sunday => '00:00-24:00',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_tgt_timeperiods_base,
- }
-
- @@nagios_timeperiod { 'none':
- ensure => present,
- timeperiod_name => 'none',
- alias => 'No Time Is A Good Time',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- register => '1',
- target => $ng_tgt_timeperiods_base,
- }
- }
-}
- |
-
cd_nagios::nagios::resources::resource.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios Copyright © 2016 ConfDroid (copyright@ConfDroid.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- -You should have received a copy of the GNU General Public License along with this program. If not, see www.gnu.org/licenses/. }
- -
- - - -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- |
-
- # File 'manifests/nagios/resources/resource.pp', line 28
-
-class cd_nagios::nagios::resources::resource (
-
-) inherits cd_nagios::params {
- if $fqdn == $ng_nagios_server {
- concat { $ng_resource_file:
- ensure => present,
- owner => 'root',
- group => $ng_user,
- mode => '0640',
- selrange => s0,
- selrole => object_r,
- seltype => nagios_etc_t,
- seluser => system_u,
- notify => Service[$ng_service],
- }
-
- concat::fragment { 'header':
- target => $ng_resource_file,
- content => template($ng_resource_erb),
- order => '000',
- }
-
- # plugins rule
-
- cd_nagios::nagios::resources::resource_df { 'user_rule_plugins':
- ng_user_arg_name => 'USER1',
- ng_user_arg_value => '/usr/lib64/nagios/plugins/',
- ng_user_arg_comment => 'Sets user1 to be the path to the plugins',
- }
-
- # eventhandlers rule
- cd_nagios::nagios::resources::resource_df { 'user_rule_eventhandlers':
- ng_user_arg_name => 'USER2',
- ng_user_arg_value => '/usr/lib64/nagios/plugins/eventhandlers/',
- ng_user_arg_comment => 'Sets user2 to be the path to the eventhandlers',
- }
- }
-}
- |
-
cd_nagios::params.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com) to connect to NRPE, which as of now does not trust DNS names. Must be the public interface in case of NAT environments. can issue host related commands. can issue service related commands.
- -
- - - -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988- |
-
- # File 'manifests/params.pp', line 638
-
-class cd_nagios::params (
-
- String $pkg_ensure = 'latest',
-
- String $ng_nagios_server = "nagios.${::domain}",
- String $ng_nagios_ext_ip = undef,
- String $ng_mail_user = "admin@${::domain}",
- String $ng_page_user = "pageadmin@${::domain}",
-
- Boolean $ng_include_nrpe = true,
-
-# firewall
- Boolean $ng_include_fw = true,
- Boolean $ng_use_https = true,
- Boolean $ng_http_https_fw = true,
- String $ng_fw_order = '50',
- String $ng_http_port = '80',
- String $ng_https_port = '443',
- String $ng_nrpe_port = '5666',
-
-# check command parameters
-## ping
- String $ng_ping_warn = '100.0,20%',
- String $ng_ping_crit = '500.0,60%',
- String $ng_ping_ensure = 'present',
-## disk
- String $ng_disk_warn = '20%',
- String $ng_disk_crit = '10%' ,
- String $ng_disk_ensure = 'present',
-# swap
- String $ng_swap_warn = '20',
- String $ng_swap_crit = '10',
- String $ng_swap_ensure = 'present',
-# users
- String $ng_users_warn = '20',
- String $ng_users_crit = '50',
- String $ng_users_ensure = 'present',
-#total procs
- String $ng_procs_tot_warn = '330',
- String $ng_procs_tot_crit = '400',
- String $ng_procs_tot_param = 'RDST',
- String $ng_procs_tot_ens = 'present',
-# zombie procs
- String $ng_procs_z_warn = '10',
- String $ng_procs_z_crit = '30',
- String $ng_procs_z_param = 'Z',
- String $ng_procs_z_ensure = 'present',
-# load
- String $ng_load_warn = '5.00,4.00,3.00',
- String $ng_load_crit = '10.00,6.00,4.00',
- String $ng_load_ensure = 'present',
-
-# user settings
- String $ng_user = 'nagios',
- String $ng_u_comment = 'Nagios service user',
- String $ng_u_uid = '1004',
- String $ng_user_home = '/var/spool/nagios',
- Optional[String] $ng_u_groups = undef,
- String $ng_user_shell = '/bin/bash',
-
-# cgi settings
- String $ng_context_help = '1',
- String $ng_pending_state = '1',
- String $ng_use_auth = '1',
- String $ng_use_ssl_auth = '0',
- Boolean $ng_enable_def_user = false,
- String $ng_def_user_name = 'nagios_insecure',
- String $ng_nagios_admin = 'nagios_sec_adm',
- String $ng_sysinfo_auth = '',
- String $ng_confinfo_auth = '',
- String $ng_command_auth = '',
- String $ng_hostview_auth = '',
- String $ng_serviceview_auth = '',
- String $ng_host_cmd_auth = '',
- String $ng_svc_cmd_auth = '',
- String $ng_readonly_auth = '' ,
- String $ng_statusmap_img = 'smbackground.gd2',
- Boolean $ng_use_colormap = false,
- String $ng_colormap_red = '255',
- String $ng_colormap_green = '255',
- String $ng_colormap_blue = '255',
- String $ng_statusmap_layout = '6',
- String $ng_wrl_layout = '4',
- Boolean $ng_incl_own_wrl = false,
- String $ng_statuswrl_include = '',
- String $ng_ping_syntax = '/bin/ping -n -U -c 5 $HOSTADDRESS$',
- String $ng_refresh_rate = '90',
- String $ng_result_limit = '100',
- String $ng_escape_html = '1',
- Boolean $ng_use_sound = false,
- String $ng_host_unreachable = 'hostdown.wav',
- String $ng_host_down = 'hostdown.wav',
- String $ng_svc_critical = 'critical.wav',
- String $ng_svc_warn = 'warning.wav',
- String $ng_svc_unknown = 'warning.wav',
- String $ng_normal_sound = 'noproblem.wav',
- String $ng_action_url_target = '_blank',
- String $ng_notes_url_target = '_blank',
- String $ng_lock_author_names = '1',
- Boolean $ng_enable_splunk = false,
- String $ng_splunk_url = 'http://127.0.0.1:8000/',
- String $ng_navbar_addresses = '1',
- String $ng_navbar_aliases = '1',
- String $ng_ack_no_sticky = '0',
- String $ng_ack_no_send = '0',
-
-# selinux
- Boolean $ng_use_selinux_tools = true,
-
-# httpd
- String $ng_required_hosts = '',
- String $ng_required_ips = '127.0.0.0/8',
- Boolean $ng_enable_index = true,
-
-# certbot
- Boolean $ng_enable_certbot = true,
- String $ng_certbot_webroot = '/var/www/html',
- String $ng_webserver_name = "nagios.${::domain}",
-
-# main settings
- String $ng_log_file = '/var/log/nagios/nagios.log',
- String $ng_max_check_attempts = '10',
- String $ng_object_cache_file = '/var/spool/nagios/objects.cache',
- String $ng_precached_obj_file = '/var/spool/nagios/objects.precache',
- String $ng_resource_file = '/etc/nagios/private/resource.cfg',
- String $ng_status_file = '/var/log/nagios/status.dat',
- String $ng_status_upd_interval = '10',
- String $ng_check_ext_commands = '1',
- String $ng_command_file = '/var/spool/nagios/cmd/nagios.cmd',
- Boolean $ng_enable_query_handler = false,
- String $ng_query_socket = '/var/spool/nagios/cmd/nagios.qh',
- String $ng_lock_file = '/var/run/nagios/nagios.pid',
- String $ng_temp_file = '/var/spool/nagios/nagios.tmp',
- String $ng_temp_path = '/tmp',
- String $ng_event_broker_options = '-1',
- String $ng_event_broker_module = '',
- String $ng_log_rotation_method = 'h',
- String $ng_log_archive_path = '/var/log/nagios/archives',
- String $ng_use_syslog = '1',
- String $ng_log_notifications = '1',
- String $ng_log_service_retries = '1',
- String $ng_log_host_retries = '1',
- String $ng_log_event_handlers = '1',
- String $ng_log_initial_states = '0',
- String $ng_log_current_states = '1',
- String $ng_log_external_commands = '1',
- String $ng_log_passive_checks = '1',
- String $ng_glob_host_evt_handler = '',
- String $ng_glob_svc_evt_handler = '',
- String $ng_svc_int_check_delay = 's',
- String $ng_max_svc_check_spread = '30',
- String $ng_svc_interleave_factor = 's',
- String $ng_host_int_check_delay = 's',
- String $ng_max_host_check_spread = '30',
- String $ng_max_concurrent_checks = '0',
- String $ng_check_res_reaper_freq = '10',
- String $ng_max_check_res_reap_time = '30',
- String $ng_check_result_path = '/var/spool/nagios/checkresults',
- String $ng_max_check_res_file_age = '3600',
- String $ng_cached_h_check_horizon = '15',
- String $ng_cached_s_check_horizon = '15',
- String $ng_pred_host_dep_checks = '1',
- String $ng_pred_svc_dep_checks = '1',
- String $ng_soft_state_dependencies = '0',
- String $ng_time_change_threshold = '900',
- String $ng_auto_reschedule_checks = '0',
- String $ng_auto_reschedule_intval = '30',
- String $ng_auto_reschedule_window = '180',
- String $ng_service_check_timeout = '60',
- String $ng_host_check_timeout = '30',
- String $ng_event_handler_timeout = '30',
- String $ng_notification_timeout = '30',
- String $ng_ocsp_timeout = '5',
- String $ng_perfdata_timeout = '5',
- String $ng_retain_state_inf = '1',
- String $ng_state_retention_file = '/var/spool/nagios/retention.dat',
- String $ng_retention_update_intval = '60',
- String $ng_use_ret_program_state = '1',
- String $ng_use_ret_scheduling_info = '1',
- String $ng_ret_host_attr_mask = '0',
- String $ng_ret_service_attr_mask = '0',
- String $ng_ret_proc_host_attr_mask = '0',
- String $ng_ret_proc_svc_attr_mask = '0',
- String $ng_ret_contact_h_attr_mask = '0',
- String $ng_ret_contact_s_attr_mask = '0',
- String $ng_interval_length = '60',
- String $ng_check_for_updates = '1',
- String $ng_bare_update_check = '0',
- String $ng_use_aggr_host_checking = '0',
- String $ng_execute_service_checks = '1',
- String $ng_accept_pass_svc_checks = '1',
- String $ng_execute_host_checks = '1',
- String $ng_accept_pass_host_checks = '1',
- String $ng_enable_notifications = '1',
- String $ng_enable_event_handlers = '1',
- String $ng_process_perf_data = '0',
- String $ng_host_perfdata_command = 'process-host-perfdata',
- String $ng_svc_perfdata_command = 'process-service-perfdata',
- String $ng_host_perfdata_file = '/var/spool/nagios/host-perfdata',
- String $ng_service_perfdata_file = '/var/spool/nagios/service-perfdata',
- String $ng_host_perfdata_template = '[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$',
- String $ng_svc_perfdata_template = '[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$',
- String $ng_host_perfdata_file_mode = 'a',
- String $ng_svc_perfdata_file_mode = 'a',
- String $ng_h_perfdata_proc_intval = '0',
- String $ng_s_perfdata_proc_intval = '0',
- String $ng_h_perfdata_proc_cmd = 'process-host-perfdata-file',
- String $ng_s_perfdata_proc_cmd = 'process-service-perfdata-file',
- String $ng_h_perfdata_proc_e_res = '1',
- String $ng_s_perfdata_proc_e_res = '1',
- String $ng_obsess_over_services = '0',
- String $ng_ocsp_command = '',
- String $ng_obsess_over_hosts = '0',
- String $ng_ochp_command = '',
- String $ng_translate_pass_h_checks = '0',
- String $ng_pass_h_checks_are_soft = '0',
- String $ng_check_orphaned_svc = '1',
- String $ng_check_orphaned_hosts = '1',
- String $ng_check_service_freshness = '1',
- String $ng_svc_fresh_check_intval = '60',
- String $ng_svc_check_timeout_state = 'c',
- String $ng_check_host_freshness = '0',
- String $ng_host_fresh_check_intval = '60',
- String $ng_add_freshness_latency = '15',
- String $ng_enable_flap_detection = '1',
- String $ng_low_svc_flap_threshold = '5.0',
- String $ng_high_svc_flap_threshold = '20.0',
- String $ng_low_h_flap_threshold = '5.0',
- String $ng_high_h_flap_threshold = '20.0',
- String $ng_date_format = 'us',
- Boolean $ng_use_timezone_offset = false,
- String $ng_use_timezone = '',
- String $ng_illegal_obj_name_chars = '`~!$%^&*|\'"<>?,()=',
- String $ng_ill_macro_output_chars = '`~$&|\'"<>',
- String $ng_use_regexp_matching = '0',
- String $ng_true_regexp_matching = '0',
- String $ng_daemon_dumps_core = '0',
- String $ng_use_large_inst_tweaks = '0',
- String $ng_enable_env_macros = '0',
- String $ng_free_child_process_mem = '1',
- String $ng_child_proc_fork_twice = '1',
- String $ng_debug_level = '0',
- String $ng_debug_verbosity = '1',
- String $ng_debug_file = '/var/spool/nagios/nagios.debug',
- String $ng_max_debug_file_size = '1000000',
- String $ng_allow_empty_hostgroups = '0',
- String $ng_check_workers = '',
- String $ng_host_down_svc_checks = '0',
- Boolean $ng_enable_load_ctl_options = false,
- String $ng_loadctl_options = 'jobs_max=100;backoff_limit=10;rampup_change=5',
-
-# single nagios checks
- Boolean $ng_enable_swap_check = true,
-
-# installation
- Array $reqpackages_server = ['nagios','nagios-devel'],
- Array $reqpackages_client = ['net-snmp-utils','nagios-plugins','nagios-plugins-all','nagios-plugins-nrpe','nagios-common'],
-
-) {
-# service
- $ng_service = 'nagios'
- $ae_service = 'httpd'
-
-# 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_main_config = "${ng_main_dir}/nagios.cfg"
- $ng_cgi_cfg_file = "${ng_main_dir}/cgi.cfg"
- $ng_cgi_cfg_erb = 'cd_nagios/nagios/cgi_cfg.erb'
- $ng_htpasswd_file = "${ng_main_dir}/passwd"
- $ng_htpasswd_head = 'cd_nagios/nagios/htpasswd_head.erb'
- $ng_htpasswd_rule = 'cd_nagios/nagios/htpasswd_rule.erb'
- $ng_taccgi_erb = 'cd_nagios/selinux/taccgi.erb'
- $ng_statcgi_erb = 'cd_nagios/selinux/statuscgi.erb'
- $ng_statdat_erb = 'cd_nagios/selinux/statusdat.erb'
- $ng_checknrpe_erb = 'cd_nagios/selinux/checknrpe.erb'
- $ng_checknagios_erb = 'cd_nagios/selinux/checknagios.erb'
- $ng_nagios_conf = '/etc/httpd/conf.d/nagios.conf'
- $ng_nagios_conf_erb = 'cd_nagios/httpd/nagios_conf.erb'
- $ng_welcome_conf = '/etc/httpd/conf.d/welcome.conf'
- $ng_welcome_conf_erb = 'cd_nagios/httpd/welcome_conf.erb'
- $ng_forward_conf = '/etc/httpd/conf.d/nagios_forward.conf'
- $ng_forward_conf_erb = 'cd_nagios/httpd/forward_conf.erb'
- $ng_get_cert_erb = 'cd_nagios/certbot/get_cert.erb'
- $ng_unless_get_cert = 'cd_nagios/certbot/unless_get_cert.erb'
- $ng_unless_renew_erb = 'cd_nagios/certbot/unless_renew_cert.erb'
- $ng_index_html_file = '/var/www/html/index.html'
- $ng_index_html_erb = 'cd_nagios/httpd/index_html.erb'
- $ng_ssl_vhost_file = '/etc/httpd/conf.d/nagios_ssl.conf'
- $ng_ssl_vhost_erb = 'cd_nagios/httpd/nagios_ssl_vhost.erb'
- $ng_nagios_cfg_file = "${ng_main_dir}/nagios.cfg"
- $ng_nagios_cfg_erb = 'cd_nagios/nagios/nagios_cfg.erb'
- $ng_resource_erb = 'cd_nagios/nagios/resource_cfg.erb'
- $ng_grep_erb = 'cd_nagios/selinux/grep.erb'
-
-# certbot
- $ng_certbot_main_dir = '/etc/letsencrypt'
- $ng_certbot_archive = "${ng_certbot_main_dir}/archive"
- $ng_certbot_check = "${ng_certbot_archive}/${ng_webserver_name}/cert1.pem"
- $ng_certbot_live = "${ng_certbot_main_dir}/live"
-
-# nagios
- $ng_target_templates = "${ng_conf_d_dir}/nagios_templates.cfg"
- $ng_templates_head_erb = 'cd_nagios/nagios/templates_cfg_head.erb'
- $ng_templates_rule_erb = 'cd_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 = 'cd_nagios/nagios/timeperiods_cfg_head.erb'
- $ng_tgt_timep_rule_erb = 'cd_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 = 'cd_nagios/nagios/hostgroups_cfg_head.erb'
- $ng_tgt_hostgrp_rule_erb = 'cd_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 = 'cd_nagios/nagios/svcgroups_cfg_head.erb'
- $ng_tgt_svcgrp_rule_erb = 'cd_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 = 'cd_nagios/nagios/contacts_cfg_head.erb'
- $ng_contacts_rule_erb = 'cd_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 = 'cd_nagios/nagios/contactgroups_cfg_head.erb'
- $ng_cntctgrps_rule_erb = 'cd_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 cd_nagios::main::config
-}
- |
-
cd_nagios::selinux::config.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@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- |
-
- # File 'manifests/selinux/config.pp', line 6
-
-class cd_nagios::selinux::config (
-
-) inherits cd_nagios::params {
- if $ng_use_selinux_tools == true {
- require cd_selinux
-
- # it appears that selinux behaves differently across different nodes,
- # so all we can do for now is to create a list of the AVC alerts and come up
- # with a solution on that later.
-
- exec { 'create_avc_list':
- command => 'sealert -a /var/log/audit/audit.log > avc_alerts',
- cwd => $ng_user_home,
- path => ['/usr/bin'],
- creates => "${ng_user_home}/avc_alerts",
- }
-
- # sealert tac-cgi
-# exec { 'create_policy_taccgi':
-# command => template($ng_taccgi_erb),
-# path => ['/usr/bin','/usr/sbin'],
-# user => $ng_user,
-# cwd => $ng_user_home,
-# creates => "${ng_user_home}/my-taccgi.pp",
-# notify => Exec['semodule_taccgi'],
-# }
-
-# exec { 'semodule_taccgi':
-# command => "semodule -i ${ng_user_home}/my-taccgi.pp",
-# path => ['/usr/bin','/usr/sbin'],
-# user => $ng_user,
-# cwd => $ng_user_home,
-# require => Exec['create_policy_taccgi'],
-# refreshonly => true,
-# }
-
- # sealert status.cgi
-
-# exec { 'create_policy_statuscgi':
-# command => template($ng_statcgi_erb),
-# path => ['/usr/bin','/usr/sbin'],
-# cwd => $ng_user_home,
-# creates => "${ng_user_home}/my-statuscgi.pp",
-# notify => Exec['semodule_statuscgi'],
-# }
-
-# exec { 'semodule_statuscgi':
-# command => 'semodule -i my-statuscgi.pp',
-# path => ['/usr/bin','/usr/sbin'],
-# cwd => $ng_user_home,
-# require => Exec['create_policy_statuscgi'],
-# refreshonly => true,
-# notify => Service[$ng_service],
-# }
-
- # sealert check_nrpe
-
-# exec { 'create_policy_checknrpe':
-# command => template($ng_checknrpe_erb),
-# path => ['/usr/bin','/usr/sbin'],
-# cwd => $ng_user_home,
-# creates => "${ng_user_home}/my-checknrpe.pp",
-# notify => Exec['semodule_checknrpe'],
-# }
-
-# exec { 'semodule_checknrpe':
-# command => 'semodule -i my-checknrpe.pp',
-# path => ['/usr/bin','/usr/sbin'],
-# cwd => $ng_user_home,
-# require => Exec['create_policy_checknrpe'],
-# refreshonly => true,
-# notify => Service[$ng_service],
-# }
-
- # sealert check_nagios
-
-# exec { 'create_policy_checknagios':
-# command => template($ng_checknagios_erb),
-# path => ['/usr/bin','/usr/sbin'],
-# cwd => $ng_user_home,
-# creates => "${ng_user_home}/my-checknagios.pp",
-# notify => Exec['semodule_checknagios'],
-# }
-
-# exec { 'semodule_checknagios':
-# command => 'semodule -i my-checknagios.pp',
-# path => ['/usr/bin','/usr/sbin'],
-# cwd => $ng_user_home,
-# require => Exec['create_policy_checknagios'],
-# refreshonly => true,
-# notify => Service[$ng_service],
-# }
-
- # sealert status.dat
-
- exec { 'create_policy_statusdat':
- command => template($ng_statdat_erb),
- path => ['/usr/bin','/usr/sbin'],
- user => $ng_user,
- cwd => $ng_user_home,
- creates => "${ng_user_home}/my-http.pp",
- notify => Exec['semodule_statusdat'],
- }
-
- exec { 'semodule_statusdat':
- command => "semodule -i ${ng_user_home}/my-httpd.pp",
- path => ['/usr/bin','/usr/sbin'],
- user => $ng_user,
- cwd => $ng_user_home,
- require => Exec['create_policy_statusdat'],
- refreshonly => true,
- notify => Service[$ng_service],
- }
-
- # sealert grep
-
- exec { 'create_policy_grep':
- command => template($ng_grep_erb),
- path => ['/usr/bin','/usr/sbin'],
- user => $ng_user,
- cwd => $ng_user_home,
- creates => "${ng_user_home}/my-grep.pp",
- notify => Exec['semodule_statusdat'],
- }
-
- exec { 'semodule_grep':
- command => "semodule -i ${ng_user_home}/my-grep.pp",
- path => ['/usr/bin','/usr/sbin'],
- user => $ng_user,
- cwd => $ng_user_home,
- require => Exec['create_policy_grep'],
- refreshonly => true,
- notify => Service[$ng_service],
- }
- }
-}
- |
-
cd_nagios::server::access_rules.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30- |
-
- # File 'manifests/server/access_rules.pp', line 11
-
-class cd_nagios::server::access_rules (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- # manage /etc/nagios/htpasswd file
-
- concat { $ng_htpasswd_file:
- ensure => present,
- path => $ng_htpasswd_file,
- owner => 'root',
- group => 'apache',
- mode => '0640',
- selrange => s0,
- selrole => object_r,
- seltype => nagios_etc_t,
- seluser => system_u,
- notify => Service[$ng_service],
- }
- }
-}
- |
-
cd_nagios::server::files.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@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- |
-
- # File 'manifests/server/files.pp', line 6
-
-class cd_nagios::server::files (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- if $ng_use_https == true {
- if $ng_enable_certbot == true {
- require cd_nagios::certbot::certs
- }
- }
-
- require cd_nagios::main::dirs
-
- # 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:
- ensure => file,
- path => $ng_cgi_cfg_file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => nagios_etc_t,
- seluser => system_u,
- content => template($ng_cgi_cfg_erb),
- notify => Service[$ng_service],
- }
-
- ## Apache files
- # 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,
- }
-
- file { $ng_forward_conf:
- ensure => file,
- path => $ng_forward_conf,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => httpd_config_t,
- seluser => system_u,
- content => template($ng_forward_conf_erb),
- notify => Service[$ae_service],
- }
-
- if $ng_use_https == true {
- # create ssl vhost
-
- file { $ng_ssl_vhost_file:
- ensure => file,
- path => $ng_ssl_vhost_file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => httpd_config_t,
- seluser => system_u,
- content => template($ng_ssl_vhost_erb),
- notify => Service[$ae_service],
- }
- }
-
- if $ng_use_https != true {
- # remove ssl_vhost
-
- file { $ng_ssl_vhost_file:
- ensure => absent,
- }
- }
- }
-}
- |
-
cd_nagios::server::service.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@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 -195 -196 -197 -198- |
-
- # File 'manifests/server/service.pp', line 6
-
-class cd_nagios::server::service (
-
-) inherits cd_nagios::params {
- if $::fqdn == $ng_nagios_server {
- if $ng_include_nrpe == true {
- require cd_nrpe
- }
-
- require cd_nagios::server::files
- require cd_nagios::server::access_rules
- require cd_nagios::nagios::objects::config
- require cd_nagios::nagios::resources::resource
-
- service { $ng_service:
- ensure => running,
- hasstatus => true,
- hasrestart => true,
- enable => true,
- }
-
- @@nagios_host { 'localhost':
- ensure => $ng_ping_ensure,
- alias => 'localhost',
- address => '127.0.0.1',
- use => 'linux-server',
- target => $ng_target_localhost,
- hostgroups => 'linux-servers',
- contacts => 'ops',
- max_check_attempts => $ng_max_check_attempts,
- notification_period => '24x7',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- check_command => "check_ping!${ng_ping_warn}!${ng_ping_crit}",
- notify => Service[$ng_service],
- }
-
- @@nagios_service { 'check_nagios_localhost':
- check_command => $ng_nagios_service_cmd,
- use => 'generic-service',
- host_name => 'localhost',
- notification_period => '24x7',
- service_description => 'localhost_nagios_service',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- contacts => 'ops',
- }
-
- @@nagios_host { $::fqdn:
- ensure => $ng_ping_ensure,
- alias => $::hostname,
- address => $::fqdn,
- use => 'linux-server',
- target => $ng_target_host,
- hostgroups => 'linux-servers',
- contacts => 'ops',
- max_check_attempts => $ng_max_check_attempts,
- notification_period => '24x7',
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- check_command => "check_ping!${ng_ping_warn}!${ng_ping_crit}",
- notify => Service[$ng_user],
- }
-
- @@nagios_service { "root_partition_${::hostname}":
- ensure => $ng_disk_ensure,
- check_command => "check_nrpe!check_disk!${ng_disk_warn}!${ng_disk_crit}!/",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_root_partition",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
-
- if $ng_enable_swap_check == true {
- @@nagios_service { "Swap_Usage_${::hostname}":
- ensure => $ng_swap_ensure,
- check_command => "check_nrpe!check_swap!${ng_swap_warn}!${ng_swap_crit}",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_swap_usage",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
- }
-
- @@nagios_service { "Local_Users_${::hostname}":
- ensure => $ng_users_ensure,
- check_command => "check_nrpe!check_users!${ng_users_warn}!${ng_users_crit}",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_local_users",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
-
- @@nagios_service { "Total Processes_${::hostname}":
- ensure => $ng_procs_tot_ens,
- check_command => "check_nrpe!check_procs!${ng_procs_tot_warn}!${ng_procs_tot_crit}!${ng_procs_tot_param}",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_total_processes",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
-
- @@nagios_service { "Zombie Processes_${::hostname}":
- ensure => $ng_procs_z_ensure,
- check_command => "check_nrpe!check_procs!${ng_procs_z_warn}!${ng_procs_z_crit}!${ng_procs_z_param}",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_zombie_processes",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
-
- @@nagios_service { "Current_Load_${::hostname}":
- ensure => $ng_load_ensure,
- check_command => "check_nrpe!check_load!${ng_load_warn}!${ng_load_crit}",
- use => 'generic-service',
- host_name => $::fqdn,
- contacts => 'ops',
- notification_period => '24x7',
- service_description => "${::hostname}_current_load",
- servicegroups => 'linux-services',
- target => $ng_target_service,
- owner => $ng_user,
- group => $ng_user,
- mode => '0640',
- }
-
- 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'] }
- }
-}
- |
-
cd_nagios::nagios::objects::add_contact.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38- |
-
- # File 'manifests/nagios/objects/add_contact.pp', line 19
-
-define cd_nagios::nagios::objects::add_contact (
-
- Optional[String] $ng_contact_name = undef,
- String $ng_contact_use = 'generic-contact',
- Optional[String] $ng_contact_alias = undef,
- Optional[String] $ng_contact_email = undef,
- Optional[String] $ng_contact_groups = undef,
-
-) {
- $ng_nagios_server = $::cd_nagios::params::ng_nagios_server
- $ng_target_add_contact = $::cd_nagios::params::ng_target_add_contact
- $ng_contacts_rule_erb = $::cd_nagios::params::ng_contacts_rule_erb
-
- if $::fqdn == $ng_nagios_server {
- concat::fragment { $name:
- target => $ng_target_add_contact,
- content => template($ng_contacts_rule_erb),
- }
- }
-}
- |
-
cd_nagios::nagios::objects::add_contactgroups.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30- |
-
- # File 'manifests/nagios/objects/add_contactgroups.pp', line 13
-
-define cd_nagios::nagios::objects::add_contactgroups (
-
- Optional[String] $ng_contactgroup_name = undef,
- Optional[String] $ng_contactgroup_alias = undef,
- String $ng_contactgroup_register = '1',
-
-) {
- $ng_nagios_server = $cd_nagios::params::ng_nagios_server
- $ng_tgt_contactgroup_add = $cd_nagios::params::ng_tgt_contactgroup_add
- $ng_cntctgrps_rule_erb = $cd_nagios::params::ng_cntctgrps_rule_erb
-
- if $::fqdn == $ng_nagios_server {
- concat::fragment { $name:
- target => $ng_tgt_contactgroup_add,
- content => template($ng_cntctgrps_rule_erb),
- }
- }
-}
- |
-
cd_nagios::nagios::objects::add_hostgroups.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32- |
-
- # File 'manifests/nagios/objects/add_hostgroups.pp', line 15
-
-define cd_nagios::nagios::objects::add_hostgroups (
-
- Optional[String] $ng_hostgroup_name = undef,
- Optional[String] $ng_hostgroup_alias = undef,
- String $ng_hostgroup_register = '1',
-
-) {
- $ng_nagios_server = $cd_nagios::params::ng_nagios_server
- $ng_tgt_hostgroup_add = $cd_nagios::params::ng_tgt_hostgroup_add
- $ng_tgt_hostgrp_rule_erb = $cd_nagios::params::ng_tgt_hostgrp_rule_erb
-
- if $::fqdn == $ng_nagios_server {
- concat::fragment { $name:
- target => $ng_tgt_hostgroup_add,
- content => template($ng_tgt_hostgrp_rule_erb),
- }
- }
-}
- |
-
cd_nagios::nagios::objects::add_servicegroups.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35- |
-
- # File 'manifests/nagios/objects/add_servicegroups.pp', line 18
-
-define cd_nagios::nagios::objects::add_servicegroups (
-
- Optional[String] $ng_servicegroup_name = undef,
- Optional[String] $ng_servicegroup_alias = undef,
- String $ng_servicegroup_register = '1',
-
-) {
- $ng_nagios_server = $cd_nagios::params::ng_nagios_server
- $ng_tgt_servicegroup_add = $cd_nagios::params::ng_tgt_servicegroup_add
- $ng_tgt_svcgrp_rule_erb = $cd_nagios::params::ng_tgt_svcgrp_rule_erb
-
- if $::fqdn == $ng_nagios_server {
- concat::fragment { $name:
- target => $ng_tgt_servicegroup_add,
- content => template($ng_tgt_svcgrp_rule_erb),
- }
- }
-}
- |
-
cd_nagios::nagios::objects::add_timeperiods.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51- |
-
- # File 'manifests/nagios/objects/add_timeperiods.pp', line 28
-
-define cd_nagios::nagios::objects::add_timeperiods (
-
- Optional[String] $ng_timep_name = undef,
- Optional[String] $ng_timep_alias = undef,
- String $ng_timep_monday = '00:00-00:00',
- String $ng_timep_tuesday = '00:00-00:00',
- String $ng_timep_wednesday = '00:00-00:00',
- String $ng_timep_thursday = '00:00-00:00',
- String $ng_timep_friday = '00:00-00:00',
- String $ng_timep_saturday = '00:00-00:00',
- String $ng_timep_sunday = '00:00-00:00',
-
-) {
- $ng_nagios_server = $cd_nagios::params::ng_nagios_server
- $ng_tgt_timep_add = $cd_nagios::params::ng_tgt_timep_add
- $ng_tgt_timep_rule_erb = $cd_nagios::params::ng_tgt_timep_rule_erb
-
- if $::fqdn == $ng_nagios_server {
- concat::fragment { $name:
- target => $ng_tgt_timep_add,
- content => template($ng_tgt_timep_rule_erb),
- }
- }
-}
- |
-
cd_nagios::nagios::objects::templates.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com) notifications. for the defined service or host.
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/templates.pp', line 79
-
-define cd_nagios::nagios::objects::templates (
- Optional[String] $ng_template_object = undef,
- Optional[String] $ng_template_object_name = undef,
- String $ng_svc_notification_period = '24x7',
- String $ng_host_notification_period = '24x7',
- String $ng_service_notification_options = 'w,u,c,r,f,s',
- String $ng_host_notification_options = 'd,u,r,f,s',
- String $ng_service_notification_commands = 'notify-service-by-email',
- String $ng_host_notification_commands = 'notify-host-by-email',
- String $ng_object_register = '0',
- Optional[String] $ng_template_object_use = undef,
- String $ng_notifications_enabled = '1',
- String $ng_event_handler_enabled = '1',
- String $ng_flap_detection_enabled = '1',
- String $ng_process_perf_data = '1',
- String $ng_retain_status_information = '1',
- String $ng_retain_nonstatus_information = '1',
- String $ng_notification_period = '24x7',
- String $ng_notification_interval = '30',
- String $ng_check_period = '24x7',
- String $ng_check_interval = '5',
- String $ng_retry_interval = '1',
- String $ng_max_check_attempts = '10',
- String $ng_host_check_command = 'check-host-alive',
- Optional[String] $ng_notification_options = undef,
- String $ng_contact_groups = 'admins',
- String $ng_active_checks_enabled = '1',
- String $ng_passive_checks_enabled = '1',
- String $ng_parallelize_check = '1',
- String $ng_obsess_over_service = '1',
- String $ng_check_freshness = '0',
- String $ng_is_volatile = '0',
-
-) {
- $ng_nagios_server = $cd_nagios::params::ng_nagios_server
- $ng_target_templates = $cd_nagios::params::ng_target_templates
- $ng_templates_rule_erb = $cd_nagios::params::ng_templates_rule_erb
-
- if $::fqdn == $ng_nagios_server {
- concat::fragment { $name:
- target => $ng_target_templates,
- content => template($ng_templates_rule_erb),
- }
- }
-}
- |
-
cd_nagios::nagios::resources::resource_df.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28- |
-
- # File 'manifests/nagios/resources/resource_df.pp', line 10
-
-define cd_nagios::nagios::resources::resource_df (
-
- Optional[String] $ng_user_arg_name = undef,
- Optional[String] $ng_user_arg_value = undef,
- Optional[String] $ng_user_arg_comment = undef,
- String $ng_resource_rule_erb = 'cd_nagios/nagios/resource_cfg_rule.erb',
-
-) {
- $ng_nagios_server = $cd_nagios::params::ng_nagios_server
- $ng_resource_file = $cd_nagios::params::ng_resource_file
-
- if $fqdn == $ng_nagios_server {
- concat::fragment { "rule_${name}":
- target => $ng_resource_file,
- content => template($ng_resource_rule_erb),
- order => '000',
- }
- }
-}
- |
-
cd_nagios::server::access.pp Module name: cd_nagios Author: Arne Teuke (arne_teuke@ConfDroid.com)
- -
- - - -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28- |
-
- # File 'manifests/server/access.pp', line 9
-
-define cd_nagios::server::access (
-
- Optional[String] $ng_htpasswd_user = undef,
- Optional[String] $ng_htpasswd_password = undef,
-
-) {
- $ng_nagios_server = $cd_nagios::params::ng_nagios_server
- $ng_htpasswd_file = $cd_nagios::params::ng_htpasswd_file
- $ng_htpasswd_rule = $cd_nagios::params::ng_htpasswd_rule
- $ng_service = $cd_nagios::params::ng_service
-
- if $::fqdn == $ng_nagios_server {
- # create password rules
-
- concat::fragment { $name:
- target => $ng_htpasswd_file,
- content => template($ng_htpasswd_rule),
- }
- }
-}
- |
-