Module: check_mk
Branch: master
Commit: cda451bd8e282a91567805da0458bb12309d6d28
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cda451bd8e282a…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Mar 8 11:56:31 2016 +0100
3092 FIX isc_dhcpd: fixed incorrect handling of timezones
---
.werks/3092 | 10 ++++++++++
ChangeLog | 1 +
agents/plugins/isc_dhcpd | 4 ++--
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/3092 b/.werks/3092
new file mode 100644
index 0000000..88ae563
--- /dev/null
+++ b/.werks/3092
@@ -0,0 +1,10 @@
+Title: isc_dhcpd: fixed incorrect handling of timezones
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1457434558
+
+
diff --git a/ChangeLog b/ChangeLog
index 36a51e7..2e50386 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -66,6 +66,7 @@
* 3276 FIX: esx_vsphere_vm.snapshot: Graphs now scale the age of the scnapshots
correctly
* 3277 FIX: veeam_jobs: Handling missing state "Postprocessing" now
* 3278 FIX: fritz_wan_if: Fixed incorrect unit Bit used in check
+ * 3092 FIX: isc_dhcpd: fixed incorrect handling of timezones
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/agents/plugins/isc_dhcpd b/agents/plugins/isc_dhcpd
index 297d328..e94f0d1 100755
--- a/agents/plugins/isc_dhcpd
+++ b/agents/plugins/isc_dhcpd
@@ -1,6 +1,6 @@
#!/usr/bin/python
-import os, sys, time
+import os, sys, time, calendar
conf_file = None
for path in [ '/etc/dhcpd.conf', '/etc/dhcp/dhcpd.conf' ]:
@@ -58,7 +58,7 @@ for line in file(leases_file):
ip_address = parts[1]
elif parts[0] == "ends":
ends_date_string = parts[2] + " " + parts[3]
- ends_date = time.mktime(time.strptime(ends_date_string, "%Y/%m/%d
%H:%M:%S"))
+ ends_date = calendar.timegm(time.strptime(ends_date_string, "%Y/%m/%d
%H:%M:%S"))
if ends_date < now:
ip_address = None # skip this address, this lease is outdated