1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-10-23 11:56:59 +02:00
ansible-collection-prometheus/roles/prometheus/templates/blackbox.yml

209 lines
4.8 KiB
YAML
Raw Normal View History

2020-11-13 10:36:46 +01:00
---
{{ ansible_managed | comment }}
modules:
http_2xx:
prober: http
http:
valid_status_codes:
- 200
- 204 # No content is ok, often returned by some APIs
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
tls_config:
insecure_skip_verify: true
# A simple ICMP probe, used for network equipment, such as switches
icmp:
prober: icmp
# Check that the address returns a 401 Unautorized when queried without user credentials
http_auth_required:
prober: http
http:
valid_status_codes:
- 401
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
tls_config:
insecure_skip_verify: true
http_modified:
prober: http
http:
valid_status_codes:
- 200
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
tls_config:
insecure_skip_verify: true
ssh:
prober: tcp
timeout: 2s
tcp:
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
query_response:
- expect: "^SSH-2.0.*"
tls:
prober: tcp
timeout: 2s
tcp:
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
tls: true
znc:
prober: tcp
timeout: 2s
tcp:
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
tls: true
query_response:
- send: "PASS :{{ blackbox_znc_pass }}\r\n"
- send: "NICK {{ blackbox_znc_nick }}\r\n"
- send: "USER {{ blackbox_znc_nick }} * * :{{ blackbox_znc_fullname }}\r\n"
- expect: "^:.* 464 {{ blackbox_znc_nick }} :.*$"
irc:
prober: tcp
timeout: 2s
tcp:
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
query_response:
- send: "NICK {{ blackbox_irc_nick }}\r\n"
- send: "USER {{ blackbox_irc_nick }} * * :{{ blackbox_irc_fullname }}\r\n"
- expect: "^:.* {{ blackbox_irc_nick }} :.*$"
ircs:
prober: tcp
timeout: 2s
tcp:
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
tls: true
{% if blackbox_ircs_tlsname is defined -%}
tls_config:
server_name: "{{ blackbox_ircs_tlsname }}"
{% endif -%}
query_response:
- send: "NICK {{ blackbox_ircs_nick }}\r\n"
- send: "USER {{ blackbox_ircs_nick }} * * :{{ blackbox_ircs_fullname }}\r\n"
- expect: "^:.* {{ blackbox_ircs_nick }} :.*$"
smtp:
prober: tcp
timeout: 2s
tcp:
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
query_response:
- expect: "^220 .*SMTP .*$"
- send: "HELO {{ blackbox_smtp_name }}"
- expect: "^250 .*$"
- send: "QUIT"
2021-02-20 21:45:11 +01:00
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"
2020-11-13 10:36:46 +01:00
smtps:
prober: tcp
timeout: 2s
tcp:
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
tls: true
query_response:
- expect: "^220 .*SMTP .*$"
- send: "HELO {{ blackbox_smtp_name }}"
- expect: "^250 .*$"
- send: "QUIT"
2021-02-20 21:43:24 +01:00
submission_starttls:
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"
2020-11-13 10:36:46 +01:00
imap:
prober: tcp
timeout: 2s
tcp:
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
query_response:
- expect: "^\\* OK .*$"
imaps:
prober: tcp
timeout: 2s
tcp:
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
tls: true
query_response:
- expect: "^\\* OK .*$"
nextcloud_installed:
prober: http
http:
valid_status_codes:
- 200
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
tls_config:
insecure_skip_verify: true
fail_if_body_not_matches_regexp:
- "\"installed\":true"
nextcloud_maintenance:
prober: http
http:
valid_status_codes:
- 200
{% if blackbox_prefer_ipv4 -%}
preferred_ip_protocol: ip4
{% endif -%}
tls_config:
insecure_skip_verify: true
fail_if_body_not_matches_regexp:
- "\"maintenance\":false"
- "\"needsDbUpgrade\":false"