
Check if FS is Mounted (check_mount.sh) AIX, NFS, UNIX, Linux, Solaris
Description:
Shell Script for Nagios, checks if the FS given is mounted. Assumes that you are checking NFS by default, but it can check for any type of FS:
NFS, NFSv4, CIFS, JFS, JFS2, EXT2, EXT3, EXT4, etc (If a FS is mounted more than once it gives a Warning & reports the number of mounts).
This script do not check fstab or /etc/filesystem or other tab entries, as it is designed to consume as little CPU time as possible and to be used in different OS types.
It is a simple script, but it detects mounts of practically any type of FS, and multiple instances mounted of the same FS.
Verified compatible with the following OS:
IBM AIX v5.2-v7.2
RHEL v4.8-v6.6, RHL v9
Ubuntu v10.04-v18.04 LTS
SuSe v11
CentOS v6.5-10
CygWin v2.0.4-v2.5.1 & BusyBox v1.22.1
Oracle Solaris x86 v10-v11.3
SCO OpenServer v6.0.0
SCO UnixWare v7.1.4+, v7.1.4
Released under GPLv3. Author: Carlos Ijalba – 2016-2018.
Current Version
1.02
Last Release Date
2018-08-21
Compatible With
- Nagios 3.x
- Nagios 4.x
- Nagios XI
Owner
Website
License
GPL
Project Files
File | Description |
---|---|
check_mount.sh | check_mount.sh shell script |
Project Notes
Old line 107:
MOUNTED=`mount | grep $MOUNT | grep $FS | wc -l | tr -s " "` # execute the command to check the mount...
New line 107:
MOUNTED=`mount | grep "$MOUNT" | grep " $FS " | wc -l | tr -s " "` # execute the command to check the mount...
Thanks for the bug report candreasen, I have modified the script with a bug correction and added a small CPU & memory speedup.
Note that your suggested line also won't work correctly in all OS, so i have only put one space after the FS, to act as a delimiter, and removed the space before the FS.
I will post the updated script now.
Add a Review
You must be logged in to submit a review.
Thank you for your review!
Your review has been submitted and is pending approval.
Recommend
To:
From:
Thank you for your recommendation!
Your recommendation has been sent.