First, turn your idea into something expressed as prometheus metrics. What 
condition do you want to test on? Is it when a particular metric exists 
with a particular value? (Like a metric which is 1 when mounted and 0 when 
not mounted)?  Or when a particular metric with a particular set of labels 
*does 
not exist at all*?

In the latter case, the absent() function may be what you're looking for. 
e.g.

expr: absent(node_filesystem_avail_bytes{instance="nuc2", 
mountpoint="/boot/efi"})

Note that any "expr" you use for alerting can be tested simply by pasting 
it into the PromQL browser in the Prometheus web interface.  If it returns 
an empty result set, then the alert is not firing.  If it returns a 
non-empty result (i.e. 1 or more timeseries), then this is the set of 
alerts which will fire, regardless of their value.

On Friday, 9 June 2023 at 13:51:13 UTC+1 EL VEAUCER wrote:

> Hello, I need some helps about how to monitor a specific mountpountwhich  
> is not mounted such as each time when the filesystem is umount, I can 
> receive an alert.
>
> Thanks for your help,
> Elveaucer
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/e19af34c-25f9-460a-80ef-5439ee322b5fn%40googlegroups.com.

Reply via email to