Merge pull request #1411 from glensc/pld/nagios-plugins-check_disk_smb-zero-cap.patch

check_disk_smb: allow checking 0-sized resource (ex. IPC$)
This commit is contained in:
Lorenz Kästle 2023-10-03 22:57:51 +02:00 committed by GitHub
commit d31dddadaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -226,7 +226,8 @@ if (/\s*(\d*) blocks of size (\d*)\. (\d*) blocks available/) {
my ($total_bytes) = $1 * $2;
my ($occupied_bytes) = $1 * $2 - $avail_bytes;
my ($avail) = $avail_bytes/1024;
my ($capper) = int(($3/$1)*100);
my ($capper);
if ($1!=0) { $capper = int(($3/$1)*100) } else { $capper=100 };
my ($mountpt) = "\\\\$host\\$share";
# TODO : why is the kB the standard unit for args ?