Skip to main content

About

check_mount is a Nagios/Icinga plugin for checking for the presence of mounted filesystems.

Sometimes, it is only important to monitor the presence of a mount, and not the amount of free (or used) storage on that filesystem. For example, when monitoring NFS clients it may be redundant to use check_disk to monitor the NFS mounts because the amount of free storage on those mounts is monitored elsewhere. Additionally, check_disk can give a false negative if the filesystem is not mounted at all, but the directory used as a mount point is present.

Usage

usage: check_mount [-h] [-w RANGE] [-c RANGE] [-p PATH] [-t TYPE] [-M PATH]
                   [-v]

optional arguments:
  -h, --help            show this help message and exit
  -w RANGE, --warning RANGE
                        Generate warning state if number of mounts is outside
                        this range
  -c RANGE, --critical RANGE
                        Generate critical state if number of mounts is
                        outside this range
  -p PATH, --path PATH  A mount point to check to ensure it is present. May
                        be specified more than once. This option is
                        incompatible with --type.
  -t TYPE, --type TYPE  Only check mounts of a particular type. If specified
                        more than once, the count of present mounts will
                        include all mounts of all types specified. This
                        option is incompatible with --path.
  -M PATH, --mount-path PATH
                        Override the path to mount(8) [Default: /sbin/mount]
  -v, --verbose         Increase output verbosity (use up to 3 times).

Counting Mounts

If you’re only concerned with making sure the correct number of mounts are present, you can set a warning/critical range.

To warn if anything other than exactly 5 filesystems are mounted:

check_mount -w 5:5

To retun critical if fewer than 5 filesystems are mounted, and a warning if more than 5 are mounted:

check_mount -w :5 -c 5:

Checking Mounts by Type

If you’re only concerned with a particular type of mount, for example you want to ensure that all of your network mounts are present, but ignore any others, you can supply a list of filesystem types to check_mount.

To look only at AFS and NFS mounts, and to expect exactly 2 total mounts (one of each):

check_mount -t NFS -t AFS -w 2:2

By default, check_mount ignores several filessytem pseudo-types. Ignoring these can be overridden by specifying them, along with any other types you would like to check, on the command line. Filesystem types ignored by default are:

autofs      bpf         cgroup      cgroup2     debugfs
devpts      devtmpfs    hugetlbfs   mqueue      proc
pstore      securityfs  sysfs       tmpfs

Checking Specific Mount Points

If you wish to check specific mount points you can specify one or more on the command line with the –path argument:

check_mount -p /home -w1:1

Unlike other modes of operation, when checking specific mount points check_mount applies the warning and critical ranges to each individual mount, rather than the sum of all mounts. This allows check_mount to include the names of specific mounts in its error message. So, if you’re checking three different mount points this way, and you want to return a critical alert if any of them are missing, you would use a command like this:

check_mount -p /home -p /var -p /opt -c1:1

Release files for check-mount 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for check-mount 1.1.0
File Size Uploaded
check-mount-1.1.0.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for check-mount 1.1.0
File Interpreter ABI Platform
check_mount-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.7 kB

Release files / check-mount-1.1.0.tar.gz

Download URL check-mount-1.1.0.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
632c5d0743d024204009d0af79d251ddbf20e3332e149659257e1c12a430823f
BLAKE2b-256 checksum
How to use checksums
4a992496fee206b2258faa6ef541ce0b7e58d2335ef72c2f3047e78dd26adc6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

Release files / check_mount-1.1.0-py3-none-any.whl

Download URL check_mount-1.1.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fad9d3daa9c00c8d259e9ebee2b7e45d9c5385770a9fab61510a606fce2a0b9
BLAKE2b-256 checksum
How to use checksums
afa7394bd0e653ac3b374a158639ddce5bc145b857dc0007a91bc9db54603af9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page