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


On Sun, Feb 28, 2021, 10:56 [email protected] <
[email protected]> wrote:

>
> 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
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/d95c5b8d-d81b-4152-882d-6a0d0e54954an%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-developers/d95c5b8d-d81b-4152-882d-6a0d0e54954an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-developers/CAMV%3D_gZwvdmqxufLMdaBcSpvab4epMgxU%2BBO7E%2Bu0L4xuCHKfg%40mail.gmail.com.

Reply via email to