Role for Ansible, which installs Monit and setups services monitoring.
Typical minimal usage:
- role: monit
Configure monit without installation and with custom service:
- role: monit
monit_setup: configure
monit_custom_services:
consul: {group: monitoring, pid: /var/run/consul/consul.pid, checks: [
{type: host, host: "127.0.0.1", port: 8301, timeout: 30, action: alert}
]}
Make sure that you call this role after the netdata role, if used together. Otherwise netdata presence will not be automatically detected and cfg generation for it will be skipped.
Main parameters:
Param | Default | Description |
---|---|---|
monit_setup |
full |
Setup mode. See OSSHelp KB article |
monit_custom_services |
{} |
Custom services |
Service parameters monit_custom_services.service_name: {parameters}
:
Param | Default | Description |
---|---|---|
pid |
- | Documentation |
path |
- | Documentation |
poll_time |
- | Documentation |
group |
- | Documentation |
checks |
- | Checks list |
Checks parameters monit_custom_services.service_name: {checks:[{parameters}]}
:
Param | Default | Description |
---|---|---|
type |
- | Supported types: size , host , socket . Documentation |
timeout |
- | Check timeout |
times |
- | Check times |
cycles |
- | Check cycles |
action |
alert |
Check action |
operator |
EQUAL |
For size type only. Documentation |
value |
0 |
For size type only. Documentation |
host |
- | For host type only. Documentation |
port |
- | For host type only. Documentation |
port_type |
- | For host and socket types only. Documentation |
protocol |
- | For host and socket types only. Documentation |
request |
- | For host and socket types only. Documentation |
path |
- | For socket type only. Documentation |
Should not be changed usually.
Param | Default | Description |
---|---|---|
monit_hostname |
{{ inventory_hostname }} |
Hostname for hlreport check |
monit_highload_la_1m |
15 |
1m LA value for hlreport |
monit_highload_la_5m |
10 |
5m LA value for hlreport |
monit_daemon_interval |
120 |
Check interval |
monit_start_delay |
120 |
Start delay |
monit_port |
2812 |
Listen port |
monit_address |
127.0.0.1 |
Listen address |
monit_allow_hosts |
[] |
List of host allowed to direct connect to Monit |
All serviсes are restarted by default on unsuccessful availability checks, except for:
- mysql
- mongod
- rabbitmq-server
- redis-server
- docker
...
GPL3
OSSHelp Team, see https://oss.help