Enhance comments for check_all_disk_space script

Updated comments to clarify script functionality and usage.
This commit is contained in:
Jim Salter 2026-01-19 23:30:35 -05:00 committed by GitHub
parent 361e6839d1
commit 536cceea95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 6 deletions

View File

@ -1,12 +1,17 @@
#!/usr/bin/perl
# nagios plugin format: exit 0,1,2,3 for OK, WARN, CRITICAL, or ERROR.
# check_all_space_avail - test space available on all ZFS filesystems on host
# different values for pools named "backup" and other pools:
# This is a Nagios-compatible script which checks all mounted filesystems--not just ZFS filesystems--to see
# if any are running dangerously low on space. It's generally bright enough to avoid weird mounts where
# free space checks don't apply, eg dev, tmpfs, CD or DVDs, and so forth.
#
# default: warn 93%, crit 98%
# usage:
# check_all_disk_space [warnlevel] [critlevel]
#
# example:
# root@banshee:~/check_all_disk_space 80 90
# OK
# default levels: warn if a filesystem is 93% full, crit if it's 98% full
my $warnlevel = .93;
my $critlevel = .98;
@ -48,6 +53,8 @@ foreach my $fs (@filesystems) {
$msg =~ s/, $//;
$msg .= "\n";
# nagios plugin format: exit 0,1,2,3 for OK, WARN, CRITICAL, or ERROR.
if ($critfound) {
print "CRITICAL: $msg";
exit 2;
@ -62,6 +69,5 @@ if ($critfound) {
exit 0;
}
print "ERROR: $msg ?";
exit 3;