Module: check_mk
Branch: master
Commit: 44d990da92543d8fbd9056505f99335eb401cd29
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=44d990da92543d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 2 16:43:54 2013 +0100
FIX win_dhcp_pools: Fixed wrong percentage calculation
---
.werks/298 | 8 ++++++++
ChangeLog | 1 +
checks/win_dhcp_pools | 4 ++--
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/.werks/298 b/.werks/298
new file mode 100644
index 0000000..3ebfd53
--- /dev/null
+++ b/.werks/298
@@ -0,0 +1,8 @@
+Title: win_dhcp_pools: Fixed wrong percentage calculation
+Level: 1
+Component: checks
+Version: 1.2.3i7
+Date: 1385999012
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 55d4232..f874883 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -47,6 +47,7 @@
* 0293 FIX: esx_vsphere_counters_ramdisk_sizes: Handles ram disk
"ibmscratch" by default now
* 0012 FIX: Solaris Agent: fixed broken fileinfo section...
* 0297 FIX: mk-job is now also usable on CentOS 5+...
+ * 0298 FIX: win_dhcp_pools: Fixed wrong percentage calculation
Multisite:
* 0001 New filters for selecting several host/service-groups at once...
diff --git a/checks/win_dhcp_pools b/checks/win_dhcp_pools
index 20d60a4..5b4a1f0 100644
--- a/checks/win_dhcp_pools
+++ b/checks/win_dhcp_pools
@@ -123,8 +123,8 @@ def check_win_dhcp_pools(item, params, info):
if size == 0:
return (3, "DHCP Pool contains no IP addresses / is deactivated")
- if free > 0:
- perc_free = 100 * size / free
+ if size > 0:
+ perc_free = 100.0 * free / size
else:
perc_free = 0