drivesize

check_drivesize

Checks the disk drive/volumes usage on a host.

Implementation

WindowsLinuxFreeBSDMacOSX

Examples

Default Check

check_drivesize drive=/ show-all
OK - / 280.155 GiB/455.948 GiB (64.7%) |...

Check drive including inodes:

check_drivesize drive=/ warn="used > 90%" "crit=used > 95%" "warn=inodes > 90%" "crit=inodes > 95%"
OK - All 1 drive(s) are ok |'/ used'=307515822080B;440613398938;465091921101;0;489570443264 '/ used %'=62.8%;90;95;0;100 '/ inodes'=12.1%;90;95;0;100

Check folder, no matter if its a mountpoint itself or not:

check_drivesize folder=/tmp show-all
OK - /tmp 280.155 GiB/455.948 GiB (64.7%) |...

Example using NRPE and Naemon

Naemon Config

define command{
    command_name         check_nrpe
    command_line         $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$
}

define service {
    host_name            testhost
    service_description  check_drivesize
    use                  generic-service
    check_command        check_nrpe!check_drivesize!'warn=used_pct > 90' 'crit=used_pct > 95'
}

Argument Defaults

ArgumentDefault Value
filterfstype not in (‘autofs’, ‘bdev’, ‘binfmt_misc’, ‘bpf’, ‘cgroup’, ‘cgroup2’, ‘configfs’, ‘cpuset’, ‘debugfs’, ‘devpts’, ‘devtmpfs’, ’efivarfs’, ‘fuse.portal’, ‘fusectl’, ‘hugetlbfs’, ‘mqueue’, ’nsfs’, ‘overlay’, ‘pipefs’, ‘proc’, ‘pstore’, ‘ramfs’, ‘rpc_pipefs’, ‘securityfs’, ‘selinuxfs’, ‘sockfs’, ‘sysfs’, ’tracefs’)
warningused_pct > 80
criticalused_pct > 90
empty-state3 (UNKNOWN)
empty-syntax%(status) - No drives found
top-syntax%(status) - ${problem_list}
ok-syntax%(status) - All %(count) drive(s) are ok
detail-syntax%(drive_or_name) %(used)/%(size) (%(used_pct | fmt=%.1f )%)

Check Specific Arguments

ArgumentDescription
driveThe drives to check, ex.: c: or /
excludeList of drives to exclude from check
folderThe folders to check (parent mountpoint)
freespace-ignore-reservedDon’t account root-reserved blocks into freespace, default: true
ignore-unreadableDeprecated, use filter instead
magicMagic number for use with scaling drive sizes. Note there is also a more generic magic factor in the perf-config option.
mountedDeprecated, use filter instead
totalInclude the total of all matching drives

Attributes

Filter Keywords

these can be used in filters and thresholds (along with the default attributes):

AttributeDescription
driveTechnical name of drive
nameDescriptive name of drive
idDrive or id of drive
drive_or_idDrive letter if present if not use id
drive_or_nameDrive letter if present if not use name
fstypeFilesystem type
mountedFlag wether drive is mounter (0/1)
freeFree (human readable) bytes
free_bytesNumber of free bytes
free_pctFree bytes in percent
user_freeNumber of total free bytes (from user perspective)
user_free_pctNumber of total % free space (from user perspective)
total_freeNumber of total free bytes
total_free_pctNumber of total % free space
usedUsed (human readable) bytes
used_bytesNumber of used bytes
used_pctUsed bytes in percent (from user perspective)
user_usedNumber of total used bytes (from user perspective)
user_used_pctNumber of total % used space
total_usedNumber of total used bytes (including root reserved)
total_used_pctNumber of total % used space (including root reserved)
sizeTotal size in human readable bytes
size_bytesTotal size in bytes
inodes_freeNumber of free inodes
inodes_free_pctNumber of free inodes in percent
inodes_totalNumber of total free inodes
inodes_usedNumber of used inodes
inodes_used_pctNumber of used inodes in percent
media_typeWindows only: numeric media type of drive
typeWindows only: type of drive, ex.: fixed, cdrom, ramdisk,…
readableWindows only: flag drive is readable (0/1)
writableWindows only: flag drive is writable (0/1)
removableWindows only: flag drive is removable (0/1)
erasableWindows only: flag wether if drive is erasable (0/1)
hotplugWindows only: flag drive is hotplugable (0/1)