I am trying to create an prometheus-alert-expression that checks if a mountpoint is mounted and sends an alert if the mountpoint is missing .. The Idea was something like this:
groups:
- name: mountpoints
rules:
- alert: /ghome missing
expr: absent(node_filesystem_avail_bytes{mountpoint="/ghome", instance="my.machine.org:9100"})
for: 60s
labels:
severity: critical
annotations:
summary: "/ghome missing on ({{ $labels.instance }})."
description: "VALUE = {{ $value }}\n LABELS = {{ $labels }}"
This kinda works. But is there a way of passing a list/vector to the mountpoint(s) and/or instance(s).
Using this Expression I'll have to write an alert-rule for each instance and each mountpoint.
I had the Idea of trying regular-Expressions like
expr: absent(node_filesystem_avail_bytes{mountpoint=~"/ghome|/something|/other", instance=~"my.machine.org:9100|another.machine.org:9100"})
.. but this obviously does not work.
Does anybody have an idea how to implement this ?
Greetings
Volker