lists.checkmk.com
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
List overview
Download
Checkmk git commits
November 2015
----- 2024 -----
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
checkmk-commits@lists.checkmk.com
8 participants
303 discussions
Start a n
N
ew thread
Updated bug entries #2386
by Mathias Kettner
Module: check_mk Branch: master Commit: e041fbe6178fd8d3a393d27b78517162dad76806 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e041fbe6178fd8…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Nov 6 16:20:28 2015 +0100 Updated bug entries #2386 --- .bugs/2386 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.bugs/2386 b/.bugs/2386 new file mode 100644 index 0000000..5848e3a --- /dev/null +++ b/.bugs/2386 @@ -0,0 +1,7 @@ +Title: compiled MIB files (py, pyc) must not be put under local/ but below var/ +Component: wato +State: open +Date: 2015-11-06 16:19:39 +Targetversion: future +Class: bug +
8 years, 8 months
1
0
0
0
#2773 FIX omd_staomd_status: handle case where site' s software installation is broken
by Mathias Kettner
Module: check_mk Branch: master Commit: c0495eb5085813e4509c802a32c4ae4372cda9a1 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c0495eb5085813…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Nov 6 16:06:19 2015 +0100 #2773 FIX omd_staomd_status: handle case where site's software installation is broken --- .werks/2773 | 9 +++++++++ ChangeLog | 1 + 2 files changed, 10 insertions(+) diff --git a/.werks/2773 b/.werks/2773 new file mode 100644 index 0000000..eec8839 --- /dev/null +++ b/.werks/2773 @@ -0,0 +1,9 @@ +Title: omd_staomd_status: handle case where site's software installation is broken +Level: 1 +Component: checks +Compatible: compat +Version: 1.2.7i4 +Date: 1446822361 +Class: fix + + diff --git a/ChangeLog b/ChangeLog index 2c2d289..1ab4c03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -57,6 +57,7 @@ * 2741 FIX: isc_dhcpd: Fix problem where outdated leases where counted as active * 2731 FIX: smart.temp: Handles case of missing temperature values correctly * 2753 FIX: ad_replication: Made check more robust agains garbled agent output + * 2773 FIX: omd_staomd_status: handle case where site's software installation is broken Multisite: * 2684 Added icons for downloading agent data / walks of hosts...
8 years, 8 months
1
0
0
0
Cleaned up output of cmk -v a bit
by Lars Michelsen
Module: check_mk Branch: master Commit: c9df89e592d2d0a5eecba9c92901e15b35bc28c2 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c9df89e592d2d0…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Nov 6 16:06:09 2015 +0100 Cleaned up output of cmk -v a bit --- modules/check_mk_base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py index 6bfce7b..a88b355 100644 --- a/modules/check_mk_base.py +++ b/modules/check_mk_base.py @@ -1861,11 +1861,13 @@ def submit_check_result(host, servicedesc, result, sa, cached_at=None, cache_int if opt_verbose: if opt_showperfdata: + infotext_fmt = "%-56s" p = ' (%s)' % (" ".join(perftexts)) else: p = '' + infotext_fmt = "%s" color = { 0: tty_green, 1: tty_yellow, 2: tty_red, 3: tty_magenta }[state] - print "%-20s %s%s%-56s%s%s" % (servicedesc.encode('utf-8'), + print ("%-20s %s%s"+infotext_fmt+"%s%s") % (servicedesc.encode('utf-8'), tty_bold, color, make_utf8(infotext.split('\n')[0]), tty_normal, make_utf8(p))
8 years, 8 months
1
0
0
0
Reserved 10 Werk IDS
by Mathias Kettner
Module: check_mk Branch: master Commit: b83fc80fa0cbcaf730e27e8b78ce62dc106e18c1 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b83fc80fa0cbca…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Nov 6 16:05:56 2015 +0100 Reserved 10 Werk IDS --- .werks/first_free | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.werks/first_free b/.werks/first_free index cd0d61b..7ab19b5 100644 --- a/.werks/first_free +++ b/.werks/first_free @@ -1 +1 @@ -2773 +2783
8 years, 8 months
1
0
0
0
Reserved 20 Werk IDS
by Lars Michelsen
Module: check_mk Branch: master Commit: 6f5141a21d3789cdc2d136467a4ef9ba59147b78 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6f5141a21d3789…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Nov 6 15:25:30 2015 +0100 Reserved 20 Werk IDS --- .werks/first_free | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.werks/first_free b/.werks/first_free index f1349af..cd0d61b 100644 --- a/.werks/first_free +++ b/.werks/first_free @@ -1 +1 @@ -2753 +2773
8 years, 8 months
1
0
0
0
#2753 FIX ad_replication: Made check more robust agains garbled agent output
by Lars Michelsen
Module: check_mk Branch: master Commit: 9f95fccaf81ede1cd8d99c22c980bf491bb1bca9 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9f95fccaf81ede…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Nov 6 15:25:42 2015 +0100 #2753 FIX ad_replication: Made check more robust agains garbled agent output --- .werks/2753 | 9 +++++++++ ChangeLog | 1 + checks/ad_replication | 14 ++++++++++---- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.werks/2753 b/.werks/2753 new file mode 100644 index 0000000..356c760 --- /dev/null +++ b/.werks/2753 @@ -0,0 +1,9 @@ +Title: ad_replication: Made check more robust agains garbled agent output +Level: 1 +Component: checks +Compatible: compat +Version: 1.2.7i4 +Date: 1446819933 +Class: fix + + diff --git a/ChangeLog b/ChangeLog index f51e4ca..2c2d289 100644 --- a/ChangeLog +++ b/ChangeLog @@ -56,6 +56,7 @@ * 2730 FIX: if64: Grouping of interfaces resulted in an exception... * 2741 FIX: isc_dhcpd: Fix problem where outdated leases where counted as active * 2731 FIX: smart.temp: Handles case of missing temperature values correctly + * 2753 FIX: ad_replication: Made check more robust agains garbled agent output Multisite: * 2684 Added icons for downloading agent data / walks of hosts... diff --git a/checks/ad_replication b/checks/ad_replication index 9f19c93..ed68ed7 100644 --- a/checks/ad_replication +++ b/checks/ad_replication @@ -24,8 +24,6 @@ # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. -# Author: Lars Michelsen <lm(a)mathias-kettner.de> - # <<<ad_replication>>> # showrepl_COLUMNS,Destination DC Site,Destination DC,Naming Context,Source DC Site,Source DC,\ #Transport Type,Number of Failures,Last Failure Time,Last Success Time,Last Failure Status @@ -46,8 +44,12 @@ def parse_ad_replication_dates(s): def parse_ad_replication_info(info): lines = [] - for l in [ ' '.join(line).replace(',CN=', ';CN=').replace(',DC=', ';DC=') for line in info ]: - lines.append(l.split(',')) + for line_parts in info: + # Make lines split by , instead of spaces + line_txt = ' '.join(line_parts).replace(',CN=', ';CN=').replace(',DC=', ';DC=') + line_parts = line_txt.split(',') + if len(line_parts) in [ 11, 10 ]: + lines.append(line_parts) return lines def inventory_ad_replication(info): @@ -59,6 +61,8 @@ def inventory_ad_replication(info): elif len(line) == 10: source_site = line[3] source_dc = line[4] + else: + break # unhandled data entry = ('%s/%s' % (source_site, source_dc), 'ad_replication_default_params') if line[0] == 'showrepl_INFO' and entry not in inv: inv.append(entry) @@ -78,6 +82,8 @@ def check_ad_replication(item, params, info): (lineType, destSite, naming_context, source_site, source_dc, transport, num_failures, time_last_failure, time_last_success, statusLastFailure ) = l + else: + break # unhandled data if lineType == 'showrepl_INFO' and source_site+'/'+source_dc == item: foundLine = True
8 years, 8 months
1
0
0
0
#2742 FIX Make selection of folders and host group tag filter use nicer drawing characters
by Mathias Kettner
Module: check_mk Branch: master Commit: d1910804131593d3646288791e2173f789a428f6 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d1910804131593…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Nov 6 15:22:14 2015 +0100 #2742 FIX Make selection of folders and host group tag filter use nicer drawing characters --- .werks/2742 | 10 ++++++++++ ChangeLog | 1 + web/htdocs/htmllib.py | 25 ++++++------------------- web/htdocs/wato.py | 2 +- web/plugins/visuals/filters.py | 2 +- web/plugins/visuals/wato.py | 4 ++-- 6 files changed, 21 insertions(+), 23 deletions(-) diff --git a/.werks/2742 b/.werks/2742 new file mode 100644 index 0000000..8c4d4bf --- /dev/null +++ b/.werks/2742 @@ -0,0 +1,10 @@ +Title: Make selection of folders and host group tag filter use nicer drawing characters +Level: 1 +Component: wato +Class: fix +Compatible: compat +State: unknown +Version: 1.2.7i4 +Date: 1446819695 + + diff --git a/ChangeLog b/ChangeLog index 07e548c..f51e4ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -83,6 +83,7 @@ * 1299 FIX: BI: Fixed recently introduced bug when editing BI Rules... * 2721 FIX: Fixed user profile sync in distributed environments after profile change * 2723 FIX: Hiding "discard changes button" after successful activation of changes + * 2742 FIX: Make selection of folders and host group tag filter use nicer drawing characters Notifications: * 2728 FIX: Removed debug notification script (was not executable)... diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index 22a671c..417464d 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -588,23 +588,9 @@ class html: self.form_vars.append(varname) def sorted_select(self, varname, choices, deflt="", onchange=None, attrs = {}): - def sort_function(a, b): - aStr = bStr = '' - - if isinstance(a[1], HTML): - aStr = a[1].value - else: - aStr = a[1] - if isinstance(b[1], HTML): - bStr = b[1].value - else: - bStr = b[1] - - return cmp(aStr.lower(), bStr.lower()) - # Sort according to display texts, not keys sorted = choices[:] - sorted.sort(sort_function) + sorted.sort(lambda a,b: cmp(a[1].lower(), b[1].lower())) self.select(varname, sorted, deflt, onchange, attrs) # Choices is a list pairs of (key, title). They keys of the choices @@ -615,14 +601,15 @@ class html: attrs.setdefault('size', 1) attributes = ' ' + ' '.join([ '%s="%s"' % (k, v) for k, v in attrs.iteritems() ]) - self.write("<select%s name=\"%s\" id=\"%s\"%s>\n" % (onchange_code, varname, varname, attributes)) + self.write("<select%s name=\"%s\" id=\"%s\"%s>\n" % + (onchange_code, varname, varname, attributes)) for value, text in choices: if value == None: value = "" - sel = value == current and " SELECTED" or "" - self.write('<option value="%s"%s>%s</option>\n' % + sel = value == current and " selected" or "" + self.write("<option value=\"%s\"%s>%s</option>\n" % (self.attrencode(value), sel, self.attrencode(text))) - self.write('</select>\n') + self.write("</select>\n") if varname: self.form_vars.append(varname) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index f91afb9..38ef972 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -15449,7 +15449,7 @@ def show_rule_in_table(rulespec, tag_specs, host_list, item_list, varname, value def folder_selection(folder, depth=0): if depth: - title_prefix = " " * depth + "` " + "- " * depth + title_prefix = (u"\u00a0" * 6 * depth) + u"\u2514\u2500 " else: title_prefix = "" sel = [ (folder[".path"], HTML(title_prefix + html.attrencode(folder["title"]))) ] diff --git a/web/plugins/visuals/filters.py b/web/plugins/visuals/filters.py index 11d046c..a351e33 100644 --- a/web/plugins/visuals/filters.py +++ b/web/plugins/visuals/filters.py @@ -967,7 +967,7 @@ class FilterHostTags(Filter): groups = [ (e[0], e[1].lstrip("/") ) for e in config.wato_host_tags ] operators = [ ("is", _("=")), - ("isnot", HTML(_("≠"))), + ("isnot", _(u"≠")), ] # replace unicode strings, before writing out as "json" diff --git a/web/plugins/visuals/wato.py b/web/plugins/visuals/wato.py index 3238f53..cae6ab6 100644 --- a/web/plugins/visuals/wato.py +++ b/web/plugins/visuals/wato.py @@ -92,11 +92,11 @@ class FilterWatoFile(Filter): def folder_selection(self, folder, prefix, depth): my_path = folder[".path"] if depth: - title_prefix = " " * depth + "` " + "- " * depth + title_prefix = (u"\u00a0" * 6 * depth) + u"\u2514\u2500 " else: title_prefix = "" self.path_to_tree[my_path] = folder["title"] - sel = [ (my_path , HTML(title_prefix + html.attrencode(folder["title"]))) ] + sel = [ (my_path , title_prefix + folder["title"]) ] sel += self.sublist(folder.get(".folders", {}), my_path, depth) return sel
8 years, 8 months
1
0
0
0
#2731 FIX smart.temp: Handles case of missing temperature values correctly
by Lars Michelsen
Module: check_mk Branch: master Commit: fcff1db8f108f1040191881977ba8d209b7c4e7b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fcff1db8f108f1…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Nov 6 15:07:40 2015 +0100 #2731 FIX smart.temp: Handles case of missing temperature values correctly --- .werks/2731 | 10 ++++++++++ ChangeLog | 1 + checks/smart | 8 +++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.werks/2731 b/.werks/2731 new file mode 100644 index 0000000..2f6a277 --- /dev/null +++ b/.werks/2731 @@ -0,0 +1,10 @@ +Title: smart.temp: Handles case of missing temperature values correctly +Level: 1 +Component: checks +Class: fix +Compatible: compat +State: unknown +Version: 1.2.7i4 +Date: 1446818837 + + diff --git a/ChangeLog b/ChangeLog index ffebbb0..07e548c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -55,6 +55,7 @@ * 2727 FIX: ibm_imm_health: Fixed unhandled exception when SNMP info is missing * 2730 FIX: if64: Grouping of interfaces resulted in an exception... * 2741 FIX: isc_dhcpd: Fix problem where outdated leases where counted as active + * 2731 FIX: smart.temp: Handles case of missing temperature values correctly Multisite: * 2684 Added icons for downloading agent data / walks of hosts... diff --git a/checks/smart b/checks/smart index 1dfde49..21e598c 100644 --- a/checks/smart +++ b/checks/smart @@ -148,11 +148,13 @@ def inventory_smart_temp(info): def check_smart_temp(item, params, info): disks = parse_smart(info) - if item not in disks: + + try: + temperature = disks[item]["Temperature_Celsius"] + except KeyError: return - disk = disks[item] - return check_temperature(disk["Temperature_Celsius"], params) + return check_temperature(temperature, params) check_info["smart.temp"] = { 'check_function': check_smart_temp,
8 years, 8 months
1
0
0
0
The grouping of interfaces which are checked with the if64 check
by Lars Michelsen
Module: check_mk Branch: master Commit: 4c95e8212a599a868ce6319c61b43a32760085f7 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4c95e8212a599a…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Nov 6 14:31:16 2015 +0100 The grouping of interfaces which are checked with the if64 check was broken. This has been fixed now. Grouping of interfaces across cluster nodes is undefined behaviour. Added an error message to inform the users in case they configured grouping for clustered interfaces. Conflicts: checks/if.include --- .werks/2730 | 15 +++++++++++++++ ChangeLog | 1 + checks/if.include | 10 +++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.werks/2730 b/.werks/2730 new file mode 100644 index 0000000..ef8869d --- /dev/null +++ b/.werks/2730 @@ -0,0 +1,15 @@ +Title: if64: Grouping of interfaces resulted in an exception +Level: 1 +Component: checks +Class: fix +Compatible: compat +State: unknown +Version: 1.2.7i4 +Date: 1446816126 + +The grouping of interfaces which are checked with the if64 check +was broken. This has been fixed now. + +Grouping of interfaces across cluster nodes is undefined behaviour. +Added an error message to inform the users in case they configured +grouping for clustered interfaces. diff --git a/ChangeLog b/ChangeLog index d09590c..6c3837b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -53,6 +53,7 @@ * 2725 FIX: Dynamic levels: Enforce config of levels for filesystems larger than 0 bytes... * 2726 FIX: veeam_backup_status: Fixed missing agent section error in case of aborted tasks * 2727 FIX: ibm_imm_health: Fixed unhandled exception when SNMP info is missing + * 2730 FIX: if64: Grouping of interfaces resulted in an exception... Multisite: * 2684 Added icons for downloading agent data / walks of hosts... diff --git a/checks/if.include b/checks/if.include index 87422f2..d3bc4e1 100644 --- a/checks/if.include +++ b/checks/if.include @@ -420,6 +420,9 @@ def check_if_common(item, params, info, has_nodeinfo = False, group_name = "Grou else: ifOperStatusName = if_statename(ifOperStatus) + if has_nodeinfo and node: + return 3, "Interface grouping is not supported for clusters." + ifGroup = None if type(ifIndex) == tuple: ifGroup, ifIndex = ifIndex @@ -487,7 +490,12 @@ def check_if_common(item, params, info, has_nodeinfo = False, group_name = "Grou if params.get("include_items"): alias_info.append("grouped items") - group_entry = [ + if has_nodeinfo: + group_entry = [None] + else: + group_entry = [] + + group_entry += [ "ifgroup%s" % item, # ifIndex item, # ifDescr params["iftype"], # ifType
8 years, 8 months
1
0
0
0
#2741 FIX isc_dhcpd: Fix problem where outdated leases where counted as active
by Mathias Kettner
Module: check_mk Branch: master Commit: d06762d9329b88a998188d08cef21cbb4363b84b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d06762d9329b88…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Nov 6 14:31:21 2015 +0100 #2741 FIX isc_dhcpd: Fix problem where outdated leases where counted as active --- .werks/2741 | 9 +++++ ChangeLog | 1 + agents/plugins/isc_dhcpd | 92 ++++++++++++++++++++++++++++++++-------------- 3 files changed, 74 insertions(+), 28 deletions(-) diff --git a/.werks/2741 b/.werks/2741 new file mode 100644 index 0000000..d2afb35 --- /dev/null +++ b/.werks/2741 @@ -0,0 +1,9 @@ +Title: isc_dhcpd: Fix problem where outdated leases where counted as active +Level: 1 +Component: checks +Compatible: compat +Version: 1.2.7i4 +Date: 1446816658 +Class: fix + + diff --git a/ChangeLog b/ChangeLog index d09590c..cfc075e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -53,6 +53,7 @@ * 2725 FIX: Dynamic levels: Enforce config of levels for filesystems larger than 0 bytes... * 2726 FIX: veeam_backup_status: Fixed missing agent section error in case of aborted tasks * 2727 FIX: ibm_imm_health: Fixed unhandled exception when SNMP info is missing + * 2741 FIX: isc_dhcpd: Fix problem where outdated leases where counted as active Multisite: * 2684 Added icons for downloading agent data / walks of hosts... diff --git a/agents/plugins/isc_dhcpd b/agents/plugins/isc_dhcpd index 7ac606b..22482d6 100755 --- a/agents/plugins/isc_dhcpd +++ b/agents/plugins/isc_dhcpd @@ -1,34 +1,70 @@ -#!/bin/bash -# Plugin for checking a DHCP daemon running on Linux. -# If you conf or leases file is not at one of the places -# we look for then please add that path to the list -# and give us feedback at feedback(a)check-mk.org - -for path in /etc/dhcpd.conf /etc/dhcp/dhcpd.conf ; do - if [ -e $path ] ; then - CONF_FILE=$path +#!/usr/bin/python + +import os, sys, time + +conf_file = None +for path in [ '/etc/dhcpd.conf', '/etc/dhcp/dhcpd.conf' ]: + if os.path.exists(path): + conf_file = path break - fi -done -for path in /var/lib/dhcp/db/dhcpd.leases /var/lib/dhcp/dhcpd.leases; do - if [ -e $path ] ; then - LEASES_FILE=$path +leases_file = None +for path in [ '/var/lib/dhcp/db/dhcpd.leases', '/var/lib/dhcp/dhcpd.leases' ]: + if os.path.exists(path): + leases_file = path break - fi -done # If no configuration and leases are found, we assume that # no dhcpd is running. -if [ -z "$CONF_FILE" -o -z "$LEASES_FILE" ] ; then exit ; fi - -echo '<<<isc_dhcpd>>>' -echo "[general]" -echo "PID: $(pidof dhcpd)" -echo "[pools]" -sed -nr -e 's/;//g' -e '/^[[:space:]]*range */s///p' < $CONF_FILE -echo "[leases]" -sed -nr -e 's/;//g' \ - -e '/^lease */s/.* ([0-9.]+) .*/\1/p' \ - -e '/^ *binding state */s///p' < $LEASES_FILE | - sed 'N;s/\n/ /' | sed -n '/ active/s///p' | sort -u +if not conf_file or not leases_file: + sys.exit(0) + +pidof_dhcpd = os.popen("pidof dhcpd").read().strip() +sys.stdout.write('<<<isc_dhcpd>>>\n[general]\nPID: %s\n' % pidof_dhcpd) + +sys.stdout.write('[pools]\n') +for line in file(conf_file): + line = line.strip().rstrip(";").rstrip() + if line.startswith("range"): + sys.stdout.write(line[5:].strip() + "\n") + +# lease 10.1.1.81 { +# starts 3 2015/09/09 11:42:20; +# ends 3 2015/09/09 19:42:20; +# tstp 3 2015/09/09 19:42:20; +# cltt 3 2015/09/09 11:42:20; +# binding state free; +# hardware ethernet a4:5e:60:de:1f:c3; +# uid "\001\244^`\336\037\303"; +# set ddns-txt = "318c69bae8aeae6f8c723e96de933c7149"; +# set ddns-fwd-name = "Sebastians-MBP.dhcp.mathias-kettner.de"; +# } + +sys.stdout.write('[leases]\n') +now = time.time() +ip_address = None +binding_state = None +seen_addresses = set() +for line in file(leases_file): + parts = line.strip().rstrip(";").split() + if not parts: + continue + + if parts[0] == "lease": + 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")) + if ends_date < now: + ip_address = None # skip this address, this lease is outdated + + elif parts[0] == "binding" and parts[1] == "state": + binding_state = parts[2] + + elif parts[0] == "}": + if ip_address and binding_state == "active" and ip_address not in seen_addresses: + sys.stdout.write("%s\n" % ip_address) + seen_addresses.add(ip_address) + ip_address = None + binding_state = None +
8 years, 8 months
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
31
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Results per page:
10
25
50
100
200