Module: check_mk
Branch: master
Commit: ac34b7426a2924cfca780078a33c90c2083cefea
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ac34b7426a2924…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Oct 24 19:53:35 2010 +0200
win_dhcp_pools: handle invalid ints
---
ChangeLog | 1 +
checks/win_dhcp_pools | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 834a353..031b037 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@
* ps: inventory with GRAB_USER: require service description to contain
%u. That will be replaced with the user name and thus makes the
service description unique.
+ * win_dhcp_pools: better handle invalid agent output
Livestatus:
* Prohibit { and } in regular expressions. This avoids a segmentation
diff --git a/checks/win_dhcp_pools b/checks/win_dhcp_pools
index 59c0f93..bc96e1a 100644
--- a/checks/win_dhcp_pools
+++ b/checks/win_dhcp_pools
@@ -104,7 +104,7 @@ def check_win_dhcp_pools(item, params, info):
key = ' '.join(line[:-2])
if key in win_dhcp_pools_stats_translate:
key = win_dhcp_pools_stats_translate[key]
- poolStats.append(int(line[-1].rstrip('.')))
+ poolStats.append(saveint(line[-1].rstrip('.')))
if len(poolStats) == 3:
break
@@ -149,7 +149,7 @@ def check_win_dhcp_pools_stats(item, params, info):
if key in [ 'Discovers', 'Offers', 'Requests',
'Acks',
'Nacks', 'Declines', 'Releases',
'Scopes' ]:
- value = int(line[2].rstrip('.'))
+ value = saveint(line[2].rstrip('.'))
try:
timedif, per_sec = get_counter("win_dhcp_stats.%s" % key,
this_time, value)
except MKCounterWrapped: