Module: check_mk
Branch: master
Commit: aeaae825c2b86500cc3c334751b4f871113f8c00
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aeaae825c2b865…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Dec 21 09:25:33 2012 +0100
FIX: hr_fs: handle negative values in order to larger disks (thanks to Christof Musik)
---
ChangeLog | 1 +
checks/hr_fs | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 24819b3..a7a34e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,7 @@
* FIX: fixed missing localisation in check_parameteres.py
* FIX: userdb/ldap.py: fixed invalid call site.getsitepackages() for python 2.6
* FIX: zpool_status: fixed crash when spare devices were available
+ * FIX: hr_fs: handle negative values in order to larger disks (thanks to Christof
Musik)
Multisite:
diff --git a/checks/hr_fs b/checks/hr_fs
index b73d2b0..1d07ebd 100644
--- a/checks/hr_fs
+++ b/checks/hr_fs
@@ -40,8 +40,14 @@ def check_hr_fs(item, params, info):
for hrtype, hrdescr, hrunits, hrsize, hrused in info:
if "patterns" in params or item == hrdescr:
unit_size = saveint(hrunits)
- size = saveint(hrsize) * unit_size
- used = saveint(hrused) * unit_size
+ hrsize = saveint(hrsize)
+ if hrsize < 0:
+ hrsize = hrsize+2**32
+ size = hrsize * unit_size
+ hrused = saveint(hrused)
+ if hrused < 0:
+ hrsize = hrused+2**32
+ used = hrused * unit_size
size_mb = size / 1048576.0
used_mb = used / 1048576.0
avail_mb = size_mb - used_mb