2024-07-09 16:16:54 -05:00
|
|
|
# vim:ft=ansible:
|
2024-07-09 15:43:41 -05:00
|
|
|
---
|
|
|
|
global:
|
|
|
|
scrape_interval: 15s
|
|
|
|
evaluation_interval: 15s
|
|
|
|
|
|
|
|
scrape_configs:
|
2024-07-09 16:29:50 -05:00
|
|
|
# Default Prometheus job to monitor itself
|
2024-07-09 15:43:41 -05:00
|
|
|
- job_name: "prometheus"
|
|
|
|
static_configs:
|
2024-07-09 18:03:39 -05:00
|
|
|
- targets: ['localhost:9090']
|
|
|
|
|
|
|
|
# This is shipped by the Ansible role that deploys Prometheus
|
2024-07-10 00:46:25 -05:00
|
|
|
- job_name: "blackbox-ssh"
|
|
|
|
metrics_path: /probe
|
|
|
|
params:
|
|
|
|
module: [ssh_banner]
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
|
|
|
{% for host in groups['tags_nagios'] %}
|
|
|
|
- "{{ host }}:22"
|
|
|
|
{% endfor %}
|
|
|
|
relabel_configs:
|
|
|
|
- source_labels: [__address__]
|
|
|
|
target_label: __param_target
|
|
|
|
- source_labels: [__param_target]
|
|
|
|
target_label: instance
|
|
|
|
- target_label: __address__
|
|
|
|
replacement: blackbox:9115
|
|
|
|
- job_name: "blackbox-http"
|
2024-07-09 18:03:39 -05:00
|
|
|
metrics_path: /probe
|
|
|
|
params:
|
|
|
|
module: [http_2xx]
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
|
|
|
{% for host in groups['tags_nagios'] %}
|
2024-07-10 01:13:16 -05:00
|
|
|
{% set vars = hostvars[host] %}
|
2024-07-09 18:03:39 -05:00
|
|
|
{% for service in vars.services %}
|
|
|
|
{% for tag in service.tags %}
|
2024-07-10 00:27:52 -05:00
|
|
|
{# #}
|
2024-07-09 18:03:39 -05:00
|
|
|
{% if tag.slug == "nagios-checkhttps" %}
|
|
|
|
{% for port in service.ports %}
|
|
|
|
- "https://{{ service.name }}:{{ port }}"
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2024-07-10 00:27:52 -05:00
|
|
|
{# #}
|
|
|
|
{% if tag.slug == "nagios-checkmatrix" %}
|
|
|
|
{% for port in service.ports %}
|
|
|
|
- "https://{{ service.name }}:{{ port }}/health"
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{# #}
|
2024-07-09 18:03:39 -05:00
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
relabel_configs:
|
|
|
|
- source_labels: [__address__]
|
|
|
|
target_label: __param_target
|
|
|
|
- source_labels: [__param_target]
|
|
|
|
target_label: instance
|
|
|
|
- target_label: __address__
|
|
|
|
replacement: blackbox:9115
|
|
|
|
- job_name: "blackbox-exporter"
|
|
|
|
static_configs:
|
|
|
|
- targets: ['blackbox:9115']
|
2024-07-09 16:29:50 -05:00
|
|
|
|
2024-07-10 01:13:16 -05:00
|
|
|
# This job manages Minecraft servers, when we have them
|
|
|
|
- job_name: "minecraft"
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
|
|
|
{% for host in groups['tags_nagios'] %}
|
|
|
|
{% set vars = hostvars[host] %}
|
|
|
|
{% for service in vars.services %}
|
|
|
|
{% for tag in service.tags %}
|
|
|
|
{# #}
|
|
|
|
{% if tag.slug == "nagios-checkminecraft" %}
|
|
|
|
{% for port in service.ports %}
|
|
|
|
- "{{ host }}:{{ port }}"
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{# #}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
|
2024-07-09 16:29:50 -05:00
|
|
|
# These two jobs are included for every node in our inventory
|
2024-07-09 15:43:41 -05:00
|
|
|
- job_name: "node-exporter"
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
|
|
|
{% for host in groups['tags_nagios'] %}
|
|
|
|
- '{{ host }}:9100'
|
|
|
|
{% endfor %}
|
|
|
|
- job_name: "cadvisor-exporter"
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
|
|
|
{% for host in groups['tags_nagios'] %}
|
|
|
|
- '{{ host }}:9101'
|
|
|
|
{% endfor %}
|
2024-07-09 16:29:50 -05:00
|
|
|
|
|
|
|
# This container is used on every psql machine
|
|
|
|
- job_name: "psql-exporter"
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
|
|
|
{% for host in groups['tags_nagios-checkpgsql'] %}
|
|
|
|
- '{{ host }}:9102'
|
|
|
|
{% endfor %}
|