From 487d64a4e4122ca7b389b5e26b6cdf156c877c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 3 Mar 2016 21:23:49 +0200 Subject: allow checking 0-sized resource (ex. IPC$) patch by Marek Marczykowski diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 9899226..4e46397 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 v0.10-9-g596f