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
October
September
August
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 -----
October 2024
September 2024
August 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
minor cleanup in dhcp_pools.include
by Simon Betz
Module: check_mk Branch: master Commit: 14a7a0c5acddad3c5668b4cd1f1c78c7847cc0f4 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=14a7a0c5acddad…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Thu Nov 12 12:56:53 2015 +0100 minor cleanup in dhcp_pools.include --- checks/dhcp_pools.include | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/checks/dhcp_pools.include b/checks/dhcp_pools.include index a44f276..229a657 100644 --- a/checks/dhcp_pools.include +++ b/checks/dhcp_pools.include @@ -36,7 +36,7 @@ def check_dhcp_pools_levels(free, used, pending, size, params): if type(params) == tuple: # In case of win_dhcp_pools old params are percent but of type # integer, thus we have to change them into floats - params = {"free_leases" : (1.0 * params[0], 1.0 * params[1])} + params = {"free_leases" : (float(params[0]), float(params[1]))} for what, value in [("free", free), ("used", used)]: state = 0 @@ -45,6 +45,7 @@ def check_dhcp_pools_levels(free, used, pending, size, params): infotext = "%s: %d leases (%.1f%%)" % (what, value, value_perc) if params.get("%s_leases" % what, ""): warn, crit = params["%s_leases" % what] + print what, warn, crit if type(warn) == float: # here we have levels in percent value = value_perc text_format = "%.1f"
8 years, 10 months
1
0
0
0
Reserved 10 Werk IDS
by Simon Betz
Module: check_mk Branch: master Commit: e74cc89b5241d045dd3d9683691ef06eb0134b58 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e74cc89b5241d0…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Thu Nov 12 12:41:39 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 e8b6b61..4f552a2 100644 --- a/.werks/first_free +++ b/.werks/first_free @@ -1 +1 @@ -2833 +2843
8 years, 10 months
1
0
0
0
#2833 isc_dhcpd, win_dhcp_pools: lower levels for used dhcp leases are now configurable
by Simon Betz
Module: check_mk Branch: master Commit: 304dd9fd4b33fdc6eb868b74ac94f0f35a71d700 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=304dd9fd4b33fd…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Thu Nov 12 12:45:27 2015 +0100 #2833 isc_dhcpd, win_dhcp_pools: lower levels for used dhcp leases are now configurable Lower levels for free and used dhcp leases are now configurable. Moreover these levels can be configured as percent or absolute values. --- .werks/2833 | 10 ++++++++++ ChangeLog | 1 + .../{win_dhcp_pools.include => dhcp_pools.include} | 7 ++++--- checks/isc_dhcpd | 4 ++-- checks/win_dhcp_pools | 4 ++-- web/plugins/metrics/check_mk.py | 20 +++++++------------- 6 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.werks/2833 b/.werks/2833 new file mode 100644 index 0000000..de52a87 --- /dev/null +++ b/.werks/2833 @@ -0,0 +1,10 @@ +Title: isc_dhcpd, win_dhcp_pools: lower levels for used dhcp leases are now configurable +Level: 1 +Component: checks +Compatible: compat +Version: 1.2.7i4 +Date: 1447328506 +Class: feature + +Lower levels for free and used dhcp leases are now configurable. Moreover these levels +can be configured as percent or absolute values. diff --git a/ChangeLog b/ChangeLog index 2715503..d1ffe9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,7 @@ * 2763 apache_status: Can now be configured to use the protocols default port... * 2787 netapp_api_snapvaults: Clustermode supported, netapp_api_disks: fixed invalid total disk space... * 2788 ESX Monitoring, esx_vsphere_vm subchecks: VM templates are now excluded... + * 2833 isc_dhcpd, win_dhcp_pools: lower levels for used dhcp leases are now configurable... * 2660 FIX: fixed windows agent using the wrong working directory... * 2664 FIX: ps: Speedup in situation with many matching processes... * 2661 FIX: windows agent: fixed incomplete process list... diff --git a/checks/win_dhcp_pools.include b/checks/dhcp_pools.include similarity index 93% rename from checks/win_dhcp_pools.include rename to checks/dhcp_pools.include index 2717628..a44f276 100644 --- a/checks/win_dhcp_pools.include +++ b/checks/dhcp_pools.include @@ -32,7 +32,7 @@ # } -def check_win_dhcp_pools_levels(free, used, pending, size, params): +def check_dhcp_pools_levels(free, used, pending, size, params): if type(params) == tuple: # In case of win_dhcp_pools old params are percent but of type # integer, thus we have to change them into floats @@ -40,6 +40,7 @@ def check_win_dhcp_pools_levels(free, used, pending, size, params): for what, value in [("free", free), ("used", used)]: state = 0 + value_abs = value value_perc = float(value) / size * 100.0 infotext = "%s: %d leases (%.1f%%)" % (what, value, value_perc) if params.get("%s_leases" % what, ""): @@ -69,7 +70,7 @@ def check_win_dhcp_pools_levels(free, used, pending, size, params): warn_abs = None crit_abs = None - yield state, infotext, [("%s_dhcp_leases" % what, value, warn_abs, crit_abs, 0, size)] + yield state, infotext, [("%s_dhcp_leases" % what, value_abs, warn_abs, crit_abs, 0, size)] - if pending: # != None: + if pending != None: yield 0, "%d leases pending" % pending, [("pending_dhcp_leases", pending, None, None, 0, size)] diff --git a/checks/isc_dhcpd b/checks/isc_dhcpd index e2537a4..799597b 100644 --- a/checks/isc_dhcpd +++ b/checks/isc_dhcpd @@ -114,7 +114,7 @@ def check_isc_dhcpd(item, params, parsed): if lease_dec >= range_from and lease_dec <= range_to: num_used += 1 - for check_result in check_win_dhcp_pools_levels(num_leases - num_used, num_used, None, num_leases, params): + for check_result in check_dhcp_pools_levels(num_leases - num_used, num_used, None, num_leases, params): yield check_result @@ -125,5 +125,5 @@ check_info["isc_dhcpd"] = { 'service_description': 'DHCP Pool %s', 'group': 'win_dhcp_pools', 'has_perfdata': True, - 'includes': ["win_dhcp_pools.include"], + 'includes': ["dhcp_pools.include"], } diff --git a/checks/win_dhcp_pools b/checks/win_dhcp_pools index 46c3738..3258bab 100644 --- a/checks/win_dhcp_pools +++ b/checks/win_dhcp_pools @@ -134,7 +134,7 @@ def check_win_dhcp_pools(item, params, info): if size == 0: yield 3, "DHCP Pool contains no IP addresses / is deactivated" - for check_result in check_win_dhcp_pools_levels(free, used, pending, size, params): + for check_result in check_dhcp_pools_levels(free, used, pending, size, params): yield check_result else: @@ -147,7 +147,7 @@ check_info["win_dhcp_pools"] = { 'service_description': 'DHCP Pool %s', 'has_perfdata': True, 'group': 'win_dhcp_pools', - 'includes': ['win_dhcp_pools.include'], + 'includes': ['dhcp_pools.include'], } diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py index 3e7dab5..f7bf765 100644 --- a/web/plugins/metrics/check_mk.py +++ b/web/plugins/metrics/check_mk.py @@ -4223,18 +4223,11 @@ perfometer_info.append(("stacked", [ ])) # TODO: :max should be the default? -perfometer_info.append(("stacked", [ - { - "type" : "linear", - "segments" : [ "free_dhcp_leases" ], - "total" : "free_dhcp_leases:max", - }, - { - "type" : "linear", - "segments" : [ "used_dhcp_leases" ], - "total" : "used_dhcp_leases:max", - } -])) +perfometer_info.append({ + "type" : "linear", + "segments" : [ "free_dhcp_leases" ], + "total" : "free_dhcp_leases:max", +}) perfometer_info.append(("stacked", [ { @@ -5378,11 +5371,12 @@ graph_info.append({ ( "free_dhcp_leases", "stack" ), ( "pending_dhcp_leases", "stack" ), ], - "range" : (0, "free_dhcp_leases:max"), "scalars" : [ "free_dhcp_leases:warn", "free_dhcp_leases:crit", ], + "range" : (0, "free_dhcp_leases:max"), + "omit_zero_metrics" : True, "optional_metrics" : [ "pending_dhcp_leases" ]
8 years, 10 months
1
0
0
0
Fixed styling of folded sidebar
by Lars Michelsen
Module: check_mk Branch: master Commit: 765bd9f1afd2e894787cac29441ba93d32263250 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=765bd9f1afd2e8…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Nov 12 11:38:33 2015 +0100 Fixed styling of folded sidebar --- web/htdocs/js/sidebar.js | 20 +++++++++++--------- web/htdocs/sidebar.py | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/web/htdocs/js/sidebar.js b/web/htdocs/js/sidebar.js index e25c8ea..2d64cf3 100644 --- a/web/htdocs/js/sidebar.js +++ b/web/htdocs/js/sidebar.js @@ -24,7 +24,7 @@ var g_content_loc = null; -var sidebar_folded = false; +var g_sidebar_folded = false; // // Sidebar styling and scrolling stuff @@ -450,12 +450,12 @@ function startDragScroll(event) { if (!event) event = window.event; - if (sidebar_folded) { - unfoldSidebar(); + if (g_sidebar_folded) { + unfold_sidebar(); return false; } - else if (!sidebar_folded && event.clientX < 10) { - foldSidebar(); + else if (!g_sidebar_folded && event.clientX < 10) { + fold_sidebar(); return false; } @@ -520,11 +520,12 @@ function dragScroll(event) { return false; } -function foldSidebar() +function fold_sidebar() { - sidebar_folded = true; + g_sidebar_folded = true; document.getElementById('check_mk_sidebar').style.position = "relative"; document.getElementById('check_mk_sidebar').style.left = "-265px"; + document.getElementById('side_footer').style.display = "none"; if (isWebkit()) { var oldcols = parent.document.body.cols.split(","); var oldwidth = parseInt(oldcols[0]); @@ -537,12 +538,13 @@ function foldSidebar() } -function unfoldSidebar() +function unfold_sidebar() { document.getElementById('check_mk_sidebar').style.position = ""; document.getElementById('check_mk_sidebar').style.left = "0"; + document.getElementById('side_footer').style.display = ""; parent.document.body.cols = "280,*"; - sidebar_folded = false; + g_sidebar_folded = false; get_url('sidebar_fold.py?fold='); } diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py index 0f6c779..05d3bb4 100644 --- a/web/htdocs/sidebar.py +++ b/web/htdocs/sidebar.py @@ -229,7 +229,7 @@ def sidebar_foot(): html.write('</div>') if load_user_config()["fold"]: - html.final_javascript("foldSidebar();") + html.final_javascript("fold_sidebar();") # Standalone sidebar def page_side():
8 years, 10 months
1
0
0
0
Fixed possible javascript caching issues after updates for wato.js and search.js
by Lars Michelsen
Module: check_mk Branch: master Commit: c29e54b46ca922336b592ca4c314ce2275056493 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c29e54b46ca922…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Nov 12 11:59:26 2015 +0100 Fixed possible javascript caching issues after updates for wato.js and search.js --- web/htdocs/htmllib.py | 46 +++++++++++++++++++++++------------------ web/htdocs/wato.py | 3 +-- web/plugins/sidebar/search.py | 2 +- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index 417464d..65502fb 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -823,27 +823,8 @@ class html: self.add_custom_style_sheet() - # Load specified javascript files. We have some special handling here: - # a) files which can not be found shal not be loaded - # b) in OMD environments, add the Check_MK version to the version (prevents update problems) - # c) load the minified javascript when not in debug mode for js in [ "checkmk", "graphs" ] + javascripts: - filename_for_browser = None - if defaults.omd_root: - rel_path = "/share/check_mk/web/htdocs/js" - if self.enable_debug: - min_parts = [ "", "_min" ] - else: - min_parts = [ "_min", "" ] - - for min_part in min_parts: - path_pattern = defaults.omd_root + "%s" + rel_path + "/" + js + min_part + ".js" - if os.path.exists(path_pattern % "") or os.path.exists(path_pattern % "/local"): - filename_for_browser = '%s%s-%s' % (js, min_part, defaults.check_mk_version) - break - else: - filename_for_browser = js - + filename_for_browser = self.javascript_filename_for_browser(js) if filename_for_browser: self.javascript_file(filename_for_browser) @@ -856,6 +837,31 @@ class html: self.write("</head>\n") self.header_sent = True + + # Make the browser load specified javascript files. We have some special handling here: + # a) files which can not be found shal not be loaded + # b) in OMD environments, add the Check_MK version to the version (prevents update problems) + # c) load the minified javascript when not in debug mode + def javascript_filename_for_browser(self, jsname): + if not defaults.omd_root: + return jsname + + filename_for_browser = None + rel_path = "/share/check_mk/web/htdocs/js" + if self.enable_debug: + min_parts = [ "", "_min" ] + else: + min_parts = [ "_min", "" ] + + for min_part in min_parts: + path_pattern = defaults.omd_root + "%s" + rel_path + "/" + jsname + min_part + ".js" + if os.path.exists(path_pattern % "") or os.path.exists(path_pattern % "/local"): + filename_for_browser = '%s%s-%s' % (jsname, min_part, defaults.check_mk_version) + break + + return filename_for_browser + + def html_foot(self): self.write("</html>\n") diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 1742ca6..54d336c 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -278,8 +278,7 @@ def page_handler(): html.add_user_error(None, e.reason) # Title - html.header(modefunc("title"), stylesheets = wato_styles) - html.write("<script type='text/javascript' src='js/wato.js'></script>") + html.header(modefunc("title"), javascripts=["wato"], stylesheets=wato_styles) html.write("<div class=wato>\n") try: diff --git a/web/plugins/sidebar/search.py b/web/plugins/sidebar/search.py index 9f1a677..fa821b0 100644 --- a/web/plugins/sidebar/search.py +++ b/web/plugins/sidebar/search.py @@ -29,7 +29,7 @@ def render_searchform(): html.write('<input id="mk_side_search_field" type="text" name="search" autocomplete="off" />\n') html.icon_button("#", _("Search"), "quicksearch", onclick="mkSearchButton();") html.write('</div>\n<div id=mk_side_clear></div>\n') - html.write("<script type='text/javascript' src='js/search.js'></script>\n") + html.javascript_file(html.javascript_filename_for_browser("search")) sidebar_snapins["search"] = { "title": _("Quicksearch"),
8 years, 10 months
1
0
0
0
Intermediate step for DHCP check rework
by Mathias Kettner
Module: check_mk Branch: master Commit: 734d0a0955c364cdc6b87bf1b7536b0545f88286 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=734d0a0955c364…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Thu Nov 12 11:53:39 2015 +0100 Intermediate step for DHCP check rework --- checks/isc_dhcpd | 25 ++---------- checks/win_dhcp_pools | 43 +++++++++++-------- checks/win_dhcp_pools.include | 75 ++++++++++++++++++++++++++++++++++ web/plugins/metrics/check_mk.py | 44 ++++++++++++-------- web/plugins/wato/check_parameters.py | 64 +++++++++++++++++++++++------ 5 files changed, 182 insertions(+), 69 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=734d0a0955…
8 years, 10 months
1
0
0
0
Use the right kind of #include.
by Sven Panne
Module: check_mk Branch: master Commit: bbc247fc086ef2836358677e738826866ddffe33 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bbc247fc086ef2…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Thu Nov 12 11:32:31 2015 +0100 Use the right kind of #include. --- livestatus/src/HostSpecialDoubleColumn.cc | 2 +- livestatus/src/ServiceSpecialDoubleColumn.cc | 2 +- livestatus/src/global_counters.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/livestatus/src/HostSpecialDoubleColumn.cc b/livestatus/src/HostSpecialDoubleColumn.cc index 59c005d..fa30c6b 100644 --- a/livestatus/src/HostSpecialDoubleColumn.cc +++ b/livestatus/src/HostSpecialDoubleColumn.cc @@ -23,8 +23,8 @@ // Boston, MA 02110-1301 USA. #include "HostSpecialDoubleColumn.h" +#include <time.h> #include "nagios.h" -#include "time.h" extern int interval_length; diff --git a/livestatus/src/ServiceSpecialDoubleColumn.cc b/livestatus/src/ServiceSpecialDoubleColumn.cc index d3b3aac..42f976c 100644 --- a/livestatus/src/ServiceSpecialDoubleColumn.cc +++ b/livestatus/src/ServiceSpecialDoubleColumn.cc @@ -24,8 +24,8 @@ #include "ServiceSpecialDoubleColumn.h" #include <string.h> +#include <time.h> #include "nagios.h" -#include "time.h" extern int interval_length; diff --git a/livestatus/src/global_counters.c b/livestatus/src/global_counters.c index 9608445..bbb9974 100644 --- a/livestatus/src/global_counters.c +++ b/livestatus/src/global_counters.c @@ -24,7 +24,7 @@ #define EXTERN /* */ #include "global_counters.h" -#include "time.h" +#include <time.h> time_t last_statistics_update = 0; #define STATISTICS_INTERVAL 5
8 years, 10 months
1
0
0
0
Improved cppcheck target.
by Sven Panne
Module: check_mk Branch: master Commit: e24668b1486b947fa3eb8267dd5fadf8c5180beb URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e24668b1486b94…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Thu Nov 12 11:09:16 2015 +0100 Improved cppcheck target. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 373a87c..99647e0 100644 --- a/Makefile +++ b/Makefile @@ -252,7 +252,7 @@ iwyu: $(MAKE) -C livestatus CC=$(IWYU) CXX=$(IWYU) -k cppcheck: - $(CPPCHECK) --enable=all --inline-suppr --template=gcc livestatus + $(CPPCHECK) --quiet --enable=all --max-configs=20 --inline-suppr --template=gcc -I livestatus/src -I livestatus livestatus # Note: You need the doxygen and graphviz packages. documentation:
8 years, 10 months
1
0
0
0
Use C++-style casts.
by Sven Panne
Module: check_mk Branch: master Commit: cc0e5b5b29230d0ca205cc72cd53cb66bd8d4482 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cc0e5b5b29230d…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Thu Nov 12 11:23:21 2015 +0100 Use C++-style casts. --- livestatus/src/DownCommColumn.cc | 7 ++++--- livestatus/src/DowntimeOrComment.cc | 2 +- livestatus/src/HostContactsColumn.cc | 3 +-- livestatus/src/HostSpecialDoubleColumn.cc | 2 +- livestatus/src/HostSpecialIntColumn.cc | 2 +- livestatus/src/OffsetStringHostMacroColumn.cc | 3 +-- livestatus/src/OffsetStringServiceMacroColumn.cc | 3 +-- livestatus/src/ServiceContactsColumn.cc | 2 +- livestatus/src/ServiceSpecialDoubleColumn.cc | 2 +- livestatus/src/ServiceSpecialIntColumn.cc | 2 +- livestatus/src/TableHosts.cc | 3 +-- livestatus/src/TableServices.cc | 2 +- livestatus/src/auth.h | 2 +- 13 files changed, 16 insertions(+), 19 deletions(-) diff --git a/livestatus/src/DownCommColumn.cc b/livestatus/src/DownCommColumn.cc index 96b4e96..0aa5f62 100644 --- a/livestatus/src/DownCommColumn.cc +++ b/livestatus/src/DownCommColumn.cc @@ -57,11 +57,12 @@ void DownCommColumn::output(void *data, Query *query) bool found_match = false; if (!is_service){ - if (dt->_host->name == ((host*)data)->name) + if (dt->_host->name == static_cast<host*>(data)->name) found_match = true; } else - if ( dt->_service->description == ((service*)data)->description && dt->_service->host_name == ((service*)data)->host_name ) + if ( dt->_service->description == static_cast<service*>(data)->description && + dt->_service->host_name == static_cast<service*>(data)->host_name ) found_match = true; if (found_match) @@ -108,7 +109,7 @@ bool DownCommColumn::isNagiosMember(void *data, void *member) int64_t id = (int64_t)member; // Hack. Convert it back. DowntimeOrComment *dt = table->findEntry(id, _is_service); return dt != 0 && - ( dt->_service == (service *)data || (dt->_service == 0 && dt->_host == (host *)data)); + ( dt->_service == static_cast<service *>(data) || (dt->_service == 0 && dt->_host == static_cast<host *>(data))); } bool DownCommColumn::isEmpty(void *data) diff --git a/livestatus/src/DowntimeOrComment.cc b/livestatus/src/DowntimeOrComment.cc index adf9be0..2bbb525 100644 --- a/livestatus/src/DowntimeOrComment.cc +++ b/livestatus/src/DowntimeOrComment.cc @@ -65,7 +65,7 @@ DowntimeOrComment::~DowntimeOrComment() } Comment::Comment(nebstruct_comment_struct *co) - : DowntimeOrComment((nebstruct_downtime_struct *)co, co->comment_id) + : DowntimeOrComment(reinterpret_cast<nebstruct_downtime_struct *>(co), co->comment_id) , _expire_time(co->expire_time) , _persistent(co->persistent) , _source(co->source) diff --git a/livestatus/src/HostContactsColumn.cc b/livestatus/src/HostContactsColumn.cc index b4d1bd6..9c4d42f 100644 --- a/livestatus/src/HostContactsColumn.cc +++ b/livestatus/src/HostContactsColumn.cc @@ -28,6 +28,5 @@ bool HostContactsColumn::isNagiosMember(void *hst, void *ctc) { - bool is_member = is_contact_for_host((host *)hst, (contact *)ctc); - return is_member; + return is_contact_for_host(static_cast<host *>(hst), static_cast<contact *>(ctc)); } diff --git a/livestatus/src/HostSpecialDoubleColumn.cc b/livestatus/src/HostSpecialDoubleColumn.cc index a857435..59c005d 100644 --- a/livestatus/src/HostSpecialDoubleColumn.cc +++ b/livestatus/src/HostSpecialDoubleColumn.cc @@ -34,7 +34,7 @@ double HostSpecialDoubleColumn::getValue(void *data) data = shiftPointer(data); if (!data) return 0; - host *hst = (host *)data; + host *hst = static_cast<host *>(data); switch (_type) { case HSDC_STALENESS: diff --git a/livestatus/src/HostSpecialIntColumn.cc b/livestatus/src/HostSpecialIntColumn.cc index b45506c..6ce3221 100644 --- a/livestatus/src/HostSpecialIntColumn.cc +++ b/livestatus/src/HostSpecialIntColumn.cc @@ -33,7 +33,7 @@ int32_t HostSpecialIntColumn::getValue(void *data, Query *) data = shiftPointer(data); if (!data) return 0; - host *hst = (host *)data; + host *hst = static_cast<host *>(data); switch (_type) { case HSIC_REAL_HARD_STATE: if (hst->current_state == 0) diff --git a/livestatus/src/OffsetStringHostMacroColumn.cc b/livestatus/src/OffsetStringHostMacroColumn.cc index ca7c9ca..5b88843 100644 --- a/livestatus/src/OffsetStringHostMacroColumn.cc +++ b/livestatus/src/OffsetStringHostMacroColumn.cc @@ -27,8 +27,7 @@ host *OffsetStringHostMacroColumn::getHost(void *data) { - data = shiftPointer(data); - return (host *)data; + return static_cast<host *>(shiftPointer(data)); } service *OffsetStringHostMacroColumn::getService(void *) diff --git a/livestatus/src/OffsetStringServiceMacroColumn.cc b/livestatus/src/OffsetStringServiceMacroColumn.cc index 4ed2892..698e116 100644 --- a/livestatus/src/OffsetStringServiceMacroColumn.cc +++ b/livestatus/src/OffsetStringServiceMacroColumn.cc @@ -36,6 +36,5 @@ host *OffsetStringServiceMacroColumn::getHost(void *data) service *OffsetStringServiceMacroColumn::getService(void *data) { - data = shiftPointer(data); - return (service *)data; + return static_cast<service *>(shiftPointer(data)); } diff --git a/livestatus/src/ServiceContactsColumn.cc b/livestatus/src/ServiceContactsColumn.cc index 5b5555c..8a03507 100644 --- a/livestatus/src/ServiceContactsColumn.cc +++ b/livestatus/src/ServiceContactsColumn.cc @@ -28,5 +28,5 @@ bool ServiceContactsColumn::isNagiosMember(void *svc, void *ctc) { - return is_contact_for_service((service *)svc, (contact *)ctc); + return is_contact_for_service(static_cast<service *>(svc), static_cast<contact *>(ctc)); } diff --git a/livestatus/src/ServiceSpecialDoubleColumn.cc b/livestatus/src/ServiceSpecialDoubleColumn.cc index 6e9c1b1..d3b3aac 100644 --- a/livestatus/src/ServiceSpecialDoubleColumn.cc +++ b/livestatus/src/ServiceSpecialDoubleColumn.cc @@ -34,7 +34,7 @@ double ServiceSpecialDoubleColumn::getValue(void *data) data = shiftPointer(data); if (!data) return 0; - service *svc = (service *)data; + service *svc = static_cast<service *>(data); switch (_type) { case SSDC_STALENESS: { diff --git a/livestatus/src/ServiceSpecialIntColumn.cc b/livestatus/src/ServiceSpecialIntColumn.cc index 59a1c8a..80b4879 100644 --- a/livestatus/src/ServiceSpecialIntColumn.cc +++ b/livestatus/src/ServiceSpecialIntColumn.cc @@ -32,7 +32,7 @@ int32_t ServiceSpecialIntColumn::getValue(void *data, Query *) data = shiftPointer(data); if (!data) return 0; - service *svc = (service *)data; + service *svc = static_cast<service *>(data); switch (_type) { case SSIC_PNP_GRAPH_PRESENT: return pnpgraph_present(svc->host_ptr->name, svc->description); diff --git a/livestatus/src/TableHosts.cc b/livestatus/src/TableHosts.cc index af4734f..fc8a5ad 100644 --- a/livestatus/src/TableHosts.cc +++ b/livestatus/src/TableHosts.cc @@ -64,8 +64,7 @@ struct hostbygroup { bool TableHosts::isAuthorized(contact *ctc, void *data) { - host *hst = (host *)data; - return is_authorized_for(ctc, hst, 0); + return is_authorized_for(ctc, static_cast<host *>(data), 0); } diff --git a/livestatus/src/TableServices.cc b/livestatus/src/TableServices.cc index 9b0f2dd..b43d4b6 100644 --- a/livestatus/src/TableServices.cc +++ b/livestatus/src/TableServices.cc @@ -185,7 +185,7 @@ void TableServices::answerQuery(Query *query) bool TableServices::isAuthorized(contact *ctc, void *data) { - service *svc = (service *)data; + service *svc = static_cast<service *>(data); return is_authorized_for(ctc, svc->host_ptr, svc); } diff --git a/livestatus/src/auth.h b/livestatus/src/auth.h index b3aa189..d19e104 100644 --- a/livestatus/src/auth.h +++ b/livestatus/src/auth.h @@ -33,7 +33,7 @@ #define AUTH_STRICT 1 // Dummy pointer for unknown user (not no user) -#define UNKNOWN_AUTH_USER ((contact *)0xdeadbeaf) +#define UNKNOWN_AUTH_USER reinterpret_cast<contact *>(0xdeadbeaf) extern int g_service_authorization;
8 years, 10 months
1
0
0
0
#2788 ESX Monitoring, esx_vsphere_vm subchecks: VM templates are now excluded
by Andreas Boesl
Module: check_mk Branch: master Commit: 8ac42cf2f2cdda4825f95d76299fee75824cf475 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8ac42cf2f2cdda…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Thu Nov 12 11:25:17 2015 +0100 #2788 ESX Monitoring, esx_vsphere_vm subchecks: VM templates are now excluded Virtual machine templates are no longer detected during the service discovery. --- .werks/2788 | 9 +++++++++ ChangeLog | 1 + agents/special/agent_vsphere | 1 + checks/esx_vsphere_vm | 17 ++++++++++------- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.werks/2788 b/.werks/2788 new file mode 100644 index 0000000..7096fd1 --- /dev/null +++ b/.werks/2788 @@ -0,0 +1,9 @@ +Title: ESX Monitoring, esx_vsphere_vm subchecks: VM templates are now excluded +Level: 1 +Component: checks +Compatible: compat +Version: 1.2.7i4 +Date: 1447323663 +Class: feature + +Virtual machine templates are no longer detected during the service discovery. diff --git a/ChangeLog b/ChangeLog index 1634c35..2715503 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ * 2740 local: better warning output in case of invalid agent output * 2763 apache_status: Can now be configured to use the protocols default port... * 2787 netapp_api_snapvaults: Clustermode supported, netapp_api_disks: fixed invalid total disk space... + * 2788 ESX Monitoring, esx_vsphere_vm subchecks: VM templates are now excluded... * 2660 FIX: fixed windows agent using the wrong working directory... * 2664 FIX: ps: Speedup in situation with many matching processes... * 2661 FIX: windows agent: fixed incomplete process list... diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere index 204817f..0452c9d 100755 --- a/agents/special/agent_vsphere +++ b/agents/special/agent_vsphere @@ -250,6 +250,7 @@ telegram_list = { '<ns1:pathSet>summary.quickStats.overallCpuUsage</ns1:pathSet>'\ '<ns1:pathSet>config.hardware.numCoresPerSocket</ns1:pathSet>'\ '<ns1:pathSet>config.hardware.device</ns1:pathSet>'\ + '<ns1:pathSet>config.template</ns1:pathSet>'\ '<ns1:pathSet>guest.toolsVersion</ns1:pathSet>'\ '<ns1:pathSet>guestHeartbeatStatus</ns1:pathSet>'\ '<ns1:pathSet>name</ns1:pathSet>'\ diff --git a/checks/esx_vsphere_vm b/checks/esx_vsphere_vm index 4833ac2..6f0a8f2 100644 --- a/checks/esx_vsphere_vm +++ b/checks/esx_vsphere_vm @@ -24,10 +24,15 @@ # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. +# TODO: name the next new subcheck "esx_vsphere_vm" and introduce a parse function def esx_vsphere_vm_convert(info): data = {} for line in info: + # Do not monitor VM templates + if line[0] == "config.template" and line[1] == "true": + return {} data[line[0]] = line[1:] + return data # .--Memory--------------------------------------------------------------. @@ -41,7 +46,7 @@ def esx_vsphere_vm_convert(info): def inventory_esx_vsphere_vm_mem(info): - data = esx_vsphere_vm_convert(info).keys() + data = esx_vsphere_vm_convert(info) if 'summary.quickStats.guestMemoryUsage' in data: return [(None, {})] @@ -102,7 +107,7 @@ check_info['esx_vsphere_vm.mem_usage'] = { # '----------------------------------------------------------------------' def inventory_esx_vsphere_vm_name(info): - data = esx_vsphere_vm_convert(info).keys() + data = esx_vsphere_vm_convert(info) if 'name' in data: return [(None, None)] @@ -135,7 +140,6 @@ def inventory_esx_vsphere_vm_running_on(info): data = esx_vsphere_vm_convert(info) if 'runtime.host' in data: return [(None, None)] - return [] def check_esx_vsphere_vm_running_on(no_item, no_params, info): data = esx_vsphere_vm_convert(info) @@ -170,7 +174,6 @@ def inventory_esx_vsphere_vm_datastores(info): # Right now we only handle one datastore per vm if 'config.datastoreUrl' in data: return [(None, None)] - return [] def check_esx_vsphere_vm_datastores(no_item, no_params, info): data = esx_vsphere_vm_convert(info) @@ -364,9 +367,10 @@ check_info['esx_vsphere_vm.cpu'] = { # <<<esx_vsphere_vm>>> # snapshot.rootSnapshotList 1 1363596734 poweredOff 20130318_105600_snapshot_LinuxI|2 1413977827 poweredOn LinuxI Testsnapshot - def inventory_esx_vsphere_vm_snapshots(info): - return [(None, {})] + data = esx_vsphere_vm_convert(info) + if data: + return [(None, {})] def check_esx_vsphere_vm_snapshots(_no_item, params, info): data = esx_vsphere_vm_convert(info) @@ -407,7 +411,6 @@ def check_esx_vsphere_vm_snapshots(_no_item, params, info): perfdata - check_info['esx_vsphere_vm.snapshots'] = { "inventory_function" : inventory_esx_vsphere_vm_snapshots, "check_function" : check_esx_vsphere_vm_snapshots,
8 years, 10 months
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
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