[] (https://travis-ci.org/echoes-tech/puppet-monit) [] (https://flattr.com/submit/auto?user_id=echoes&url=https://forge.puppetlabs.com/echoes/monit&title=Puppet%20module%20to%20manage%20Monit&description=This%20module%20installs%20and%20configures%20Monit.%20It%20allows%20you%20to%20enable%20HTTP%20Dashboard%20an%20to%20add%20check%20from%20a%20file.&lang=en_GB&category=software "Puppet module to manage Monit installation and configuration")
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with monit
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Contributors
Puppet module to manage Monit installation and configuration.
This module installs and configures Monit. It allows you to enable HTTP Dashboard an to add check from a file.
WARNING: For RedHat systems, you may need to add an additional repository like the EPEL repository. You can use the module stahnma-epel to do this.
Supports Puppet v3 (optionally with future parser) and v4 with Ruby versions 1.8.7 (Puppet v3 only), 1.9.3, 2.0.0 and 2.1.0.
include ::monit
class { 'monit':
httpd => true,
httpd_address => '172.16.0.3',
httpd_password => 'CHANGE_ME',
}
Using the source parameter:
monit::check { 'ntp':
source => "puppet:///modules/${module_name}/ntp",
}
Or using the content parameter with a string:
monit::check { 'ntp':
content => 'check process ntpd with pidfile /var/run/ntpd.pid
start program = "/etc/init.d/ntpd start"
stop program = "/etc/init.d/ntpd stop"
if failed host 127.0.0.1 port 123 type udp then alert
if 5 restarts within 5 cycles then timeout
',
}
Or using the content parameter with a template:
monit::check { 'ntp':
content => template("${module_name}/ntp.erb"),
}
monit::check { 'ntp':
ensure => absent,
}
- monit: Main class, includes all other classes.
- monit::params: Sets parameter defaults per operating system.
- monit::install: Handles the packages.
- monit::config: Handles the configuration file.
- monit::service: Handles the service.
- monit::firewall: Handles the firewall configuration.
The following parameters are available in the ::monit
class:
Specifies one or more email addresses to send global alerts to. Valid options: array. Default value: []
Specifies global alert context in the form only on { timeout, nonexist }
or but not on { instance }
. See: https://mmonit.com/monit/documentation/monit.html#Setting-an-event-filter Default value: ''
Specifies the interval between two checks of Monit. Valid options: numeric. Default value: 120
Specifies a path to the main config file. Valid options: string. Default value: varies with operating system
Specifies a path to the config directory. Valid options: string. Default value: varies with operating system
Specifies if unmanaged files in the config directory should be purged. Valid options: 'true' or 'false'. Default value: 'false'
Specifies whether to enable the Monit Dashboard. Valid options: 'true' or 'false'. Default value: 'false'
Specifies the port of the Monit Dashboard. Valid options: numeric. Default value: 2812
Specifies the IP address of the Monit Dashboard. Valid options: string. Default value: 'locahost'
Specifies the user to access the Monit Dashboard. Valid options: string. Default value: 'admin'
Specifies the password to access the Monit Dashboard. Valid options: string. Default value: 'monit'
Specifies the logfile directive value. Valid options: string. Default value: '/var/log/monit.log'
It is possible to use syslog instead of direct file logging. (e.g. 'syslog facility log_daemon')
If set to a string, alerts will be sent by email to this mailserver. Valid options: string. Default value: undef
For more details, see: https://mmonit.com/monit/documentation/monit.html#Setting-a-mail-server-for-alert-delivery
Specifies the alert message format. Valid options: hash. Default value: undef
For more details, see: https://mmonit.com/monit/documentation/monit.html#Message-format
If true and if puppetlabs-firewall module is present, Puppet manages firewall to allow HTTP access for Monit Dashboard. Valid options: 'true' or 'false'. Default value: 'false'
Specifies the remote address of an M/Monit server to be used by Monit agent for report. If set to undef, M/Monit connection is disabled. Valid options: string. Default value: undef
Specifies the remote port of the M/Monit server. Valid options: numeric. Default value: 8080
Specifies the user to connect to the remote M/Monit server. Valid options: string. Default value: 'monit'
If you set both user and password to an empty string, authentication is disabled.
Specifies the password of the account used to connect to the remote M/Monit server. Valid options: string. Default value: 'monit'
If you set both user and password to an empty string, authentication is disabled.
By default Monit registers credentials with M/Monit so M/Monit can smoothly communicate back to Monit and you don't have to register Monit credentials manually in M/Monit. It is possible to disable credential registration setting this option to 'true'. Valid options: 'true' or 'false'. Default value: 'false'
Tells Puppet whether the Monit package should be installed, and what version. Valid options: 'present', 'latest', or a specific version number. Default value: 'present'
Tells Puppet what Monit package to manage. Valid options: string. Default value: 'monit'
Tells Puppet whether the Monit service should be running. Valid options: 'running' or 'stopped'. Default value: 'running'
Tells Puppet whether to manage the Monit service. Valid options: 'true' or 'false'. Default value: 'true'
Tells Puppet what Monit service to manage. Valid options: string. Default value: 'monit'
If set, Monit will wait the specified time in seconds before it starts checking services. Valid options: numeric. Default value: 0
- monit::check: Adds a Monit check.
The following parameters are available in the ::monit::check
define:
Tells Puppet whether the check should exist. Valid options: 'present', 'absent'. Default value: present
Tells Puppet what is the path of the configuration file. Valid options: string. Exclusive with the content
parameter. Default value: undef
Specifies the content of the configuration file. Valid options: string. Exclusive with the source
parameter. Default value: undef
Tells Puppet which Monit package is required. Valid options: string. Default value: 'monit'
Tells Puppet which Monit service will be notify. Valid options: string. Default value: 'monit'
RedHat and Debian family OSes are officially supported. Tested and built on Debian and CentOS.
Echoes Technologies modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great.
The list of contributors can be found at: https://github.com/echoes-tech/puppet-monit/graphs/contributors