OP#436 add nagios hostgroups, and example groups and contacts

This commit is contained in:
2026-03-01 16:15:06 +01:00
parent e0a3ad9624
commit 796cc40f3e
2 changed files with 47 additions and 44 deletions

View File

@@ -7,14 +7,15 @@
- [Synopsis](#synopsis) - [Synopsis](#synopsis)
- [WARNING](#warning) - [WARNING](#warning)
- [Features](#features) - [Features](#features)
- [Repo Documentation](#repo-documentation)
- [Dependencies](#dependencies)
- [Deployment](#deployment)
- [Configuration](#configuration)
- [configuring UI user access](#configuring-ui-user-access) - [configuring UI user access](#configuring-ui-user-access)
- [Additional UI users](#additional-ui-users) - [Additional UI users](#additional-ui-users)
- [Adding contacts](#adding-contacts) - [Adding contacts](#adding-contacts)
- [Adding contact groups](#adding-contact-groups) - [Adding contact groups](#adding-contact-groups)
- [Adding host groups](#adding-host-groups) - [Adding host groups](#adding-host-groups)
- [Repo Documentation](#repo-documentation)
- [Dependencies](#dependencies)
- [Deployment](#deployment)
- [PuppetDB](#puppetdb) - [PuppetDB](#puppetdb)
- [SELINUX](#selinux) - [SELINUX](#selinux)
- [Support](#support) - [Support](#support)
@@ -43,6 +44,39 @@ At this stage, the module is being redeveloped and being built to the latest sta
- configures the main nagios configuration file and sets values as (pre)configured per values in params, which can be overwritten. - configures the main nagios configuration file and sets values as (pre)configured per values in params, which can be overwritten.
- if `ng_include_nrpe`is set to `true`, the confdroid_nrpe module is automatically applied on clients ([confdroid_nrpe](https://sourcecode.confdroid.com/confdroid/confdroid_nrpe) must be in the catalogue then) - if `ng_include_nrpe`is set to `true`, the confdroid_nrpe module is automatically applied on clients ([confdroid_nrpe](https://sourcecode.confdroid.com/confdroid/confdroid_nrpe) must be in the catalogue then)
## Repo Documentation
See the full Puppet documentation including parameters in `docs/index.html`
## Dependencies
All dependencies must be included in the catalogue.
- `puppetlabs-firewall`
- `puppetlabs-stdlib`
- `puppetlabs-concat`
- `puppetlabs-nagios_core`
## Deployment
- native Puppet deployment
via site.pp or nodes.pp
```ruby
node 'example.example.net' {
include confdroid_nagios
}
```
- through Foreman:
In order to apply parameters through Foreman, **__confdroid_nagios::params__*- must be added to the host or host group in question.
See [more details about class deployment on confdroid.com](https://confdroid.com/2017/05/deploying-our-puppet-modules/).
## Configuration
### configuring UI user access ### configuring UI user access
Main access to the user interface requires defining an administrative user and password via `ng_main_user` and `ng_main_password`. The password should be encrypted like this: Main access to the user interface requires defining an administrative user and password via `ng_main_user` and `ng_main_password`. The password should be encrypted like this:
@@ -112,37 +146,6 @@ In order to add host groups, address the define `confdroid_nagios::nagios::objec
Hosts will be populated through the target.pp dynamically. Hosts will be populated through the target.pp dynamically.
## Repo Documentation
See the full Puppet documentation including parameters in `docs/index.html`
## Dependencies
All dependencies must be included in the catalogue.
- `puppetlabs-firewall`
- `puppetlabs-stdlib`
- `puppetlabs-concat`
- `puppetlabs-nagios_core`
## Deployment
- native Puppet deployment
via site.pp or nodes.pp
```ruby
node 'example.example.net' {
include confdroid_nagios
}
```
- through Foreman:
In order to apply parameters through Foreman, **__confdroid_nagios::params__*- must be added to the host or host group in question.
See [more details about class deployment on confdroid.com](https://confdroid.com/2017/05/deploying-our-puppet-modules/).
## PuppetDB ## PuppetDB
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://gitlab.confdroid.com/puppet/cd_puppetdb) is available to automate this task for you as well within a few minutes. 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://gitlab.confdroid.com/puppet/cd_puppetdb) is available to automate this task for you as well within a few minutes.

View File

@@ -19,9 +19,9 @@
# with SSL termination in front of the Nagios web interface, so this is # with SSL termination in front of the Nagios web interface, so this is
# disabled by default. # disabled by default.
# @param [String] ng_main_user The username for the Nagios web interface. # @param [String] ng_main_user The username for the Nagios web interface.
# Default is 'nagios'. # Default is $ng_users.
# @param [String] ng_main_password The encrypted password for the Nagios web # @param [String] ng_main_password The encrypted password for the Nagios web
# interface. Default is 'nagios'. Must be properly encrypted using the # interface. Default is $ng_users. Must be properly encrypted using the
# htpasswd utility. # htpasswd utility.
# @param [String] ng_context_help Whether to enable the context help in the # @param [String] ng_context_help Whether to enable the context help in the
# Nagios web interface. Default is '1'. # Nagios web interface. Default is '1'.
@@ -57,7 +57,7 @@
# command with total processes. Default is '400'. # command with total processes. Default is '400'.
# @param [String] ng_procs_tot_param The parameters for the check_procs command # @param [String] ng_procs_tot_param The parameters for the check_procs command
# with total processes. Default is 'RDST'. # with total processes. Default is 'RDST'.
# @param [String] ng_procs_tot_ensure The ensure value for the check_procs # @param [String] ng_procs_tot_ens The ensure value for the check_procs
# command with total processes. Default is 'present'. # command with total processes. Default is 'present'.
# @param [String] ng_procs_z_warn The warning threshold for the check_procs # @param [String] ng_procs_z_warn The warning threshold for the check_procs
# command with zombie processes. Default is '10'. # command with zombie processes. Default is '10'.
@@ -98,12 +98,12 @@ class confdroid_nagios::params (
# main # main
String $ng_nagios_server = 'nagios.example.net', String $ng_nagios_server = 'nagios.example.net',
Array $ng_reqpackages_server = ['nagios','nagios-devel'], Array $ng_reqpackages_server = [$ng_users,'nagios-devel'],
Array $ng_reqpackages_client = ['net-snmp-utils','nagios-plugins','nagios-plugins-all','nagios-plugins-nrpe','nagios-common'], Array $ng_reqpackages_client = ['net-snmp-utils','nagios-plugins','nagios-plugins-all','nagios-plugins-nrpe','nagios-common'],
String $ng_pkg_ensure = 'present', String $ng_pkg_ensure = 'present',
Boolean $ng_include_nrpe = true, Boolean $ng_include_nrpe = true,
String $ng_main_user = 'nagios', String $ng_main_user = $ng_users,
String $ng_main_password = 'nagios', String $ng_main_password = $ng_users,
# contact groups # contact groups
String $ng_contactgroup_name = 'admins', String $ng_contactgroup_name = 'admins',
@@ -144,9 +144,9 @@ class confdroid_nagios::params (
String $ng_swap_crit = '10', String $ng_swap_crit = '10',
String $ng_swap_ensure = 'present', String $ng_swap_ensure = 'present',
# users # users
String 'nagios's_warn = '20', String $ng_users_warn = '20',
String 'nagios's_crit = '50', String $ng_users_crit = '50',
String 'nagios's_ensure = 'present', String $ng_users_ensure = 'present',
#total procs #total procs
String $ng_procs_tot_warn = '330', String $ng_procs_tot_warn = '330',
String $ng_procs_tot_crit = '400', String $ng_procs_tot_crit = '400',
@@ -170,7 +170,7 @@ class confdroid_nagios::params (
$os_release = $facts['os']['release']['major'] $os_release = $facts['os']['release']['major']
# service # service
$ng_nagios_service = 'nagios' $ng_nagios_service = $ng_users
# directories # directories
$ng_main_dir = '/etc/nagios' $ng_main_dir = '/etc/nagios'