Home Directory Plugins System Metrics File System check mountpoints like nfs, cifs, davfs, lustre, ocf2, etc.

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check mountpoints like nfs, cifs, davfs, lustre, ocf2, etc.

Rating
27 votes
Favoured:
6
Current Version
2.6
Last Release Date
2021-11-26
Compatible With
  • Nagios 3.x
Owner
License
MPL
Hits
166914
Files:
FileDescription
check_mountpoints.shcheck_mountpoints.sh
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Check if all specified nfs/cifs/davfs mounts exist and if they are correct implemented. That means we check /etc/fstab, the mountpoints in the filesystem and if they are mounted. It is written for Linux and Solaris, uses proc-Filesystem and was tested on

Debian,
OpenSuse 10.1 10.2 10.3 11.0, SLES 10.1 11.1
RHEL 5 6 7 8, CentOS 5 6 7 8
Solaris
FreeBSD

# changes 2.6
# - check only dataset type filesystem on zfs
# changes 2.5
# - add -E flag to exclude path
# - add yas3fs
# changes 2.4
# - add support for ext2
# changes 2.3
# - add support for btrfs
...
See script or github for full list of changes.
Usage:

Usage: $PROGNAME [-m FILE] $mountpoint [$mountpoint2 ...]
Usage: $PROGNAME -a
Usage: $PROGNAME -h,--help
Options:
-m FILE Use this mtab instead (default is /proc/mounts)
-f FILE Use this fstab instead (default is /etc/fstab)
-N NUMBER FS Field number in fstab (default: 3)
-M NUMBER Mount Field number in fstab (default: 2)
-T SECONDS Responsetime at which an NFS is declared as staled (default: 3)
-L Allow softlinks to be accepted instead of mount points
-i Ignore fstab. Don't fail just because mount isn't in fstab. (default: unset)
-a Autoselect mounts from fstab (default: unset)
-A Autoselect from fstab. Return OK if no mounts found. (default: unset)
-E PATH Use with -a or -A to exclude a path from fstab. Use '|' between paths for multiple. (default: unset)
-o When autoselecting mounts from fstab, ignore mounts having
noauto flag. (default: unset)
-w Writetest. Touch file $mountpoint/.mount_test_from_$(hostname) (default: unset)
-e ARGS Extra arguments for df (default: unset)
MOUNTPOINTS list of mountpoints to check. Ignored when -a is given

# --------------------------------------------------------------------
# now we check if the given parameters ...
# 1) ... exist in the /etc/fstab
# 2) ... are mounted
# 3) ... df -k gives no stale
# 4) ... exist on the filesystem
# 5) ... is writable (optional)

--------------------------------------------------------------------

This plugin is NOT developped by the Nagios Plugin group.
Please do not e-mail them for support on this plugin, since
they won't know what you're talking about.

For contact info, read the plugin itself...
Reviews (22)
byhypnoz, December 2, 2010
0 of 2 people found this review helpful
This was a good starting point, but I think I have improved on this template, while also simplifying it. Check out my modifications.

http://dpaste.de/nGQj/

One of the things I added was a reverse check, ot see if everything mounted on the system is also listed in fstab.
Owner's reply

The link is dead :(

bymomocello, September 4, 2010
2 of 2 people found this review helpful
Nice works,
I did a modification on the file to works on debian lenny.

Comment
#LIBEXEC="/usr/local/nagios/libexec"
Replace by
LIBEXEC="/usr/lib/nagios/plugins"
Owner's reply

The new Version 1.1 fix that. Just a little late ;-) Thanks for the hint.

Page 2 of 2