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
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
February 2017
----- 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
10 participants
452 discussions
Start a n
N
ew thread
table group headers are now a bit larger rendered
by Lars Michelsen
Module: check_mk Branch: master Commit: 0ef7db972d86f127fdfc5868bbe0ef619399658f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0ef7db972d86f1…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Feb 2 14:21:30 2017 +0100 table group headers are now a bit larger rendered Change-Id: Ie94fe8f9726a8b04f7a3310dac04110b1a5a7c63 --- web/htdocs/table.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/htdocs/table.py b/web/htdocs/table.py index e967529..41838d0 100644 --- a/web/htdocs/table.py +++ b/web/htdocs/table.py @@ -290,8 +290,9 @@ def _write_table(table, rows, actions_enabled, actions_visible, search_term): if nr < len(rows) - 1 and rows[nr+1][2] != "header": html.open_tr(class_="groupheader") html.open_td(colspan=num_cols) - html.br() + html.open_h3() html.write(row) + html.close_h3() html.close_td() html.close_tr()
7 years, 7 months
1
0
0
0
Minor cleanups
by Lars Michelsen
Module: check_mk Branch: master Commit: 4b8817b09f025434ae79c00731eab1f2da355c1b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b8817b09f0254…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Jan 23 16:36:29 2017 +0100 Minor cleanups Change-Id: Iaf62c793a586fd6ceecabda21db82afa4efc1a06 --- web/htdocs/wato.py | 60 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index cd8486e..50455e5 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -2755,29 +2755,33 @@ class ModeDiscovery(WatoMode): if not html.check_transaction(): return "folder" - host = self._host - hostname = self._host.name() - # Settings for showing parameters if html.var("_show_parameters"): - parameter_column = True config.user.save_file("parameter_column", True) return + elif html.var("_hide_parameters"): - parameter_column = False config.user.save_file("parameter_column", False) return + else: + return self._do_discovery() + + + def _do_discovery(self): + host = self._host + hostname = self._host.name() + config.user.need_permission("wato.services") cache_options = html.var("_scan") and [ '@scan' ] or [ '@noscan' ] - new_target = "folder" if html.var("_refresh"): - counts, failed_hosts = check_mk_automation(host.site_id(), "inventory", [ "@scan", "refresh", hostname ]) + counts, failed_hosts = check_mk_automation(host.site_id(), "inventory", + [ "@scan", "refresh", hostname ]) count_added, count_removed, count_kept, count_new = counts[hostname] - message = _("Refreshed check configuration of host [%s] with %d services") % \ + message = _("Refreshed check configuration of host '%s' with %d services") % \ (hostname, count_added) if not host.locked(): @@ -2786,34 +2790,38 @@ class ModeDiscovery(WatoMode): add_service_change(host, "refresh-autochecks", message) else: - table = check_mk_automation(host.site_id(), "try-inventory", cache_options + [hostname]) - table.sort() - active_checks = {} - for st, ct, checkgroup, item, paramstring, params, descr, state, output, perfdata in table: - if (html.has_var("_cleanup") or html.has_var("_fixall")) \ - and st == "vanished": + table = sorted(check_mk_automation(host.site_id(), "try-inventory", + cache_options + [hostname])) + + checks = {} + for st, ct, checkgroup, item, paramstring, params, \ + descr, state, output, perfdata in table: + + if (html.has_var("_cleanup") or html.has_var("_fixall")) and st == "vanished": pass - elif (html.has_var("_activate_all") or html.has_var("_fixall")) \ - and st == "new": - active_checks[(ct, item)] = paramstring + + elif (html.has_var("_activate_all") or html.has_var("_fixall")) and st == "new": + checks[(ct, item)] = paramstring + else: varname = "_%s_%s" % (ct, html.varencode(item)) if html.var(varname, "") != "": - active_checks[(ct, item)] = paramstring + checks[(ct, item)] = paramstring + if st.startswith("clustered"): - active_checks[(ct, item)] = paramstring + checks[(ct, item)] = paramstring - check_mk_automation(host.site_id(), "set-autochecks", [hostname], active_checks) + check_mk_automation(host.site_id(), "set-autochecks", [hostname], checks) - message = _("Saved check configuration of host [%s] with %d services") % \ - (hostname, len(active_checks)) + message = _("Saved check configuration of host '%s' with %d services") % \ + (hostname, len(checks)) if not host.locked(): host.clear_discovery_failed() add_service_change(host, "set-autochecks", message) - return new_target, message + return "folder", message def page(self): @@ -2846,9 +2854,9 @@ class ModeDiscovery(WatoMode): else: html.button("_show_parameters", _("Show Check Parameters")) - html.hidden_fields() if html.var("_scan"): - html.hidden_field("_scan", "on") + html.hidden_field("_scan", "on", add_var=True) + table.begin(css="data", searchable=False, limit=None, sortable=False) @@ -2865,6 +2873,8 @@ class ModeDiscovery(WatoMode): self._check_row(check, checkbox) table.end() + + html.hidden_fields() html.end_form()
7 years, 7 months
1
0
0
0
Changed order of service discovery columns to be more consistent with other views
by Lars Michelsen
Module: check_mk Branch: master Commit: 44517a6b85fe9df7ac1992ad4b28ba7bbba041ed URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=44517a6b85fe9d…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Jan 23 17:31:41 2017 +0100 Changed order of service discovery columns to be more consistent with other views Change-Id: I3c2654a856462140b191657b79678b168d64d82d --- web/htdocs/wato.py | 135 +++++++++++++++++++++++++++-------------------------- 1 file changed, 68 insertions(+), 67 deletions(-) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 50455e5..cb069cb 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -2713,6 +2713,8 @@ class ModeDiscovery(WatoMode): self._host.need_permission("read") + self._cache_options = html.var("_scan") and [ '@scan' ] or [ '@noscan' ] + def title(self): title = _("Services of host %s") % self._host_name @@ -2774,8 +2776,6 @@ class ModeDiscovery(WatoMode): config.user.need_permission("wato.services") - cache_options = html.var("_scan") and [ '@scan' ] or [ '@noscan' ] - if html.var("_refresh"): counts, failed_hosts = check_mk_automation(host.site_id(), "inventory", [ "@scan", "refresh", hostname ]) @@ -2791,7 +2791,7 @@ class ModeDiscovery(WatoMode): else: table = sorted(check_mk_automation(host.site_id(), "try-inventory", - cache_options + [hostname])) + self._cache_options + [hostname])) checks = {} for st, ct, checkgroup, item, paramstring, params, \ @@ -2886,7 +2886,7 @@ class ModeDiscovery(WatoMode): ("old", _("Already configured services"), True), ("ignored", _("Disabled services (configured away by admin)"), None), ("active", _("Active checks"), None), - ("manual", _("Manual services"), None ), + ("manual", _("Manual checks"), None ), ("legacy", _("Legacy services (defined in main.mk)"), None ), ("custom", _("Custom checks (defined via rule)"), None ), ("clustered_old", _("Already configured clustered services (located on cluster host)"), None ), @@ -2906,38 +2906,6 @@ class ModeDiscovery(WatoMode): else: stateclass = "state svcstate state%s" % state - table.row(css="data", state=state) - - # Status, Checktype, Item, Description, Check Output - table.cell(_("Status"), statename, css=stateclass) - - if check_source == "active": - ctype = "check_" + check_type - else: - ctype = check_type - - manpage_url = folder_preserving_link([("mode", "check_manpage"), - ("check_type", ctype)]) - table.cell(_("Checkplugin"), - html.render_a(content=ctype, href=manpage_url)) - - table.cell(_("Item"), html.attrencode(item)) - table.cell(_("Service Description"), html.attrencode(descr)) - - table.cell(_("Plugin output")) - if check_source in ("custom", "active"): - div_id = "activecheck_%s" % descr - html.div(html.render_icon("reload", cssclass="reloading"), id_=div_id) - html.final_javascript("execute_active_check(%s, %s, %s, %s, %s);" % ( - json.dumps(self._host.site_id() or ''), - json.dumps(self._host_name), - json.dumps(check_type), - json.dumps(item), - json.dumps(div_id) - )) - else: - html.write_text(output) - # Icon for Rule editor, Check parameters if checkgroup: varname = "checkgroup_parameters:" + checkgroup @@ -2946,27 +2914,18 @@ class ModeDiscovery(WatoMode): else: varname = None - if self._show_parameter_column(): - table.cell(_("Check Parameters")) - if varname and g_rulespecs.exists(varname): - rulespec = g_rulespecs.get(varname) - try: - rulespec.valuespec.validate_datatype(params, "") - rulespec.valuespec.validate_value(params, "") - paramtext = rulespec.valuespec.value_to_text(params) - html.write_html(paramtext) - except Exception, e: - if config.debug: - err = traceback.format_exc() - else: - err = e - paramtext = _("Invalid check parameter: %s!") % err - paramtext += _(" The parameter is: %r") % (params,) - paramtext += _(" The variable name is: %s") % varname - html.write_text(paramtext) - - # Icon for Service parameters. Not for missing services! - table.cell(css='buttons') + table.row(css="data", state=state) + + # Checkbox for temporarily skipping services + if config.user.may("wato.services"): + table.cell() + if checkbox != None: + checkbox_varname = "_%s_%s" % (check_type, html.varencode(item)) + html.checkbox(checkbox_varname, checkbox, + add_attr = ['title="%s"' % _('Temporarily ignore this service')]) + + # Icon for service parameters. Not for missing services! + table.cell(css="buttons") if check_source not in [ "new", "ignored" ] and config.user.may('wato.rulesets'): # Link to list of all rulesets affecting this service params_url = folder_preserving_link([("mode", "object_parameters"), @@ -3004,31 +2963,73 @@ class ModeDiscovery(WatoMode): ]) html.icon_button(url, _("Create rule to permanently disable this service"), "ignore") - # Temporary ignore checkbox - if config.user.may("wato.services"): - table.cell() - if checkbox != None: - varname = "_%s_%s" % (check_type, html.varencode(item)) - html.checkbox(varname, checkbox, - add_attr = ['title="%s"' % _('Temporarily ignore this service')]) + + # Status, Checktype, Item, Description, Check Output + table.cell(_("State"), statename, css=stateclass) + + table.cell(_("Service"), html.attrencode(descr)) + + table.cell(_("Status detail")) + if check_source in ("custom", "active"): + div_id = "activecheck_%s" % descr + html.div(html.render_icon("reload", cssclass="reloading"), id_=div_id) + html.final_javascript("execute_active_check(%s, %s, %s, %s, %s);" % ( + json.dumps(self._host.site_id() or ''), + json.dumps(self._host_name), + json.dumps(check_type), + json.dumps(item), + json.dumps(div_id) + )) + else: + html.write_text(output) + + ctype = "check_" + check_type if check_source == "active" else check_type + manpage_url = folder_preserving_link([("mode", "check_manpage"), + ("check_type", ctype)]) + table.cell(_("Checkplugin"), + html.render_a(content=ctype, href=manpage_url)) + + table.cell(_("Item"), html.attrencode(item)) + + if self._show_parameter_column(): + table.cell(_("Check Parameters")) + self._show_check_parameters(varname, params) def _show_parameter_column(self): return config.user.load_file("parameter_column", False) + def _show_check_parameters(self, varname, params): + if varname and g_rulespecs.exists(varname): + rulespec = g_rulespecs.get(varname) + try: + rulespec.valuespec.validate_datatype(params, "") + rulespec.valuespec.validate_value(params, "") + paramtext = rulespec.valuespec.value_to_text(params) + html.write_html(paramtext) + except Exception, e: + if config.debug: + err = traceback.format_exc() + else: + err = e + paramtext = _("Invalid check parameter: %s!") % err + paramtext += _(" The parameter is: %r") % (params,) + paramtext += _(" The variable name is: %s") % varname + html.write_text(paramtext) + + # We first try using the cache (if the user has not pressed Full Scan). # If we do not find any data, we omit the cache and immediately try # again without using the cache. def _get_check_table(self): # Read current check configuration - cache_options = html.var("_scan") and [ '@scan' ] or [ '@noscan' ] error_options = not html.var("ignoreerrors") and [ "@raiseerrors" ] or [] - options = cache_options + error_options + [ self._host_name ] + options = self._cache_options + error_options + [ self._host_name ] check_table = check_mk_automation(self._host.site_id(), "try-inventory", options) - if not check_table and cache_options != []: + if not check_table and self._cache_options != []: check_table = check_mk_automation(self._host.site_id(), "try-inventory", [ '@scan', self._host_name ]) html.set_var("_scan", "on")
7 years, 7 months
1
0
0
0
Started implementing bulk actions for the different states
by Lars Michelsen
Module: check_mk Branch: master Commit: c0ad2dba8c974f14f3431c63693cd696d0bf2841 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c0ad2dba8c974f…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Tue Jan 24 10:29:43 2017 +0100 Started implementing bulk actions for the different states Change-Id: I68bba3c27e823354d1fbfcb67a3c89eac8a41584 --- web/htdocs/htmllib.py | 5 +- web/htdocs/js/wato.js | 3 +- web/htdocs/table.py | 5 +- web/htdocs/wato.py | 177 ++++++++++++++++++++++++++++++++++++-------------- 4 files changed, 136 insertions(+), 54 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=c0ad2dba8c…
7 years, 7 months
1
0
0
0
Started recoding row buttons
by Lars Michelsen
Module: check_mk Branch: master Commit: 9056d200bc240a45353aef2684b538c5dca4a629 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9056d200bc240a…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Tue Jan 24 11:49:39 2017 +0100 Started recoding row buttons Change-Id: Idd2da4a81b7399b005783a0d7d7f044c34fd6b09 --- web/htdocs/wato.py | 158 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 98 insertions(+), 60 deletions(-) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 3ed6e81..f053d6b 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -2918,69 +2918,13 @@ class ModeDiscovery(WatoMode): else: stateclass = "state svcstate state%s" % state - # Icon for Rule editor, Check parameters - if checkgroup: - varname = "checkgroup_parameters:" + checkgroup - elif check_source == "active": - varname = "active_checks:" + check_type - else: - varname = None - table.row(css="data", state=state) - # Checkbox for temporarily skipping services - if self._show_checkboxes: - table.cell("<input type=button class=checkgroup name=_toggle_group" - " onclick=\"toggle_all_rows();\" value=\"X\" />", sortable=False) - - html.checkbox("_%s_%s" % (check_type, html.varencode(item)), True, - add_attr = ['title="%s"' % _('Temporarily ignore this service')]) - - # Icon for service parameters. Not for missing services! - table.cell(css="buttons") - if check_source not in [ "new", "ignored" ] and config.user.may('wato.rulesets'): - # Link to list of all rulesets affecting this service - params_url = folder_preserving_link([("mode", "object_parameters"), - ("host", self._host_name), - ("service", descr)]) - html.icon_button(params_url, - _("View and edit the parameters for this service"), "rulesets") + self._show_bulk_checkbox(check_type, item) + self._show_actions(check) - url = folder_preserving_link([("mode", "edit_ruleset"), - ("varname", varname), - ("host", self._host_name), - ("item", mk_repr(item))]) - html.icon_button(url, - _("Edit and analyze the check parameters of this service"), "check_parameters") - - if check_source == "ignored" and may_edit_ruleset("ignored_services"): - url = folder_preserving_link([("mode", "edit_ruleset"), - ("varname", "ignored_services"), - ("host", self._host_name), - ("item", mk_repr(descr))]) - html.icon_button(url, _("Edit and analyze the disabled services rules"), "ignore") - - # Permanently disable icon - if check_source in ['new', 'old'] and may_edit_ruleset("ignored_services"): - url = folder_preserving_link([ - ('mode', 'edit_ruleset'), - ('varname', 'ignored_services'), - ('host', self._host_name), - ('item', mk_repr(descr)), - ('mode', 'new_rule'), - ('_new_host_rule', '1'), - ('filled_in', 'new_rule'), - ('rule_folder', ''), - ('back_mode', 'inventory'), - ]) - html.icon_button(url, _("Create rule to permanently disable this service"), "ignore") - - - # Status, Checktype, Item, Description, Check Output table.cell(_("State"), statename, css=stateclass) - table.cell(_("Service"), html.attrencode(descr)) - table.cell(_("Status detail")) if check_source in ("custom", "active"): div_id = "activecheck_%s" % descr @@ -3005,14 +2949,89 @@ class ModeDiscovery(WatoMode): if self._show_parameter_column(): table.cell(_("Check parameters")) - self._show_check_parameters(varname, params) + self._show_check_parameters(check_source, check_type, checkgroup, params) + + + def _show_actions(self, check): + check_source, check_type, checkgroup, item, paramstring, params, \ + descr, state, output, perfdata = check + + def disable_button(): + url = "" # TODO + html.icon_button(url, _("Permanently disable this service"), "ignore", ty="icon") + + def activate_button(): + url = "" # TODO + html.icon_button(url, _("Activate this service"), "new", ty="icon") + + def remove_button(): + url = "" # TODO + html.icon_button(url, _("Remove this service"), "delete", ty="icon") + + def rulesets_button(): + # Link to list of all rulesets affecting this service + params_url = folder_preserving_link([("mode", "object_parameters"), + ("host", self._host_name), + ("service", descr)]) + html.icon_button(params_url, + _("View and edit the parameters for this service"), "rulesets") + + def check_parameters_button(): + url = folder_preserving_link([("mode", "edit_ruleset"), + ("varname", self._get_ruleset_name(check_source, check_type, checkgroup)), + ("host", self._host_name), + ("item", mk_repr(item))]) + html.icon_button(url, + _("Edit and analyze the check parameters of this service"), "check_parameters") + + def disabled_services_button(): + url = folder_preserving_link([("mode", "edit_ruleset"), + ("varname", "ignored_services"), + ("host", self._host_name), + ("item", mk_repr(descr))]) + html.icon_button(url, _("Edit and analyze the disabled services rules"), "ignore") + + + table.cell(css="buttons") + if check_source == "new": + activate_button() + + if check_source not in [ "new", "ignored" ] and config.user.may('wato.rulesets'): + rulesets_button() + check_parameters_button() + + if check_source == "ignored" and may_edit_ruleset("ignored_services"): + disabled_services_button() + + if check_source in [ "new", "old" ]: + disable_button() + + if check_source in [ "old", "vanished" ]: + remove_button() + + # TODO + ## Permanently disable icon + #if check_source in ['new', 'old'] and may_edit_ruleset("ignored_services"): + # url = folder_preserving_link([ + # ('mode', 'edit_ruleset'), + # ('varname', 'ignored_services'), + # ('host', self._host_name), + # ('item', mk_repr(descr)), + # ('mode', 'new_rule'), + # ('_new_host_rule', '1'), + # ('filled_in', 'new_rule'), + # ('rule_folder', ''), + # ('back_mode', 'inventory'), + # ]) + # html.icon_button(url, _("Create rule to permanently disable this service"), "ignore") def _show_parameter_column(self): return config.user.load_file("parameter_column", False) - def _show_check_parameters(self, varname, params): + def _show_check_parameters(self, check_source, check_type, checkgroup, params): + varname = self._get_ruleset_name(check_source, check_type, checkgroup) if varname and g_rulespecs.exists(varname): rulespec = g_rulespecs.get(varname) try: @@ -3031,6 +3050,25 @@ class ModeDiscovery(WatoMode): html.write_text(paramtext) + def _get_ruleset_name(self, check_source, check_type, checkgroup): + if checkgroup: + return "checkgroup_parameters:" + checkgroup + elif check_source == "active": + return "active_checks:" + check_type + else: + return None + + + def _show_bulk_checkbox(self, check_type, item): + # Checkbox for bulk actions + if self._show_checkboxes: + table.cell("<input type=button class=checkgroup name=_toggle_group" + " onclick=\"toggle_all_rows();\" value=\"X\" />", sortable=False) + + html.checkbox("_%s_%s" % (check_type, html.varencode(item)), True, + add_attr = ['title="%s"' % _('Temporarily ignore this service')]) + + # We first try using the cache (if the user has not pressed Full Scan). # If we do not find any data, we omit the cache and immediately try # again without using the cache.
7 years, 7 months
1
0
0
0
service discovery: Moved actions from context buttons to action buttons
by Lars Michelsen
Module: check_mk Branch: master Commit: 2b691dbff307cbf99dae9cf388ba784b7e46f82d URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2b691dbff307cb…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Feb 2 14:17:54 2017 +0100 service discovery: Moved actions from context buttons to action buttons Change-Id: Ia569b46306034d7a1bf9e04c6024d152a080420d --- web/htdocs/wato.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 6dd4647..9401350 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -2763,16 +2763,6 @@ class ModeDiscovery(WatoMode): folder_preserving_link([("mode", "diag_host"), ("host", self._host_name)]), "diagnose") - if config.user.may("wato.services"): - html.context_button(_("Full Scan"), html.makeuri([("_scan", "yes")])) - - if self._show_parameter_column(): - html.context_button(_("Hide parameters"), - html.makeuri([("_hide_parameters", "yes")]), "check_parameters") - else: - html.context_button(_("Show parameters"), - html.makeuri([("_hide_parameters", "no")]), "check_parameters") - def action(self): if not html.check_transaction(): @@ -2898,7 +2888,7 @@ class ModeDiscovery(WatoMode): # check_source, show bulk actions, title ("new", True, _("Available services (not yet checked)")), ("vanished", True, _("Vanished services (checked, but no longer exist)")), - ("old", True, _("Already configured services")), + ("old", True, _("Enabled services (being checked)")), ("ignored", False, _("Disabled services (configured away by admin)")), ("active", False, _("Active checks")), ("manual", False, _("Manual checks")), @@ -2964,7 +2954,7 @@ class ModeDiscovery(WatoMode): def activate_button(): url = "" # TODO - html.icon_button(url, _("Activate this service"), "new", ty="icon") + html.icon_button(url, _("Monitor this service"), "new", ty="icon") def remove_button(): url = "" # TODO @@ -3117,7 +3107,16 @@ class ModeDiscovery(WatoMode): html.button("_fixall", _("Fix all missing/vanished")) if self._already_has_services(check_table): - html.button("_refresh", _("Automatic Refresh (Tabula Rasa)")) + html.button("_refresh", _("Automatic refresh (tabula rasa)")) + + if self._show_parameter_column(): + html.buttonlink(html.makeuri([("_hide_parameters", "yes")]), + _("Hide check parameters")) + else: + html.buttonlink(html.makeuri([("_hide_parameters", "no")]), + _("Show check parameters")) + + html.buttonlink(html.makeuri([("_scan", "yes")]), _("Full scan")) def _already_has_services(self, check_table): @@ -3155,7 +3154,7 @@ class ModeDiscovery(WatoMode): html.write_text(" %s: " % label) if check_source == "new": - html.button("_bulk_activate", _("Activate")) + html.button("_bulk_activate", _("Enable")) html.button("_bulk_disable", _("Disable")) elif check_source == "vanished":
7 years, 7 months
1
0
0
0
Removed obsolete obsolete discovered services state
by Lars Michelsen
Module: check_mk Branch: master Commit: 7b514e7a49795ca48585ec86e0631e276be2e3ad URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b514e7a49795c…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Jan 23 14:32:45 2017 +0100 Removed obsolete obsolete discovered services state Change-Id: I84e1804545f2820ec9a23a97046a4011b07f383b --- modules/discovery.py | 10 +++------- web/htdocs/wato.py | 7 +++---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/modules/discovery.py b/modules/discovery.py index a825401..9bad839 100644 --- a/modules/discovery.py +++ b/modules/discovery.py @@ -196,7 +196,7 @@ def discover_on_host(mode, hostname, do_snmp_scan, use_caches, on_error="ignore" new_items[(check_type, item)] = paramstring counts["kept"] += 1 - elif check_source in ("obsolete", "vanished"): + elif check_source == "vanished": # keep item, if we are currently only looking for new services # otherwise fix it: remove ignored and non-longer existing services if mode not in ("fixall", "remove") or not service_filter(hostname, check_type, item): @@ -960,7 +960,6 @@ def discoverable_check_types(what): # snmp, tcp, all # "custom" : Check is defined via custom_checks # "manual" : Check is a manual Check_MK check without service discovery # "ignored" : discovered or static, but disabled via ignored_services -# "obsolete" : Discovered by vanished check is meanwhile ignored via ignored_services # "clustered_new" : New service found on a node that belongs to a cluster # "clustered_old" : Old service found on a node that belongs to a cluster # This function is cluster-aware @@ -1042,7 +1041,7 @@ def merge_manual_services(services, hostname, on_error): descr = act_info["service_description"](params) services[(acttype, descr)] = ('active', repr(params)) - # Handle disabled services -> "obsolete" and "ignored" + # Handle disabled services -> "ignored" for (check_type, item), (check_source, paramstring) in services.items(): try: descr = service_description(hostname, check_type, item) @@ -1055,10 +1054,7 @@ def merge_manual_services(services, hostname, on_error): continue # ignore if service_ignored(hostname, check_type, descr): - if check_source == "vanished": - new_source = "obsolete" - else: - new_source = "ignored" + new_source = "ignored" services[(check_type, item)] = (new_source, paramstring) return services diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 24ff861..cd8486e 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -2791,7 +2791,7 @@ class ModeDiscovery(WatoMode): active_checks = {} for st, ct, checkgroup, item, paramstring, params, descr, state, output, perfdata in table: if (html.has_var("_cleanup") or html.has_var("_fixall")) \ - and st in [ "vanished", "obsolete" ]: + and st == "vanished": pass elif (html.has_var("_activate_all") or html.has_var("_fixall")) \ and st == "new": @@ -2872,12 +2872,11 @@ class ModeDiscovery(WatoMode): return [ # check_source, title, initial checkbox value ("new", _("Available (missing) services"), isinstance(self, ModeFirstDiscovery)), - ("obsolete", _("Obsolete services (being checked, but should be ignored)"), True ), # Cannot happen anymore ("vanished", _("Vanished services (checked, but no longer exist)"), True ), ("old", _("Already configured services"), True), ("ignored", _("Disabled services (configured away by admin)"), None), ("active", _("Active checks"), None), - ("manual", _("Manual services (defined in main.mk)"), None ), + ("manual", _("Manual services"), None ), ("legacy", _("Legacy services (defined in main.mk)"), None ), ("custom", _("Custom checks (defined via rule)"), None ), ("clustered_old", _("Already configured clustered services (located on cluster host)"), None ), @@ -3049,7 +3048,7 @@ class ModeDiscovery(WatoMode): break for entry in check_table: - if entry[0] in [ 'obsolete', 'vanished', ]: + if entry[0] == 'vanished': html.button("_cleanup", _("Remove vanished")) fixall += 1 break
7 years, 7 months
1
0
0
0
Cleaned up bulk actions a bit
by Lars Michelsen
Module: check_mk Branch: master Commit: 7e45d8f9de01956add3d3d33262d683033e4696e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7e45d8f9de0195…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Tue Jan 24 15:51:22 2017 +0100 Cleaned up bulk actions a bit Change-Id: Ic157c5a0be0edfaad566ab484eedef221368ade8 --- web/htdocs/wato.css | 4 +++ web/htdocs/wato.py | 76 +++++++++++++++++++++++++++-------------------------- 2 files changed, 43 insertions(+), 37 deletions(-) diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css index 4105c82..b0808fd 100644 --- a/web/htdocs/wato.css +++ b/web/htdocs/wato.css @@ -232,6 +232,10 @@ table.validationerror img { text-align: right; } +.wato td.bulkactions.service_discovery { + text-align: left; +} + .wato table.data tr.data td.bulksearch { padding-right: 0px; white-space: nowrap; diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index f053d6b..6dd4647 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -2788,53 +2788,57 @@ class ModeDiscovery(WatoMode): config.user.need_permission("wato.services") if html.var("_refresh"): - counts, failed_hosts = check_mk_automation(host.site_id(), "inventory", - [ "@scan", "refresh", hostname ]) - count_added, count_removed, count_kept, count_new = counts[hostname] - - message = _("Refreshed check configuration of host '%s' with %d services") % \ - (hostname, count_added) - - if not host.locked(): - host.clear_discovery_failed() - - add_service_change(host, "refresh-autochecks", message) + message = self._refresh_discovery(hostname) else: - table = sorted(check_mk_automation(host.site_id(), "try-inventory", + check_table = sorted(check_mk_automation(host.site_id(), "try-inventory", self._cache_options + [hostname])) checks = {} - for st, ct, checkgroup, item, paramstring, params, \ - descr, state, output, perfdata in table: + for check_source, check_type, checkgroup, item, paramstring, params, \ + descr, state, output, perfdata in check_table: - if (html.has_var("_cleanup") or html.has_var("_fixall")) and st == "vanished": + if (html.has_var("_cleanup") or html.has_var("_fixall")) and check_source == "vanished": pass - elif (html.has_var("_activate_all") or html.has_var("_fixall")) and st == "new": - checks[(ct, item)] = paramstring + elif (html.has_var("_activate_all") or html.has_var("_fixall")) and check_source == "new": + checks[(check_type, item)] = paramstring else: - varname = "_%s_%s" % (ct, html.varencode(item)) + varname = "_%s_%s" % (check_type, html.varencode(item)) if html.var(varname, "") != "": - checks[(ct, item)] = paramstring + checks[(check_type, item)] = paramstring - if st.startswith("clustered"): - checks[(ct, item)] = paramstring + if check_source.startswith("clustered"): + checks[(check_type, item)] = paramstring check_mk_automation(host.site_id(), "set-autochecks", [hostname], checks) message = _("Saved check configuration of host '%s' with %d services") % \ (hostname, len(checks)) - if not host.locked(): - host.clear_discovery_failed() - add_service_change(host, "set-autochecks", message) + if not host.locked(): + host.clear_discovery_failed() + return "folder", message + def _refresh_discovery(self): + hostname = self._host.name() + counts, failed_hosts = check_mk_automation(self._host.site_id(), "inventory", + [ "@scan", "refresh", hostname ]) + count_added, count_removed, count_kept, count_new = counts[hostname] + + message = _("Refreshed check configuration of host '%s' with %d services") % \ + (hostname, count_added) + + add_service_change(host, "refresh-autochecks", message) + + return message + + def page(self): self._service_tables() @@ -2920,7 +2924,7 @@ class ModeDiscovery(WatoMode): table.row(css="data", state=state) - self._show_bulk_checkbox(check_type, item) + self._show_bulk_checkbox(check_source, check_type, item) self._show_actions(check) table.cell(_("State"), statename, css=stateclass) @@ -2945,8 +2949,6 @@ class ModeDiscovery(WatoMode): table.cell(_("Check plugin"), html.render_a(content=ctype, href=manpage_url)) - table.cell(_("Item"), html.attrencode(item)) - if self._show_parameter_column(): table.cell(_("Check parameters")) self._show_check_parameters(check_source, check_type, checkgroup, params) @@ -3059,14 +3061,15 @@ class ModeDiscovery(WatoMode): return None - def _show_bulk_checkbox(self, check_type, item): - # Checkbox for bulk actions - if self._show_checkboxes: - table.cell("<input type=button class=checkgroup name=_toggle_group" - " onclick=\"toggle_all_rows();\" value=\"X\" />", sortable=False) + def _show_bulk_checkbox(self, check_source, check_type, item): + if not self._show_checkboxes: + return - html.checkbox("_%s_%s" % (check_type, html.varencode(item)), True, - add_attr = ['title="%s"' % _('Temporarily ignore this service')]) + table.cell("<input type=button class=checkgroup name=_toggle_group" + " onclick=\"toggle_group_rows(this);\" value=\"X\" />", sortable=False) + + html.checkbox("_%s_%s_%s" % (check_source, check_type, html.varencode(item)), True, + add_attr = ['title="%s"' % _('Temporarily ignore this service')]) # We first try using the cache (if the user has not pressed Full Scan). @@ -3130,8 +3133,7 @@ class ModeDiscovery(WatoMode): table.row(collect_headers=collect_headers, fixed=True) - table.cell(css="bulksearch") - + table.cell() if not self._show_checkboxes: onclick_uri = html.makeuri([('_show_checkboxes', '1'), ('selection', weblib.selection_id())]) checkbox_title = _('Show Checkboxes and bulk actions') @@ -3144,7 +3146,7 @@ class ModeDiscovery(WatoMode): onclick="location.href=\'%s\'" % onclick_uri, is_context_button=False) - table.cell(css="bulkactions", colspan=self._bulk_action_colspan()) + table.cell(css="bulkactions service_discovery", colspan=self._bulk_action_colspan()) if self._show_checkboxes: label = _("Selected services")
7 years, 7 months
1
0
0
0
Werks are precompiled nowadays.
by Sven Panne
Module: check_mk Branch: master Commit: c02fb149df2c91fe8636b90b9b01dbbfe69d56ea URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c02fb149df2c91…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Fri Feb 3 14:27:34 2017 +0100 Werks are precompiled nowadays. Change-Id: I33b3ecaa6a793e806c2e1c9d88f562b76f82e2ae --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index be74945..91296ff 100644 --- a/Makefile +++ b/Makefile @@ -169,7 +169,7 @@ dist: mk-livestatus precompile-werks tar czf $(DISTNAME).tar.gz $(TAROPTS) $(DISTNAME) rm -rf $(DISTNAME) - test -d enterprise && tar czf cmc-$(VERSION).tar.gz $(TAROPTS) -C enterprise $$(cd enterprise && echo .bugs .werks *) + test -d enterprise && tar czf cmc-$(VERSION).tar.gz $(TAROPTS) -C enterprise $$(cd enterprise && echo .bugs *) @echo "==============================================================================" @echo " FINISHED. "
7 years, 7 months
1
0
0
0
Simplification.
by Sven Panne
Module: check_mk Branch: master Commit: c8d948f5712ebe7f9a5832a90e0788d5ed81603f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c8d948f5712ebe…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Fri Feb 3 14:24:00 2017 +0100 Simplification. Change-Id: I57ce788ba6a9883bb147998d35866a6a72114f62 --- Makefile | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 89a02ae..be74945 100644 --- a/Makefile +++ b/Makefile @@ -22,12 +22,6 @@ # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. -ifneq (,$(wildcard enterprise)) -ENTERPRISE := yes -else -ENTERPRISE := no -endif - SHELL := /bin/bash VERSION := 1.4.0i4 NAME := check_mk @@ -226,11 +220,9 @@ setversion: sed -i 's/^VERSION=.*/VERSION='"$(NEW_VERSION)"'/' scripts/setup.sh ; \ echo 'check-mk_$(NEW_VERSION)-1_all.deb net optional' > debian/files $(MAKE) -C agents NEW_VERSION=$(NEW_VERSION) setversion -ifeq ($(ENTERPRISE),yes) - sed -i 's/^VERSION=".*/VERSION="$(NEW_VERSION)"/' enterprise/bin/liveproxyd - sed -i 's/^VERSION=".*/VERSION="$(NEW_VERSION)"/' enterprise/bin/cmcdump - sed -i 's/^__version__ = ".*/__version__ = "$(NEW_VERSION)"/' enterprise/agents/plugins/cmk-update-agent -endif + test -d enterprise && sed -i 's/^VERSION=".*/VERSION="$(NEW_VERSION)"/' enterprise/bin/liveproxyd + test -d enterprise && sed -i 's/^VERSION=".*/VERSION="$(NEW_VERSION)"/' enterprise/bin/cmcdump + test -d enterprise && sed -i 's/^__version__ = ".*/__version__ = "$(NEW_VERSION)"/' enterprise/agents/plugins/cmk-update-agent headers: doc/helpers/headrify @@ -352,10 +344,8 @@ GTAGS: config.h compile_commands.json: config.h $(FILES_TO_FORMAT) $(MAKE) -C livestatus clean $(BEAR) $(MAKE) -C livestatus -j8 -ifeq ($(ENTERPRISE),yes) - $(MAKE) -C enterprise/core clean - $(BEAR) --append $(MAKE) -C enterprise/core -j8 -endif + test -d enterprise && $(MAKE) -C enterprise/core clean + test -d enterprise && $(BEAR) --append $(MAKE) -C enterprise/core -j8 tidy: compile_commands.json @scripts/compiled_sources | xargs $(CLANG_TIDY) --extra-arg=-D__clang_analyzer__
7 years, 7 months
1
0
0
0
← Newer
1
...
34
35
36
37
38
39
40
...
46
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Results per page:
10
25
50
100
200