[]
(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")
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,
}
The following parameters are available in the ::monit
class:
alert_emails
Specifies one or more email addresses to send global alerts to. Valid options: array. Default value: []
check_interval
Specifies the interval between two checks of Monit. Valid options: numeric. Default value: 120
config_file
Specifies a path to the main config file. Valid options: string. Default value: varies with operating system
config_dir
Specifies a path to the config directory. Valid options: string. Default value: varies with operating system
config_dir_purge
Specifies if unmanaged files in the config directory should be purged. Valid options: 'true' or 'false'. Default value: 'false'
httpd
Specifies whether to enable the Monit Dashboard. Valid options: 'true' or 'false'. Default value: 'false'
httpd_port
Specifies the port of the Monit Dashboard. Valid options: numeric. Default value: 2812
httpd_address
Specifies the IP address of the Monit Dashboard. Valid options: string. Default value: 'locahost'
httpd_user
Specifies the user to access the Monit Dashboard. Valid options: string. Default value: 'admin'
httpd_password
Specifies the password to access the Monit Dashboard. Valid options: string. Default value: 'monit'
logfile
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')
mailserver
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
mailformat
Specifies the alert message format. Valid options: hash. Default value: undef
For more details, see: https://mmonit.com/monit/documentation/monit.html#Message-format
manage_firewall
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'
mmonit_address
Requires at least Monit 5.0Specifies 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
mmonit_port
Requires at least Monit 5.0Specifies the remote port of the M/Monit server. Valid options: numeric. Default value: 8080
mmonit_user
Requires at least Monit 5.0Specifies 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.
mmonit_password
Requires at least Monit 5.0Specifies 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.
mmonit_without_credential
Requires at least Monit 5.0By 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'
package_ensure
Tells Puppet whether the Monit package should be installed, and what version. Valid options: 'present', 'latest', or a specific version number. Default value: 'present'
package_name
Tells Puppet what Monit package to manage. Valid options: string. Default value: 'monit'
service_ensure
Tells Puppet whether the Monit service should be running. Valid options: 'running' or 'stopped'. Default value: 'running'
service_manage
Tells Puppet whether to manage the Monit service. Valid options: 'true' or 'false'. Default value: 'true'
service_name
Tells Puppet what Monit service to manage. Valid options: string. Default value: 'monit'
start_delay
Requires at least Monit 5.0If set, Monit will wait the specified time in seconds before it starts checking services. Valid options: numeric. Default value: 0
The following parameters are available in the ::monit::check
define:
ensure
Tells Puppet whether the check should exist. Valid options: 'present', 'absent'. Default value: present
source
Tells Puppet what is the path of the configuration file. Valid options: string. Exclusive with the content
parameter. Default value: undef
content
Specifies the content of the configuration file. Valid options: string. Exclusive with the source
parameter. Default value: undef
package_name
Tells Puppet which Monit package is required. Valid options: string. Default value: 'monit'
service_name
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