Hi,
On 6/26/20 12:50 PM, Satyam Vishnoi wrote:
> I should get alert when below given /mapr nfs mount-point get detached .
>
>
> I am using following 2 metrics provided by node-exporter collector
> mountstats and nfs .
>
>
> Query-1 absent(node_filesystem_size_bytes {
> job="exporter_node",fstype="nfs" ,mountpoint="/mapr",instance=~".*:9100"
> }) ==1
>
>
> Query-2 rate(node_mountstats_nfs_age_seconds_total
> {export="localhost:/mapr"}[5m]) < 1
>
>
> My first query is providing me desired output but i have to hard-code
> instance value on it. the regex used above does not work. My second
> query with rate doesn't give me a stable value to put on alert .
Right, absent will only work if you know what to look for. However,
maybe Prometheus already has the required information in the form of
other series?
If you want to alert if any of your instances lacks a specific
mountpoint, you can try this:
up == 1 unless on(instance)
node_filesystem_size_bytes{fstype="nfs",mountpoint="/mapr"}
This selects all online nodes [1] and discards all nodes which do have
the mountpoint. What's left is all online nodes without the mountpoint,
which should be exactly what you were after.
Kind regards,
Christian
[1] You can also skip the == 1 part to check all nodes. However, it
usually makes little sense to place such an alert for offline nodes as I
assume you will alert on up != 1 anyway.
--
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/3b8c36f9-91b3-72db-ad31-45186e06e194%40hoffmann-christian.info.