Re: Monitoring NFS mounts

Oliver Skibbe <[email protected]> Tue, 18 Dec 2018 09:20:29 +0100
Newsgroups gmane.network.nagios.plugins
Message-ID <CA+EV5Hk6WFCcSEk=w=7_UmUqy6=4zP06DYB7Ua=RRwHaWWVGqg__39123.2323171154$1545121122$gmane$org@mail.gmail.com>
--000000000000b1f9fc057d479255
Content-Type: text/plain; charset="UTF-8"

Hi Matthew,

I'm using check_snmp on OID: HOST-RESOURCES-MIB::hrFSRemoteMountPoint

You will get an output, like this:
HOST-RESOURCES-MIB::hrFSRemoteMountPoint.29 = STRING: "10.224.6.25:
/data/nfs/cp_backup"

The related check_snmp command would look like this:
-o HOST-RESOURCES-MIB::hrFSRemoteMountPoint.29 -s '"10.224.6.25:
/data/nfs/cp_backup"'

If you combine this and check_disk via check_multi, you should get an
accurate result.

Be aware, that the hrFSRemoteMountPoint.N may change during a reboot, but
you could also different script to get all RemoteMountPoints and search for
the desired one.

Regards
Oliver

Am Mo., 17. Dez. 2018, 18:18 hat Matthew Pounsett <[email protected]>
geschrieben:

>
> Before I start writing code that might be reinventing the wheel... does
> anyone have a favourite method for monitoring the presence of an NFS
> mount?
>
> check_disk is fine if the NFS volume is mounted and something goes wrong
> with it (like the NFS server going down) but gives a false positive if the
> volume simply isn't mounted.  In that case it gives an OK result based on
> the closest enclosing volume of the mount point.
>
> For example, if I'm using check_disk to monitor an NFS volume mounted at
> /mnt/foo, it will correctly fail if the remote NFS server stops responding,
> but will report success if I 'umount /mnt/foo'.  In that case it'll report
> OK and give the stats for the root ("/") volume.
>
>
>

--000000000000b1f9fc057d479255
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div di=
r=3D"ltr"><div>Hi Matthew,</div><div><br></div><div>I&#39;m using check_snm=
p on OID:=C2=A0HOST-RESOURCES-MIB::hrFSRemoteMountPoint</div><div><br></div=
><div>You will get an output, like this:=C2=A0</div><div><div>HOST-RESOURCE=
S-MIB::hrFSRemoteMountPoint.29 =3D STRING: &quot;10.224.6.25:/data/nfs/cp_b=
ackup&quot;</div></div><div><br></div>The related check_snmp command would =
look like this:=C2=A0</div><div dir=3D"ltr">-o HOST-RESOURCES-MIB::hrFSRemo=
teMountPoint.29 -s &#39;&quot;10.224.6.25:/data/nfs/cp_backup&quot;&#39;</d=
iv><div dir=3D"ltr"><br></div><div dir=3D"ltr">If you combine this and chec=
k_disk via check_multi, you should get an accurate result.</div><div dir=3D=
"ltr"><br></div><div dir=3D"ltr">Be aware, that the hrFSRemoteMountPoint.N =
may change during a reboot, but you could also different script to get all =
RemoteMountPoints and search for the desired one.</div><div dir=3D"ltr"><br=
></div><div dir=3D"ltr">Regards<br>Oliver</div><div dir=3D"ltr"><br><div cl=
ass=3D"gmail_quote"><div dir=3D"ltr">Am Mo., 17. Dez. 2018, 18:18 hat Matth=
ew Pounsett &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">mat=
[email protected]</a>&gt; geschrieben:<br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex"><div dir=3D"ltr"><br><div>Before I start writing code =
that might be reinventing the wheel... does anyone have a favourite method =
for monitoring the presence of an NFS mount?=C2=A0=C2=A0</div><div><br></di=
v><div>check_disk is fine if the NFS volume is mounted and something goes w=
rong with it (like the NFS server going down) but gives a false positive if=
 the volume simply isn&#39;t mounted.=C2=A0 In that case it gives an OK res=
ult based on the closest enclosing volume of the mount point.</div><div><br=
></div><div>For example, if I&#39;m using check_disk to monitor an NFS volu=
me mounted at /mnt/foo, it will correctly fail if the remote NFS server sto=
ps responding, but will report success if I &#39;umount /mnt/foo&#39;.=C2=
=A0 In that case it&#39;ll report OK and give the stats for the root (&quot=
;/&quot;) volume.</div><div><br></div><div><br></div></div>
</blockquote></div>
</div></div></div></div></div>

--000000000000b1f9fc057d479255--