1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-11-25 03:01:08 +01:00

Add smtp+starttls blackbox check

This commit is contained in:
s3lph 2021-02-20 21:45:11 +01:00
parent 3ab49a7daf
commit 34057b68f7
2 changed files with 15 additions and 1 deletions

View file

@ -2,7 +2,7 @@
[targets] [targets]
{% for host in hostvars.keys() %} {% for host in hostvars.keys() %}
{% if hostvars[host].monitor_dnsbl | default(false) %} {% if hostvars[host].monitor_dnsbl | default('false') | bool %}
server={{ host }} server={{ host }}
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View file

@ -117,6 +117,20 @@ modules:
- expect: "^250 .*$" - expect: "^250 .*$"
- send: "QUIT" - send: "QUIT"
smtp_submission:
prober: tcp
timeout: 2s
tcp:
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
query_response:
- starttls: true
- expect: "^220 .*SMTP .*$"
- send: "HELO {{ blackbox_smtp_name }}"
- expect: "^250 .*$"
- send: "QUIT"
smtps: smtps:
prober: tcp prober: tcp
timeout: 2s timeout: 2s