33 lines
858 B
Plaintext
33 lines
858 B
Plaintext
|
# This file was generated by Ansible.
|
||
|
# Any changes made to this file will be lost.
|
||
|
|
||
|
{% for i in monit_hosts %}
|
||
|
check host {{ i.name }} with address {{ i.address }}
|
||
|
{% if i.group != '' %}
|
||
|
group {{ i.group }}
|
||
|
{% endif %}
|
||
|
{% for w in i.when %}
|
||
|
if failed
|
||
|
{% if w.http.enabled == true %}
|
||
|
port {{ w.http.port }}
|
||
|
protocol {{ w.http.protocol }}
|
||
|
request "{{ w.http.request }}"
|
||
|
{% if w.http.username != ''%}
|
||
|
username "{{ w.http.username }}"
|
||
|
{% endif %}
|
||
|
{% if w.http.password != ''%}
|
||
|
password "{{ w.http.password }}"
|
||
|
{% endif %}
|
||
|
{% endif %}
|
||
|
{% if w.then.alert == true %}
|
||
|
then alert
|
||
|
else if succeeded then alert
|
||
|
{% elif w.then.exec != '' %}
|
||
|
then exec {{ w.then.exec }}
|
||
|
else if succeeded then exec {{ w.then.exec }}
|
||
|
{% elif w.then.restart == true %}
|
||
|
then restart
|
||
|
{% endif %}
|
||
|
{% endfor %}
|
||
|
{% endfor %}
|