Mount Point missing alarm

27 views
Skip to first unread message

s.saurab...@gmail.com

unread,
Feb 28, 2021, 4:56:10 AM2/28/21
to Prometheus Developers

Hi Everyone,

I have specific requirement from the client that prometheus should generate alert in case any mount point on the server goes missing.

For Eg: If server has 3 mount points like /data1 /NFS1 /NFS2 and if by any reason ,/NFS2 gets delinked from the server in that case prometheus should generate alert.

When I tried with below query,it is working fine(as this metric goes missing when /NFS2 got delinked from the server)

absent(node_filesystem_readonly{device="XX:/NFS2",fstype="nfs2",hostname="EAST_WB_XX",instance="XX:9100",job="XX",mountpoint="/NFS2"}) == 1

However there are 800 servers which are required to get monitor therefore it is not possible to add 800 rules for each IP in the rules.yml.

When I add below rule,it didn't generate the missing alert.

absent(node_filesystem_readonly{mountpoint="/NFS2"}) == 1

Please advice if we can achieve this with some tweaking in the query so that it can be generic for all servers.

Looking forward for your response.

Thanks,
Saurabh

Matthias Rampke

unread,
Mar 5, 2021, 4:29:39 PM3/5/21
to s.saurab...@gmail.com, Prometheus Users
Moving this to prometheus-users where it fits better.

Try using the "unless" operator to compare against a metric that is present for all instances that should have this mountpoint. Assuming that is the case for all targets under this job:

up{job=XX"}  unless on(instance) node_filesystem_readonly{fstype="nfs2",mountpoint="/NFS2"}

(or something like that) The idea is that any instance of this job is suspect, unless it has the mount point specific metric.

/MR


--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/d95c5b8d-d81b-4152-882d-6a0d0e54954an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages