This commit is contained in:
nd 2024-05-20 13:35:10 +02:00
commit dfa8092538
4 changed files with 26 additions and 3 deletions

View file

@ -275,3 +275,17 @@ prometheus_agent:
annotations: annotations:
title: '{%raw%}{{ $labels.instance }}: Uptime{%endraw%}' title: '{%raw%}{{ $labels.instance }}: Uptime{%endraw%}'
description: "Uptime is more than 30 days, please reboot soon" description: "Uptime is more than 30 days, please reboot soon"
AptUpgradesPending:
group: nodeexporter
enabled: True
alert: UpgradesPending
expr: |
sum(apt_upgrades_pending{job="node", instance="{{ inventory_hostname }}"}) > 0 or
sum(apt_upgrades_held{job="node", instance="{{ inventory_hostname }}"}) > 0
for: 25h
labels:
severity: warning
instance: "{{ inventory_hostname }}"
annotations:
title: '{%raw%}{{ $labels.instance }}: AptUpgradesPending{%endraw%}'
description: "Upgrades pending for more than 24 hours"

View file

@ -1,6 +1,8 @@
- name: install node-exporter - name: install node-exporter
apt: apt:
pkg: prometheus-node-exporter pkg:
- prometheus-node-exporter
- prometheus-node-exporter-collectors
- name: copy node-exporter config - name: copy node-exporter config
notify: restart node-exporter notify: restart node-exporter

View file

@ -35,3 +35,10 @@ scrape_configs:
labels: labels:
job: nginx job: nginx
__path__: /var/log/nginx/access-promtail.log __path__: /var/log/nginx/access-promtail.log
- job_name: postfix-bounces
static_configs:
- targets:
- localhost
labels:
job: postfix-bounces
__path__: /var/log/mailman3/bounce.log

View file

@ -93,8 +93,8 @@
{% for j in prometheus_agent.scrapers[item].proxy|d({}) %} {% for j in prometheus_agent.scrapers[item].proxy|d({}) %}
- job_name: "prometheus-agent - proxy - {{ j }} : {{ inventory_hostname }}" - job_name: "prometheus-agent - proxy - {{ j }} : {{ inventory_hostname }}"
scheme: https scheme: https
{% for i in ['scrape_timeout', 'scrape_interval', 'metrics_path'] if prometheus_agent[i] or i in prometheus_agent.agents.proxy.mappings[j] %} {% for i in ['scrape_timeout', 'scrape_interval', 'metrics_path', 'basic_auth'] if (i in prometheus_agent and prometheus_agent[i]) or (i in prometheus_agent.agents.proxy.mappings[j]) %}
{{ i }}: {{ prometheus_agent.agents.proxy.mappings[j].get(i, prometheus_agent[i]) }} {{ i }}: {{ prometheus_agent.agents.proxy.mappings[j].get(i, prometheus_agent[i])|to_json }}
{% endfor %} {% endfor %}
params: params:
{% for i in prometheus_agent.agents.proxy.mappings[j].params|d({}) %} {% for i in prometheus_agent.agents.proxy.mappings[j].params|d({}) %}