Module: check_mk
Branch: master
Commit: 1dc2ab087ac19d206f1d8856f19c733e9784969d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1dc2ab087ac19d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Sep 8 10:11:06 2011 +0200
FIX: nfsmounts handles zero-sized volumes correctly
---
ChangeLog | 1 +
checks/nfsmounts | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9743b49..6a981d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
* Added 4 new checks dell_powerconnect_* by Chris Bowlby
* ipmi_sensors: correctly handle further positive status texts
(thanks to Sebastian Talmon)
+ * FIX: nfsmounts handles zero-sized volumes correctly
Multisite:
* FIX: WATO filtered status GUIs did not update the title after changing
diff --git a/checks/nfsmounts b/checks/nfsmounts
index faddfa3..89dcc25 100644
--- a/checks/nfsmounts
+++ b/checks/nfsmounts
@@ -42,6 +42,9 @@ def check_nfsmounts(item, params, info):
if line[1] == 'ok':
gb = 1024 * 1024 * 1024.0
size_gb = (size_blocks * blocksize) / gb
+ if size_gb == 0:
+ return (0, "OK - server is responding")
+
free_gb = (free_blocks * blocksize) / gb
used_gb = size_gb - free_gb
used_perc = 100.0 * used_gb / size_gb