Puppet Class: monit
- Inherits:
- monit::params
- Defined in:
- manifests/init.pp
Overview
monit
This class is the responsible of installing and configuring the Monit service. Almost all configuration options for ‘monitrc` are exposed as class parameters.
In addition to Monit configuration options, this class accepts other parameters:
* `init_system`, to set globally the default init system for `service` checks.
* `checks`, to provide checks from Hiera.
Lastly, this class also configures a ‘system` check with sane defaults. It can be disabled or tweaked to fit your needs. See the set of parameters starting with `system_`.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'manifests/init.pp', line 108
class monit (
Boolean $service_enable = true,
Enum[
'running',
'stopped'
] $service_ensure = 'running',
Stdlib::Absolutepath $conf_file = $monit::params::conf_file,
Stdlib::Absolutepath $conf_dir = $monit::params::conf_dir,
Boolean $conf_purge = true,
Integer $check_interval = $monit::params::check_interval,
Integer $check_start_delay = $monit::params::check_start_delay,
# $logfile can be an absolute path or
# a string of the form "syslog facility log_daemon"
Variant[
Stdlib::Absolutepath,
Pattern['^syslog( facility [_a-zA-Z0-9]+)?$']
] $logfile = $monit::params::logfile,
Optional[Stdlib::Absolutepath] $idfile = $monit::params::idfile,
Optional[Stdlib::Absolutepath] $statefile = $monit::params::statefile,
Boolean $eventqueue = $monit::params::eventqueue,
Stdlib::Absolutepath $eventqueue_basedir = '/var/monit',
Integer $eventqueue_slots = 100,
Optional[Stdlib::Httpurl] $mmonit_url = undef,
Optional[String] $mailserver = undef,
String $mailformat_from = "monit@${facts['networking']['fqdn']}",
# NOTE: reply-to available since monit 5.2
Optional[String] $mailformat_replyto = undef,
Optional[String] $mailformat_subject = undef,
Optional[String] $mailformat_message = undef,
Array[String] $alerts = [],
Boolean $httpserver = true,
Integer[1024, 65535] $httpserver_port = 2812,
Optional[String] $httpserver_bind_address = undef,
Boolean $httpserver_ssl = false,
Optional[
Stdlib::Absolutepath
] $httpserver_pemfile = undef,
Array[String] $httpserver_allow = ['localhost'],
# Init system defaults.
Enum[
'sysv',
'systemd',
'upstart'
] $init_system = $monit::params::init_system,
Stdlib::Absolutepath $service_program = $monit::params::service_program,
# System resources check.
Monit::Check::Ensure $system_check_ensure = 'present',
Numeric $system_loadavg_1min = (3 * $::facts['processors']['count']),
Numeric $system_loadavg_5min = (1.5 * $::facts['processors']['count']),
Numeric $system_loadavg_15min = (1.5 * $::facts['processors']['count']),
String $system_cpu_user = '75%',
String $system_cpu_system = '30%',
String $system_cpu_wait = '30%',
String $system_memory = '75%',
# NOTE: swap available since monit 5.2.
Optional[String] $system_swap = undef,
Variant[
Array[Stdlib::Absolutepath],
Array[Pattern['^/']]
] $system_fs = [],
String $system_fs_space_usage = '80%',
String $system_fs_inode_usage = '80%',
Optional[Integer] $system_cycles = undef,
Array[String] $fs_banned_types = ['devpts', 'devtmpfs', 'hugetlbfs', 'mqueue', 'nsfs', 'overlay', 'rpc_pipefs', 'tmpfs'],
Optional[Array[String]] $system_ifaces = undef,
# Additional checks.
Hash[String, Hash] $checks = {},
Optional[Enum[
'hiera_hash',
]] $hiera_merge_strategy = undef,
) inherits monit::params {
if !empty($hiera_merge_strategy) {
warning('\$hiera_merge_strategy parameter is deprecated and will be removed in future versions! Please use Hiera 5 `lookup_options` instead. See https://puppet.com/docs/puppet/latest/hiera_merging.html')
}
class { 'monit::install': }
-> class { 'monit::config': }
~> class { 'monit::service': }
-> Class['monit']
}
|