From 487d64a4e4122ca7b389b5e26b6cdf156c877c04 Mon Sep 17 00:00:00 2001 From: Elan Ruusamäe Date: Thu, 3 Mar 2016 21:23:49 +0200 Subject: allow checking 0-sized resource (ex. IPC$) patch by Marek Marczykowski --- plugins-scripts/check_disk_smb.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 98992268..4e46397d 100755 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl @@ -212,7 +212,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 ? -- cgit v1.2.3-74-g34f1