Skip to content
Permalink
Browse files

Updated state colors, disabled aggregation_id, use correct gui theme

Change-Id: I139e0a0465199c6786414e49b4bf4114143a29d4
  • Loading branch information...
Andreas Boesl
Andreas Boesl committed Jun 26, 2019
1 parent 19cd1d6 commit fe1736799f577ab524b76e388b63428d57021df1
@@ -441,7 +441,7 @@ def compile_job(self, job, job_info):
raise MKConfigError("Aggregation groups mismatch")

aggr_options, aggr = aggr[0], aggr[1:]
aggregation_id = aggr_options.get("id", "")
# aggregation_id = aggr_options.get("id", "")
use_layout_id = aggr_options.get("use_layout_id", "")
use_hard_states = aggr_options.get("hard_states")
downtime_aggr_warn = aggr_options.get("downtime_aggr_warn")
@@ -455,7 +455,7 @@ def compile_job(self, job, job_info):

for this_entry in new_entries:
remove_empty_nodes(this_entry)
this_entry["aggregation_id"] = aggregation_id
# this_entry["aggregation_id"] = aggregation_id
this_entry["use_layout_id"] = use_layout_id
this_entry["use_hard_states"] = use_hard_states
this_entry["downtime_aggr_warn"] = downtime_aggr_warn
@@ -2145,7 +2145,7 @@ def compile_leaf_node(host_re, service_re=config.HOST_STATE):
# the states of all nodes
def execute_tree(tree, status_info=None):
aggregation_options = {
# "use_aggregation_id": tree["aggregation_id"],
# "aggregation_id": tree["aggregation_id"],
"use_layout_id": tree["use_layout_id"],
"use_hard_states": tree["use_hard_states"],
"downtime_aggr_warn": tree["downtime_aggr_warn"],
@@ -49,7 +49,7 @@ def _bi_map():
html.javascript(
"node_instance = new cmk.node_visualization.BIVisualization(%s);" % json.dumps(div_id))

html.javascript("node_instance.set_theme(%s)" % html.get_theme())
html.javascript("node_instance.set_theme(%s)" % json.dumps(html.get_theme()))
html.javascript("node_instance.show_aggregations(%s, %s)" % (json.dumps([aggr_name]),
json.dumps(layout_id)))

@@ -799,85 +799,87 @@ def transform_aggregation_groups_to_disk(groups):
title=_("Aggregation Properties"),
optional_keys=False,
render="form",
elements=cme_elements +
[("id",
TextAscii(
title=_("Aggregation ID"),
help=_(
"The ID of the aggregation must be a unique text. It will be as unique ID."),
allow_empty=False,
size=80,
)),
("groups",
Transform(
ListOf(
Alternative(
style="dropdown",
orientation="horizontal",
elements=[
TextUnicode(title=_("Group name")),
ListOfStrings(
title=_("Group path"), orientation="horizontal", separator="/"),
],
elements=cme_elements + [
# ("id",
# TextAscii(
# title=_("Aggregation ID"),
# help=_(
# "The ID of the aggregation must be a unique text. It will be as unique ID."),
# allow_empty=False,
# size=80,
# )),
("groups",
Transform(
ListOf(
Alternative(
style="dropdown",
orientation="horizontal",
elements=[
TextUnicode(title=_("Group name")),
ListOfStrings(
title=_("Group path"), orientation="horizontal",
separator="/"),
],
),
title=_("Aggregation Groups")),
back=transform_aggregation_groups_to_disk,
forth=transform_aggregation_groups_to_gui,
)),
("node",
CascadingDropdown(
title=_("Rule to call"),
choices=self._node_call_choices() + self._foreach_choices(
self._node_call_choices()))),
("disabled",
Checkbox(
title=_("Disabled"),
label=_("Currently disable this aggregation"),
)),
("hard_states",
Checkbox(
title=_("Use Hard States"),
label=_("Base state computation on hard states"),
help=
_("Hard states can only differ from soft states if at least one host or service "
"of the BI aggregate has more than 1 maximum check attempt. For example if you "
"set the maximum check attempts of a service to 3 and the service is CRIT "
"just since one check then it's soft state is CRIT, but its hard state is still OK. "
"<b>Note:</b> When computing the availbility of a BI aggregate this option "
"has no impact. For that purpose always the soft (i.e. real) states will be used."
),
title=_("Aggregation Groups")),
back=transform_aggregation_groups_to_disk,
forth=transform_aggregation_groups_to_gui,
)),
("node",
CascadingDropdown(
title=_("Rule to call"),
choices=self._node_call_choices() + self._foreach_choices(
self._node_call_choices()))),
("disabled",
Checkbox(
title=_("Disabled"),
label=_("Currently disable this aggregation"),
)),
("hard_states",
Checkbox(
title=_("Use Hard States"),
label=_("Base state computation on hard states"),
help=
_("Hard states can only differ from soft states if at least one host or service "
"of the BI aggregate has more than 1 maximum check attempt. For example if you "
"set the maximum check attempts of a service to 3 and the service is CRIT "
"just since one check then it's soft state is CRIT, but its hard state is still OK. "
"<b>Note:</b> When computing the availbility of a BI aggregate this option "
"has no impact. For that purpose always the soft (i.e. real) states will be used."
),
)),
("downtime_aggr_warn",
Checkbox(
title=_("Aggregation of Downtimes"),
label=_("Escalate downtimes based on aggregated WARN state"),
help=
_("When computing the state 'in scheduled downtime' for an aggregate "
"first all leaf nodes that are within downtime are assumed CRIT and all others "
"OK. Then each aggregated node is assumed to be in downtime if the state "
"is CRIT under this assumption. You can change this to WARN. The influence of "
"this setting is especially relevant if you use aggregation functions of type <i>count</i> "
"and want the downtime information also escalated in case such a node would go into "
"WARN state."),
)),
(
"single_host",
)),
("downtime_aggr_warn",
Checkbox(
title=_("Optimization"),
label=_("The aggregation covers data from only one host and its parents."),
help=_(
"If you have a large number of aggregations that cover only one host and "
"maybe its parents (such as Check_MK cluster hosts), "
"then please enable this optimization. It reduces the time for the "
"computation. Do <b>not</b> enable this for aggregations that contain "
"data of more than one host!"),
),
),
("use_layout_id",
DropdownChoice(
title=_("Use visualization layout"),
choices=visualization_choices,
default_value=None))])
title=_("Aggregation of Downtimes"),
label=_("Escalate downtimes based on aggregated WARN state"),
help=
_("When computing the state 'in scheduled downtime' for an aggregate "
"first all leaf nodes that are within downtime are assumed CRIT and all others "
"OK. Then each aggregated node is assumed to be in downtime if the state "
"is CRIT under this assumption. You can change this to WARN. The influence of "
"this setting is especially relevant if you use aggregation functions of type <i>count</i> "
"and want the downtime information also escalated in case such a node would go into "
"WARN state."),
)),
(
"single_host",
Checkbox(
title=_("Optimization"),
label=_("The aggregation covers data from only one host and its parents."),
help=_(
"If you have a large number of aggregations that cover only one host and "
"maybe its parents (such as Check_MK cluster hosts), "
"then please enable this optimization. It reduces the time for the "
"computation. Do <b>not</b> enable this for aggregations that contain "
"data of more than one host!"),
),
),
("use_layout_id",
DropdownChoice(
title=_("Use visualization layout"),
choices=visualization_choices,
default_value=None))
])

# .--------------------------------------------------------------------.
# | Methods for analysing the rules and aggregations |

0 comments on commit fe17367

Please sign in to comment.
You can’t perform that action at this time.