License
MIT License
forked from nmollerup/check-disk-usage
v0.9.0 · public · Published 21 days ago
The Sensu disk usage check is a Sensu Check that reports on disk usage
allowing for the inclusion or exclusion of certain file systems and/or file
system types.
Cross platform disk usage check for Sensu
Usage:
check-disk-usage [flags]
check-disk-usage [command]
Available Commands:
help Help about any command
version Print the version number of this plugin
Flags:
-c, --critical float Critical threshold for file system usage (default 95)
-E, --exclude-fs-path strings Comma separated list of file system paths to exclude from checking
-e, --exclude-fs-type strings Comma separated list of file system types to exclude from checking
-f, --fail-on-error Fail and exit on errors getting file system usage (e.g. permission denied) (default false)
-h, --help help for check-disk-usage
-H, --human-readable print sizes in powers of 1024 (default false)
-I, --include-fs-path strings Comma separated list of file system paths to check
-i, --include-fs-type strings Comma separated list of file system types to check
-p, --include-pseudo-fs Include pseudo-filesystems (e.g. tmpfs) (default false)
-r, --include-read-only Include read-only filesystems (default false)
-K, --inodescritical float Critical threshold for filesystem inode usage (default 85)
-W, --inodeswarning float Warning threshold for filesystem inode usage (default 85)
--disable-zfs-pool-capacity Report raw statvfs usage for zfs mountpoints instead of the
underlying zpool's real capacity (default false)
--metrics Output metrics instead of human readable output
--tags strings Comma separated list of additional metrics tags using key=value format.
-w, --warning float Warning threshold for file system usage (default 85)
Use "check-disk-usage [command] --help" for more information about a command.
--exclude-fs-type and--include-fs-type on the same check).--include-pseudo-fs option is false by default meaning that on Linux--include-read-only checks for the ro mount option on Linux and theread-only mount option on macOS and read-only volumes on Windows. By default--fail-on-error option determines what occurs if the check encounters anpermission denied for a file system. If true, the check will--human-readable (False by default) option determines if you preferZFS compression and pool-wide dedup make statvfs-based usage (what every
other file system type reports, and what this check used to report for zfs
too) misleading:
used + available) floats up and down asBecause of this, for any mountpoint with fstype of zfs, this check
sources used/free/total/usage percent from the underlying zpool's real
capacity (zpool list) instead of statvfs. This means:
/, /var/lib/docker, and azpool binary to be available on PATH for the userzpool list fails (e.g. missing binary, permissionUNKNOWN for it, unless --fail-on-error is set.--disable-zfs-pool-capacity to opt back into the old, misleading--metrics mode, an additional disk.dataset_used_bytes metric isused value. Since disk.used_bytes/disk.percent_usage becomedisk.dataset_used_bytes to see which specific dataset is actuallySensu Assets are the best way to make use of this plugin. If you're not
using an asset, please consider doing so! If you're using sensuctl 5.13 with
Sensu Backend 5.13 or later, you can use the following command to add the asset:
sensuctl asset add sensu/check-disk-usage
If you're using an earlier version of sensuctl, you can find the asset on the Bonsai Asset Index.
---
type: CheckConfig
api_version: core/v2
metadata:
name: check-disk-usage
namespace: default
spec:
command: >-
check-disk-usage
--include-fs-type "xfs,ext4"
--exclude-fs-path "/boot"
--warning 90
--critical 95
subscriptions:
- system
runtime_assets:
- sensu/check-disk-usage
---
type: CheckConfig
api_version: core/v2
metadata:
name: check-disk-usage
namespace: default
spec:
command: >-
check-disk-usage
--include-fs-type "xfs,ext4,zfs"
--exclude-fs-path "/boot"
--warning 90
--critical 95
--metrics
subscriptions:
- system
runtime_assets:
- feebles303/check-disk-usage
Note zfs must be added to --include-fs-type (or omitted from
--exclude-fs-type) explicitly — it isn't special-cased into inclusion by
default. See ZFS behavior above for what changes once it's
included.
---
type: CheckConfig
api_version: core/v2
metadata:
name: check-disk-usage
namespace: default
spec:
command: >-
check-disk-usage
--include-fs-type "NTFS"
--exclude-fs-path "C:,D:"
--warning 90
--critical 95
subscriptions:
- system
runtime_assets:
- sensu/check-disk-usage
The preferred way of installing and deploying this plugin is to use it as an
Asset. If you would like to compile and install the plugin from source or
contribute to it, download the latest version or create an executable from this
source.
From the local path of the check-disk-usage repository:
go build
For more information about contributing to this plugin, see Contributing.
Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.
×