Files
confdroid_nagios/README.md
2017-07-24 16:00:07 +01:00

7.5 KiB

Repo Name version Build Status
cd_nagios 0.0.0.8 Build Status

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

**__!!! 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!!! __**

Table of Contents

Features

Installation:

  • install httpd
  • install server binaries on Nagios server
  • install client binaries on clients

Configuration

  • configure all aspects of Nagios on server
  • manage directories (filesystem permissions, selinux )
  • manage cgi.cfg through parameters
  • manage nagios.cfg through parameters
  • manage nagios users through external Puppet rules via define
  • configure NRPE on clients (optional)
  • configure firewall (optional)
  • configure selinux policies (optional)
  • configure forwarding http to https including accesing the /nagios url directly (optional)
  • manage TLS certificates through certbot (optional)

Service

  • manage Nagios service on server
  • manage NRPE service on clients (optional)

Repo Structure

Repostructure has moved to REPOSTRUCTURE.md in repo.

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

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.

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.

Mandatory Parameters

The following parameters must be set to make the module logic work properly:

  • $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).

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

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

Known Problems

Support

  • OS: CentOS 6, 7
  • Puppet 3.x

Tests

  • Puppet Lint
    • excluded tests:
      • --no-class_inherits_from_params_class-check:relavant 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-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)

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.