2025-05-12 15:56:17 +02:00
2025-05-12 16:00:28 +02:00
2025-05-12 15:56:17 +02:00
2021-09-13 15:04:33 +02:00
2021-09-13 13:51:42 +02:00
2025-05-12 15:59:03 +02:00
2017-07-20 14:47:24 +01:00
2025-05-12 15:56:17 +02:00

Readme

Build Status

[[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 defines and PuppetDB.

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 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

Features

Installation:

  • Nagios Server instance:

    • install httpd via cd_apache
    • install Nagios server binaries on Nagios server
  • Nagios clients:

    • install client binaries like nagios plugins etc.
    • include NRPE via cd_nrpe (optional)

Configuration

  • configure all aspects of Nagios on server
  • manage nagios service user
  • manage directories (filesystem permissions, selinux )
  • manage cgi.cfg through parameters
  • manage nagios.cfg through parameters
  • manage Nagios users through external Puppet rules via define
  • manage Nagios commands through Puppet exports
  • manage Nagios template definitions through external Puppet rules via define
  • manage Nagios main contacts through Puppet exports. Additional contacts can be created through external Puppet rules via define, to avoid having to alter the module code.
  • manage Nagios main contact groups through Puppet exports. Additional contact groups can be created through external Puppet rules via define, to avoid having to alter the module code.
  • manage Nagios main host groups through Puppet exports. Additional host groups can be created through external Puppet rules via define, to avoid having to alter the module code.
  • manage Nagios main service groups through Puppet exports. Additional service groups can be created through external Puppet rules via define, to avoid having to alter the module code.
  • manage Nagios main time periods through Puppet exports. Additional time periods can be created through external Puppet rules via define, to avoid having to alter the module code.
  • configure firewall (optional)
  • configure selinux policies (optional)
  • configure forwarding http to https (optional)
  • manage TLS certificates through certbot (optional)
  • manage $user$ arguments in resource file via define

Service

  • manage Nagios service on server

Monitoring

  • monitor Nagios host
  • monitor Nagios service
  • monitor clients:
    • ping
    • root partition
    • swap usage
    • logged-in local users
    • amount of total processes
    • amount of zombie processes
    • current Load

Repo Documentation

See the full Puppet documentation including parameters in docs/index.html

Dependencies

All dependencies must be included in the catalogue.

Deployment

  • native Puppet deployment

via site.pp or nodes.pp

node 'example.example.net' {
  include cd_nagios
}
  • through Foreman:

In order to apply parameters through Foreman, cd_nagios::params must be added to the host or host group in question.

See more details about class deployment on Confdroid.com.

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 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

This module can optionally setup certbot TLS certificate management for the front-end GUI. In order to do so, set $ng_enable_certbot as well as $ng_use_https to true (default). Effectively, this will manage the certs before even installing Nagios, so there will be no problems with the Nagios showing up with a self-signed certificate. Once enabled, the module will go and try to obtain a certificate automatically. For this to work, you need to have proper DNS resolution set up for your domain / nagios server. Certs are also automatically renewed.

If you prefer to use https but use self-signed certs or your own CA, simply set to false. This will point the SSL vhost config file to the default location for TLS certificates.

httpd vHost files

by default, Nagios creates its own nagios.conf file, which is not a vhost file and relies on the main ssl.conf. However, as Nagios might be running on a regular web server with various other web instances (not recommended through for performance reasons), we do not want to manage ssl.conf directly, hence the module creates a vhost for the SSL host.

Client Connections

In order to monitor clients, NAGIOS must be able to connect to them. There are multiple ways of doing so, the most common ones being NRPE and SSH. So far this module works through the usage of NRPE, which by default is enabled. Class cd_nagios::client::nrpe configures nrpe.cfg and opens the required firewall port on clients (optional,default).

Known Problems

  • Collected resources import ordering problem: The module might try to import collected facts before nagios is even installed.

Support

  • OS: CentOS 7
  • Puppet 5

Tests

  • Puppet Lint
    • excluded tests:
      • --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.
  • Puppet Parser
  • ERB Template Parser
  • Sonar Quality Gate

Contact Us

contact Us

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.

Description
A Puppet 8 module to install, configure and populate Nagios
Readme 1.5 MiB
Languages
Puppet 100%