Documentation by YARD 0.9.9
-Alphabetic Index
- -Puppet Class Listing A-Z
- - -Defined Type Listing A-Z
- - -
-
-
-
|
-
File Listing
--
-
-
-
- README - - -
diff --git a/README.md b/README.md index d494cdc..f63de72 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,35 @@ +# Readme + [](https://pipelines.confdroid.com/job/cd_nagios/) -### Synopsis +[[_TOC_]] + +## 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 PuppetDB. +## WARNING -### WARNING -`**__!!! Attention: Never use this puppet module on systems which have been previously configured manually. It is impossible to predict how and what would have been configured, hence previuos configurations outside the scope of this module may be overwritten! Automated configurations require a test environment to verify that the module suits the purpose intended by the user, as well as tune the parameters, before deploying into live production!!! __**` +***Attention: Never use this puppet module on systems which have been previously configured manually. It is impossible to predict how and what would have been configured, hence previous configurations outside the scope of this module may be overwritten! Automated configurations require a test environment to verify that the module suits the purpose intended by the user, as well as tune the parameters, before deploying into live production*** -### Table of Contents -* [Features](#features) -* [Repo Structure](https://sourcecode.confdroid.com/12WW1160/cd_nagios/blob/master/REPOSTRUCTURE.md) -* [Dependencies](#dependencies) -* [Deployment](#deployment) - * [native Puppet deployment](#native-puppet-deployment) - * [through Foreman](#through-foreman) -* [Parameters](#parameters) - * [Mandatory Parameters](#mandatory-parameters) - * [Optional Parameters](#optional-parameters) -* [PuppetDB](#puppetdb) -* [SELINUX](#selinux) -* [Certbot](#certbot) -* [Httpd vHost Files](#httpd-vhost-files) -* [Client Connections](#client-connections) -* [Manage additional resources](#manage-additional-resources) -* [Known Problems](#known-problems) -* [Support](#support) -* [Tests](#tests) -* [Contact Us](https://confdroid.com/contact/) -* [Disclaimer](#disclaimer) - - -### Features +## 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 ) @@ -64,12 +50,15 @@ Configuration * 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 @@ -78,10 +67,12 @@ Monitoring * amount of zombie processes * current Load -### Repo Structure -Repostructure has moved to REPOSTRUCTURE.md in repo. +## Repo Documentation + +See the full Puppet documentation including parameters in `docs/index.html` + +## Dependencies -### Dependencies All dependencies must be included in the catalogue. * [cd_resources](https://sourcecode.confdroid.com/12WW1160/cd_resources) for Yum repos. @@ -93,83 +84,76 @@ All dependencies must be included in the catalogue. * [cd_stdlib](https://sourcecode.confdroid.com/12WW1160/cd_stdlib) or [puppetlabs stdlib](https://github.com/puppetlabs/puppetlabs-stdlib) to facilitate concat * [cd-concat](https://sourcecode.confdroid.com/12WW1160/cd_stdlib) or [puppetlabs concat](https://github.com/puppetlabs/puppetlabs-concat) to concatenate configuration files from different sources. -### Deployment +## Deployment -##### native Puppet deployment +* native Puppet deployment via site.pp or nodes.pp -``` +```ruby node 'example.example.net' { include cd_nagios } ``` -#### through Foreman: + +* through Foreman: + In order to apply parameters through Foreman, **__cd_nagios::params__** must be added to the host or hostgroup in question. See [more details about class deployment on Confdroid.com](https://confdroid.com/2017/05/deploying-our-puppet-modules/). -### Parameters -The following parameters are editable via params.pp or through ENC (**__recommended__**). Values changed will take immediate effect at next puppet run. Services will be restarted where neccessary. +## PuppetDB -#### Mandatory Parameters -The following parameters must be set to make the module logic work properly: +A working instance of PuppetDB connected to the Puppet master is required for this to work. Installation and configuration of PuppetDB is out of scope for this module, however [cd_puppetdb](https://sourcecode.confdroid.com/12WW1160/cd_puppetdb) is available to automate this task for you as well within a few minutes. -* `$ng_nagios_server` : Specify the FQDN of the nagios server host. Must be a proper A-name, no CNAME i.e. on Loadbalancers. When the FQDN matches the configured value, Nagios server components will be installed and the clients will allow to be connected by that host. Impacts also firewall ports (optional). +## SELINUX -#### Optional Parameters - -* `$ng_include_nrpe` : Whether to include NRPE as means for the Nagios server to connect to clients. Defaults to `true`. -* `$ng_include_fw` : Whether to include firewall management. Requires [puppetlabs firewall](https://github.com/puppetlabs/puppetlabs-firewall) or [cd_firewall](https://sourcecode.confdroid.com/12WW1160/cd_firewall), which is a backdated clone of the puppetlabs firewall but tested to be fully functioning with all our features. - - -See the [full list of all available parameters](https://confdroid.com/2017/07/cd_nagios-parameters/). - -### PuppetDB -A working instance of PuppetDBconnected to the Puppet master is required for this to work. Installation and configuration of PuppetDB is out of scope for this module, however [cd_puppetdb](https://sourcecode.confdroid.com/12WW1160/cd_puppetdb) is available to automate this task for you as well within a few minutes. - -### SELINUX All files and directories are configured with correct selinux context. If selinux is disabled, these contexts are ignored. -### Certbot +## Certbot + This module can optionally setup [certbot](https://certbot.eff.org/) TLS certificate management for the frontend 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 ssd.conf. However, as Nagios might be running on a regular web server with various other web instances (not recommended through for performance reasons), we will not want to manage ssl.conf directly, hence the module creates a vhost for the ssl host. +## httpd vHost files + +by default, Nagios creates its own nagios.conf file, which is not a vhost file and relies on the main ssd.conf. However, as Nagios might be running on a regular web server with various other web instances (not recommended through for performance reasons), we will not want to manage ssl.conf directly, hence the module creates a vhost for the ssl host. + +## Client Connections -### 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). -### Manage Additional Resources +## Known Problems -### Known Problems * Collected resources import ordering problem: The module might try to import collected facts before nagios is even installed. -* SELINUX modules: it appears that sealerts are different accross systems. it might be typically easier to work through sealerts manually. -### Support +## Support + * OS: CentOS 7 -* Puppet 5.x +* Puppet 5 +## Tests -### Tests * Puppet Lint * excluded tests: - * `--no-class_inherits_from_params_class-check`:relavant only to non-supported outdated puppet versions + * `--no-class_inherits_from_params_class-check`:relevant only to non-supported outdated puppet versions * `--no-variable_scope-check`: not applicable as we are inheriting parameters from params class. the lint check does not distinguish between facts and inherited parameters. * `--no-80chars-check`: it is not always possible to stay within 80 characters, although typically only occurring on the parameter vault `params.pp`. - * `--no-140chars-check`: it is not always possible to stay within 140 characters, although typically only occurring on the parameter vault `params.pp`. * `--no-arrow_alignment-check`: this check leads to actually not having am easily readable arrow alignment, as this checks `per block`, not per class. * Puppet Parser * ERB Template Parser -* Test for unwanted UTF8 files in the Puppet code as this causes problems with PuppetDB (see tests/UTF_Files) +* Test for unwanted UTF8 files in the Puppet code (see tests/UTF_Files) +* Markdown-lint +* Spellcheck +* Sonar Quality Gate +## Contact Us -### Contact Us [contact Us](https://confdroid.com/contact/) -### Disclaimer +## Disclaimer + ConfDroid as entity is entirely independent from Puppet. We provide custom configuration modules, written for specific purposes and specific environments. The modules are tested and supported only as documented, and require testing in designated environments (i.e. lab or development environments) for parameter tuning etc. before deploying into production environments. diff --git a/REPOSTRUCTURE.md b/REPOSTRUCTURE.md deleted file mode 100644 index 2538412..0000000 --- a/REPOSTRUCTURE.md +++ /dev/null @@ -1,138 +0,0 @@ -. -|-- doc -| |-- css -| | |-- common.css -| | |-- full_list.css -| | `-- style.css -| |-- js -| | |-- app.js -| | |-- full_list.js -| | `-- jquery.js -| |-- puppet_classes -| | |-- cd_nagios_3A_3Acertbot_3A_3Acerts.html -| | |-- cd_nagios_3A_3Acertbot_3A_3Aconfig.html -| | |-- cd_nagios_3A_3Aclient_3A_3Atarget.html -| | |-- cd_nagios_3A_3Afirewall_3A_3Aiptables.html -| | |-- cd_nagios_3A_3Amain_3A_3Aconfig.html -| | |-- cd_nagios_3A_3Amain_3A_3Adirs.html -| | |-- cd_nagios_3A_3Amain_3A_3Ainstall.html -| | |-- cd_nagios_3A_3Amain_3A_3Auser.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups_rules.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact_rules.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_hostgroup_rules.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_servicegroup_rules.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_timeperiod_rules.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acommands.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontactgroups.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontacts.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Ahostgroups.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aservicegroups.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplate_rules.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atimeperiods.html -| | |-- cd_nagios_3A_3Aparams.html -| | |-- cd_nagios_3A_3Aselinux_3A_3Aconfig.html -| | |-- cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html -| | |-- cd_nagios_3A_3Aserver_3A_3Afiles.html -| | |-- cd_nagios_3A_3Aserver_3A_3Aservice.html -| | `-- cd_nagios.html -| |-- puppet_defined_types -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_hostgroups.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_servicegroups.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_timeperiods.html -| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplates.html -| | `-- cd_nagios_3A_3Aserver_3A_3Aaccess.html -| |-- file.README.html -| |-- frames.html -| |-- _index.html -| |-- index.html -| |-- puppet_class_list.html -| |-- puppet_defined_type_list.html -| `-- top-level-namespace.html -|-- manifests -| |-- certbot -| | `-- certs.pp -| |-- client -| | `-- target.pp -| |-- firewall -| | `-- iptables.pp -| |-- main -| | |-- config.pp -| | |-- dirs.pp -| | |-- install.pp -| | `-- user.pp -| |-- nagios -| | `-- objects -| | |-- add_contactgroups.pp -| | |-- add_contactgroups_rules.pp -| | |-- add_contact.pp -| | |-- add_contact_rules.pp -| | |-- add_hostgroup_rules.pp -| | |-- add_hostgroups.pp -| | |-- add_servicegroup_rules.pp -| | |-- add_servicegroups.pp -| | |-- add_timeperiod_rules.pp -| | |-- add_timeperiods.pp -| | |-- commands.pp -| | |-- config.pp -| | |-- contactgroups.pp -| | |-- contacts.pp -| | |-- hostgroups.pp -| | |-- servicegroups.pp -| | |-- template_rules.pp -| | |-- templates.pp -| | `-- timeperiods.pp -| |-- selinux -| | `-- config.pp -| |-- server -| | |-- access.pp -| | |-- access_rules.pp -| | |-- files.pp -| | `-- service.pp -| |-- init.pp -| `-- params.pp -|-- templates -| |-- certbot -| | |-- get_cert.erb -| | |-- unless_get_cert.erb -| | `-- unless_renew_cert.erb -| |-- httpd -| | |-- forward_conf.erb -| | |-- index_html.erb -| | `-- nagios_ssl_vhost.erb -| |-- nagios -| | |-- cgi_cfg.erb -| | |-- contactgroups_cfg_head.erb -| | |-- contactgroups_cfg_rule.erb -| | |-- contacts.cfg -| | |-- contacts_cfg_head.erb -| | |-- contacts_cfg_rule.erb -| | |-- hostgroups_cfg_head.erb -| | |-- hostgroups_cfg_rule.erb -| | |-- htpasswd_rule.erb -| | |-- nagios_cfg.erb -| | |-- svcgroups_cfg_head.erb -| | |-- svcgroups_cfg_rule.erb -| | |-- templates_cfg_head.erb -| | |-- templates_cfg_rule.erb -| | |-- timeperiods_cfg_head.erb -| | `-- timeperiods_cfg_rule.erb -| `-- selinux -| |-- checknagios.erb -| |-- checknrpe.erb -| |-- statuscgi.erb -| |-- statusdat.erb -| `-- taccgi.erb -|-- tests -| `-- UTF_Files -|-- CHANGELOG.md -|-- Gemfile -|-- Gemfile.lock -|-- Jenkinsfile -|-- LICENSE -|-- README.md -`-- REPOSTRUCTURE.md - -20 directories, 115 files diff --git a/doc/_index.html b/doc/_index.html deleted file mode 100644 index 28c4399..0000000 --- a/doc/_index.html +++ /dev/null @@ -1,291 +0,0 @@ - - -
- - -
-
-
-
|
-
| t |
- - - -23 -24 -25- |
-
- # File 'manifests/init.pp', line 23
-
-class cd_nagios {
- include cd_nagios::params
-}
- |
-
cd_nagios::certbot::certs.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 (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/certbot/certs.pp', line 23
-
-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::certbot::config.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 (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/certbot/config.pp', line 23
-
-class cd_nagios::certbot::config (
-
-) inherits cd_nagios::params {
-
- if $::fqdn == $ng_nagios_server {
- if $ng_use_https == true {
- if $ng_enable_certbot == true {
-
- require cd_certbot
-
- # ensure there is no forward vhost file
-
- exec { 'remove_forward_vhost':
- command => "rm -Rf ${ng_forward_conf}",
- creates => '/etc/httpd/conf.d/.cert_created',
- }
-
- exec { 'remove_nagios_conf':
- command => "rm -Rf ${ng_nagios_conf}",
- creates => '/etc/httpd/conf.d/.cert_created',
- require => Exec['remove_forward_vhost'],
- }
-
- exec { 'remove_index_html':
- command => "rm -Rf ${ng_index_html_file}",
- creates => '/etc/httpd/conf.d/.cert_created',
- require => Exec['remove_nagios_conf'],
- notify => Service[$ae_service],
- }
-
- exec { 'disable_selinux_temporarily':
- command => 'setenforce 0',
- path => ['/usr/sbin'],
- creates => '/etc/httpd/conf.d/.cert_created',
- require => Exec['remove_index_html'],
- }
-
- # 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 => '/etc/httpd/conf.d/.cert_created',
- }
-
- exec { 'enable_selinux':
- command => 'setenforce 1',
- path => ['/usr/sbin'],
- creates => '/etc/httpd/conf.d/.cert_created',
- require => Exec['create_cert'],
- }
-
- # 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) -License: - This file is part of nagios.
- -nagios is used for providing automatic configuration of Nagios targets. - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/client/target.pp', line 23
-
-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) -License: - This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of - <service / -purpose> - Copyright (C) 2017 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/.
- -
- - - -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- |
-
- # File 'manifests/firewall/iptables.pp', line 24
-
-class cd_nagios::firewall::iptables (
-
-) inherits cd_nagios::params {
-
- if $::fqdn == $ng_nagios_server {
-
- if $ng_use_https != true {
-
- firewall { "${ng_fw_order}${ng_http_port} port ${ng_http_port}":
- proto => ['tcp','udp'],
- dport => $ng_http_port,
- action => 'accept',
- }
- }
-
- if $ng_use_https == true {
-
- firewall { "${ng_fw_order}${ng_https_port} port ${ng_https_port}":
- proto => ['tcp','udp'],
- dport => $ng_https_port,
- action => 'accept',
- }
-
- if $ng_http_https_fw == true {
-
- firewall { "${ng_fw_order}${ng_http_port} port ${ng_http_port}":
- proto => ['tcp','udp'],
- dport => $ng_http_port,
- action => 'accept',
- }
- }
- }
- }
-}
- |
-
cd_nagios::main::config.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 (C) 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/.
- -
- - - -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/main/config.pp', line 24
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios. - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/main/dirs.pp', line 23
-
-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,
- }
- }
-}
- |
-
cd_nagios::main::install.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 (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/main/install.pp', line 24
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/main/user.pp', line 23
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/add_contact_rules.pp', line 30
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/add_contactgroups_rules.pp', line 30
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/add_hostgroup_rules.pp', line 29
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/add_servicegroup_rules.pp', line 29
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/. - }
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/add_timeperiod_rules.pp', line 35
-
-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',
- }
- }
-}
- |
-
cd_nagios::nagios::objects::commands.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 (C) 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/.
- -
- - - -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 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240- |
-
- # File 'manifests/nagios/objects/commands.pp', line 24
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43- |
-
- # File 'manifests/nagios/objects/config.pp', line 23
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/contactgroups.pp', line 34
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/contacts.pp', line 39
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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 -223 -224 -225 -226 -227 -228- |
-
- # File 'manifests/nagios/objects/hostgroups.pp', line 24
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/servicegroups.pp', line 24
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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 -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- |
-
- # File 'manifests/nagios/objects/template_rules.pp', line 28
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/timeperiods.pp', line 24
-
-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::params.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 (C) 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/. - 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.
- -
- - - -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 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012- |
-
- # File 'manifests/params.pp', line 653
-
-class cd_nagios::params (
-
-$pkg_ensure = 'latest',
-
-$ng_nagios_server = "nagios.${::domain}",
-$ng_nagios_ext_ip = undef,
-$ng_mail_user = "admin@${::domain}",
-$ng_page_user = "pageadmin@${::domain}",
-
-$ng_include_nrpe = true,
-
-# firewall
-$ng_include_fw = true,
-$ng_use_https = true,
-$ng_http_https_fw = true,
-$ng_fw_order = '50',
-$ng_http_port = '80',
-$ng_https_port = '443',
-$ng_nrpe_port = '5666',
-
-# check command parameters
-## ping
-$ng_ping_warn = '100.0,20%',
-$ng_ping_crit = '500.0,60%',
-$ng_ping_ensure = 'present',
-## disk
-$ng_disk_warn = '20%',
-$ng_disk_crit = '10%' ,
-$ng_disk_ensure = 'present',
-# swap
-$ng_swap_warn = '20',
-$ng_swap_crit = '10',
-$ng_swap_ensure = 'present',
-# users
-$ng_users_warn = '20',
-$ng_users_crit = '50',
-$ng_users_ensure = 'present',
-#total procs
-$ng_procs_tot_warn = '330',
-$ng_procs_tot_crit = '400',
-$ng_procs_tot_param = 'RDST',
-$ng_procs_tot_ens = 'present',
-# zombie procs
-$ng_procs_z_warn = '10',
-$ng_procs_z_crit = '30',
-$ng_procs_z_param = 'Z',
-$ng_procs_z_ensure = 'present',
-# load
-$ng_load_warn = '5.00,4.00,3.00',
-$ng_load_crit = '10.00,6.00,4.00',
-$ng_load_ensure = 'present',
-
-# user settings
-$ng_user = 'nagios',
-$ng_u_comment = 'Nagios service user',
-$ng_u_uid = '1004',
-$ng_user_home = '/var/spool/nagios',
-$ng_u_groups = undef,
-$ng_user_shell = '/bin/bash',
-
-# cgi settings
-$ng_context_help = '1',
-$ng_pending_state = '1',
-$ng_use_auth = '1',
-$ng_use_ssl_auth = '0',
-$ng_enable_def_user = false,
-$ng_def_user_name = 'nagios_insecure',
-$ng_nagios_admin = 'nagios_sec_adm',
-$ng_sysinfo_auth = '',
-$ng_confinfo_auth = '',
-$ng_command_auth = '',
-$ng_hostview_auth = '',
-$ng_serviceview_auth = '',
-$ng_host_cmd_auth = '',
-$ng_svc_cmd_auth = '',
-$ng_readonly_auth = '' ,
-$ng_statusmap_img = 'smbackground.gd2',
-$ng_use_colormap = false,
-$ng_colormap_red = '255',
-$ng_colormap_green = '255',
-$ng_colormap_blue = '255',
-$ng_statusmap_layout = '6',
-$ng_wrl_layout = '4',
-$ng_incl_own_wrl = false,
-$ng_statuswrl_include = '',
-$ng_ping_syntax = '/bin/ping -n -U -c 5 $HOSTADDRESS$',
-$ng_refresh_rate = '90',
-$ng_result_limit = '100',
-$ng_escape_html = '1',
-$ng_use_sound = false,
-$ng_host_unreachable = 'hostdown.wav',
-$ng_host_down = 'hostdown.wav',
-$ng_svc_critical = 'critical.wav',
-$ng_svc_warn = 'warning.wav',
-$ng_svc_unknown = 'warning.wav',
-$ng_normal_sound = 'noproblem.wav',
-$ng_action_url_target = '_blank',
-$ng_notes_url_target = '_blank',
-$ng_lock_author_names = '1',
-$ng_enable_splunk = false,
-$ng_splunk_url = 'http://127.0.0.1:8000/',
-$ng_navbar_addresses = '1',
-$ng_navbar_aliases = '1',
-$ng_ack_no_sticky = '0',
-$ng_ack_no_send = '0',
-
-# selinux
-$ng_use_selinux_tools = true,
-
-# httpd
-$ng_required_hosts = '',
-$ng_required_ips = '127.0.0.0/8',
-$ng_enable_index = true,
-
-# certbot
-$ng_enable_certbot = true,
-$ng_certbot_webroot = '/var/www/html',
-$ng_webserver_name = "nagios.${::domain}",
-
-# main settings
-$ng_log_file = '/var/log/nagios/nagios.log',
-$ng_max_check_attempts = '10',
-$ng_object_cache_file = '/var/spool/nagios/objects.cache',
-$ng_precached_obj_file = '/var/spool/nagios/objects.precache',
-$ng_resource_file = '/etc/nagios/private/resource.cfg',
-$ng_status_file = '/var/log/nagios/status.dat',
-$ng_status_upd_interval = '10',
-$ng_check_ext_commands = '1',
-$ng_command_file = '/var/spool/nagios/cmd/nagios.cmd',
-$ng_enable_query_handler = false,
-$ng_query_socket = '/var/spool/nagios/cmd/nagios.qh',
-$ng_lock_file = '/var/run/nagios/nagios.pid',
-$ng_temp_file = '/var/spool/nagios/nagios.tmp',
-$ng_temp_path = '/tmp',
-$ng_event_broker_options = '-1',
-$ng_event_broker_module = '',
-$ng_log_rotation_method = 'h',
-$ng_log_archive_path = '/var/log/nagios/archives',
-$ng_use_syslog = '1',
-$ng_log_notifications = '1',
-$ng_log_service_retries = '1',
-$ng_log_host_retries = '1',
-$ng_log_event_handlers = '1',
-$ng_log_initial_states = '0',
-$ng_log_current_states = '1',
-$ng_log_external_commands = '1',
-$ng_log_passive_checks = '1',
-$ng_glob_host_evt_handler = '',
-$ng_glob_svc_evt_handler = '',
-$ng_svc_int_check_delay = 's',
-$ng_max_svc_check_spread = '30',
-$ng_svc_interleave_factor = 's',
-$ng_host_int_check_delay = 's',
-$ng_max_host_check_spread = '30',
-$ng_max_concurrent_checks = '0',
-$ng_check_res_reaper_freq = '10',
-$ng_max_check_res_reap_time = '30',
-$ng_check_result_path = '/var/spool/nagios/checkresults',
-$ng_max_check_res_file_age = '3600',
-$ng_cached_h_check_horizon = '15',
-$ng_cached_s_check_horizon = '15',
-$ng_pred_host_dep_checks = '1',
-$ng_pred_svc_dep_checks = '1',
-$ng_soft_state_dependencies = '0',
-$ng_time_change_threshold = '900',
-$ng_auto_reschedule_checks = '0',
-$ng_auto_reschedule_intval = '30',
-$ng_auto_reschedule_window = '180',
-$ng_service_check_timeout = '60',
-$ng_host_check_timeout = '30',
-$ng_event_handler_timeout = '30',
-$ng_notification_timeout = '30',
-$ng_ocsp_timeout = '5',
-$ng_perfdata_timeout = '5',
-$ng_retain_state_inf = '1',
-$ng_state_retention_file = '/var/spool/nagios/retention.dat',
-$ng_retention_update_intval = '60',
-$ng_use_ret_program_state = '1',
-$ng_use_ret_scheduling_info = '1',
-$ng_ret_host_attr_mask = '0',
-$ng_ret_service_attr_mask = '0',
-$ng_ret_proc_host_attr_mask = '0',
-$ng_ret_proc_svc_attr_mask = '0',
-$ng_ret_contact_h_attr_mask = '0',
-$ng_ret_contact_s_attr_mask = '0',
-$ng_interval_length = '60',
-$ng_check_for_updates = '1',
-$ng_bare_update_check = '0',
-$ng_use_aggr_host_checking = '0',
-$ng_execute_service_checks = '1',
-$ng_accept_pass_svc_checks = '1',
-$ng_execute_host_checks = '1',
-$ng_accept_pass_host_checks = '1',
-$ng_enable_notifications = '1',
-$ng_enable_event_handlers = '1',
-$ng_process_perf_data = '0',
-$ng_host_perfdata_command = 'process-host-perfdata',
-$ng_svc_perfdata_command = 'process-service-perfdata',
-$ng_host_perfdata_file = '/var/spool/nagios/host-perfdata',
-$ng_service_perfdata_file = '/var/spool/nagios/service-perfdata',
-$ng_host_perfdata_template = '[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$',
-$ng_svc_perfdata_template = '[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$',
-$ng_host_perfdata_file_mode = 'a',
-$ng_svc_perfdata_file_mode = 'a',
-$ng_h_perfdata_proc_intval = '0',
-$ng_s_perfdata_proc_intval = '0',
-$ng_h_perfdata_proc_cmd = 'process-host-perfdata-file',
-$ng_s_perfdata_proc_cmd = 'process-service-perfdata-file',
-$ng_h_perfdata_proc_e_res = '1',
-$ng_s_perfdata_proc_e_res = '1',
-$ng_obsess_over_services = '0',
-$ng_ocsp_command = '',
-$ng_obsess_over_hosts = '0',
-$ng_ochp_command = '',
-$ng_translate_pass_h_checks = '0',
-$ng_pass_h_checks_are_soft = '0',
-$ng_check_orphaned_svc = '1',
-$ng_check_orphaned_hosts = '1',
-$ng_check_service_freshness = '1',
-$ng_svc_fresh_check_intval = '60',
-$ng_svc_check_timeout_state = 'c',
-$ng_check_host_freshness = '0',
-$ng_host_fresh_check_intval = '60',
-$ng_add_freshness_latency = '15',
-$ng_enable_flap_detection = '1',
-$ng_low_svc_flap_threshold = '5.0',
-$ng_high_svc_flap_threshold = '20.0',
-$ng_low_h_flap_threshold = '5.0',
-$ng_high_h_flap_threshold = '20.0',
-$ng_date_format = 'us',
-$ng_use_timezone_offset = false,
-$ng_use_timezone = '',
-$ng_illegal_obj_name_chars = '`~!$%^&*|\'"<>?,()=',
-$ng_ill_macro_output_chars = '`~$&|\'"<>',
-$ng_use_regexp_matching = '0',
-$ng_true_regexp_matching = '0',
-$ng_daemon_dumps_core = '0',
-$ng_use_large_inst_tweaks = '0',
-$ng_enable_env_macros = '0',
-$ng_free_child_process_mem = '1',
-$ng_child_proc_fork_twice = '1',
-$ng_debug_level = '0',
-$ng_debug_verbosity = '1',
-$ng_debug_file = '/var/spool/nagios/nagios.debug',
-$ng_max_debug_file_size = '1000000',
-$ng_allow_empty_hostgroups = '0',
-$ng_check_workers = '',
-$ng_host_down_svc_checks = '0',
-$ng_enable_load_ctl_options = false,
-$ng_loadctl_options = 'jobs_max=100;backoff_limit=10;rampup_change=5',
-
-# single nagios checks
-$ng_enable_swap_check = true,
-
-
-) {
-
-# installation section
-
- $reqpackages_server = $::operatingsystem ? {
- /(?i-mx:centos|fedora|redhat)/ => ['nagios','nagios-devel']
- }
- $reqpackages_client = $::operatingsystem ? {
- /(?i-mx:centos|fedora|redhat)/ => ['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"
-
-# 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'
-
-# 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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/selinux/config.pp', line 23
-
-class cd_nagios::selinux::config (
-
-) inherits cd_nagios::params {
-
- if $ng_use_selinux_tools == true {
-
- # it appears that selinux hehaves differently accross 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'],
- cwd => $ng_user_home,
- creates => "${ng_user_home}/my-taccgi.pp",
- notify => Exec['semodule_taccgi'],
- }
-
- exec { 'semodule_taccgi':
- command => 'semodule -i my-taccgi.pp',
- path => ['/usr/bin','/usr/sbin'],
- 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],
- }
-
- # selart 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'],
- cwd => $ng_user_home,
- creates => "${ng_user_home}/my-http.pp",
- notify => Exec['semodule_statusdat'],
- }
-
- exec { 'semodule_statusdat':
- command => 'semodule -i my-httpd.pp',
- path => ['/usr/bin','/usr/sbin'],
- cwd => $ng_user_home,
- require => Exec['create_policy_statusdat'],
- refreshonly => true,
- notify => Service[$ng_service],
- }
- }
-}
- |
-
cd_nagios::server::access_rules.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 (C) 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- |
-
- # File 'manifests/server/access_rules.pp', line 28
-
-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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/server/files.pp', line 23
-
-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],
- }
-
- # 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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -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- |
-
- # File 'manifests/server/service.pp', line 23
-
-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
-
- 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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/.
- -
- - - -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57- |
-
- # File 'manifests/nagios/objects/add_contact.pp', line 36
-
-define cd_nagios::nagios::objects::add_contact (
-
-$ng_contact_name = undef,
-$ng_contact_use = 'generic-contact',
-$ng_contact_alias = undef,
-$ng_contact_email = undef,
-$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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/
- -
- - - -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/add_contactgroups.pp', line 30
-
-define cd_nagios::nagios::objects::add_contactgroups (
-
-$ng_contactgroup_name = undef,
-$ng_contactgroup_alias = undef,
-$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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/
- -
- - - -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52- |
-
- # File 'manifests/nagios/objects/add_hostgroups.pp', line 32
-
-define cd_nagios::nagios::objects::add_hostgroups (
-
-$ng_hostgroup_name = undef,
-$ng_hostgroup_alias = undef,
-$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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/
- -
- - - -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53- |
-
- # File 'manifests/nagios/objects/add_servicegroups.pp', line 34
-
-define cd_nagios::nagios::objects::add_servicegroups (
-
-$ng_servicegroup_name = undef,
-$ng_servicegroup_alias = undef,
-$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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/add_timeperiods.pp', line 45
-
-define cd_nagios::nagios::objects::add_timeperiods (
-
-$ng_timep_name = undef,
-$ng_timep_alias = undef,
-$ng_timep_monday = '00:00-00:00',
-$ng_timep_tuesday = '00:00-00:00',
-$ng_timep_wednesday = '00:00-00:00',
-$ng_timep_thursday = '00:00-00:00',
-$ng_timep_friday = '00:00-00:00',
-$ng_timep_saturday = '00:00-00:00',
-$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)
- -This file is part of cd_nagios.
- -cd_nagios is used for providing automatic configuration of Nagios - -Copyright (C) 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/. -notifications. -for the defined service or host.
- -
- - - -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- |
-
- # File 'manifests/nagios/objects/templates.pp', line 100
-
-define cd_nagios::nagios::objects::templates (
-$ng_template_object = undef,
-$ng_template_object_name = undef,
-$ng_svc_notification_period = '24x7',
-$ng_host_notification_period = '24x7',
-$ng_service_notification_options = 'w,u,c,r,f,s',
-$ng_host_notification_options = 'd,u,r,f,s',
-$ng_service_notification_commands = 'notify-service-by-email',
-$ng_host_notification_commands = 'notify-host-by-email',
-$ng_object_register = '0',
-$ng_template_object_use = undef,
-$ng_notifications_enabled = '1',
-$ng_event_handler_enabled = '1',
-$ng_flap_detection_enabled = '1',
-$ng_process_perf_data = '1',
-$ng_retain_status_information = '1',
-$ng_retain_nonstatus_information = '1',
-$ng_notification_period = '24x7',
-$ng_notification_interval = '30',
-$ng_check_period = '24x7',
-$ng_check_interval = '5',
-$ng_retry_interval = '1',
-$ng_max_check_attempts = '10',
-$ng_host_check_command = 'check-host-alive',
-$ng_notification_options = undef,
-$ng_contact_groups = 'admins',
-$ng_active_checks_enabled = '1',
-$ng_passive_checks_enabled = '1',
-$ng_parallelize_check = '1',
-$ng_obsess_over_service = '1',
-$ng_check_freshness = '0',
-$ng_is_volatile = '0',
-$ng_check_interval = '10',
-$ng_retry_interval = '2',
-
-
-) {
-$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::server::access.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 (C) 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/.
- -
- - - -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/server/access.pp', line 26
-
-define cd_nagios::server::access (
-
-$ng_htpasswd_user = undef,
-$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),
- }
- }
-}
- |
-