Module: check_mk
Branch: master
Commit: 9f7b853b6795fd8a9576438cb949777bb34c8eec
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9f7b853b6795fd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 13 20:33:56 2019 +0100
Cleanup group config loading in view editor
Use currently configured contact groups from livestatus instead the WATO
exclusive group loading logic.
Change-Id: I3f58a44b736cecbbb0cb16903fb0f8baaf1e11f4
---
cmk/gui/visuals.py | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/cmk/gui/visuals.py b/cmk/gui/visuals.py
index f1aacc3..45647e5 100644
--- a/cmk/gui/visuals.py
+++ b/cmk/gui/visuals.py
@@ -47,9 +47,11 @@ from cmk.gui.valuespec import (
TextUnicode,
TextAscii,
TextAreaUnicode,
+ DualListChoice,
)
import cmk.gui.config as config
import cmk.gui.forms as forms
+import cmk.gui.sites as sites
from cmk.gui.table import table_element
import cmk.gui.userdb as userdb
import cmk.gui.pagetypes as pagetypes
@@ -993,8 +995,7 @@ class PublishTo(CascadingDropdown):
choices=[
(True, _("Publish to all users")),
("contact_groups", _("Publish to members of contact groups"),
- userdb.GroupChoice(
- "contact",
+ ContactGroupChoice(
with_foreign_groups=with_foreign_groups,
title=_("Publish to members of contact groups"),
rows=5,
@@ -1005,6 +1006,20 @@ class PublishTo(CascadingDropdown):
**kwargs)
+class ContactGroupChoice(DualListChoice):
+ """A multiple selection of contact groups that are part of the current active config"""
+
+ def __init__(self, with_foreign_groups=True, **kwargs):
+ super(ContactGroupChoice, self).__init__(choices=self._load_groups, **kwargs)
+ self._with_foreign_groups = with_foreign_groups
+
+ def _load_groups(self):
+ contact_group_choices = sites.all_groups("contact")
+ return [(group_id, alias)
+ for (group_id, alias) in contact_group_choices
+ if self._with_foreign_groups or group_id in config.user.contact_groups()]
+
+
#.
# .--Filters-------------------------------------------------------------.
# | _____ _ _ _ |
Module: check_mk
Branch: master
Commit: 2ee25c5d9f994bb1232ffe7953696d9034e84a46
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2ee25c5d9f994b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Feb 14 08:57:36 2019 +0100
Add some help texts about needed permission
Change-Id: I5a1f47801d50c80a86d3189095011b4fec593647
---
cmk/gui/plugins/wato/active_checks.py | 4 +++-
cmk/gui/plugins/wato/check_mk_configuration.py | 4 +++-
cmk/gui/plugins/wato/datasource_programs.py | 4 +++-
cmk/gui/wato/pages/host_diagnose.py | 3 ++-
4 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/cmk/gui/plugins/wato/active_checks.py b/cmk/gui/plugins/wato/active_checks.py
index 42943d1..6cc087c 100644
--- a/cmk/gui/plugins/wato/active_checks.py
+++ b/cmk/gui/plugins/wato/active_checks.py
@@ -1691,7 +1691,9 @@ class RulespecCustomChecks(HostRulespec):
"to be executed directly on your monitoring server. These checks "
"will not use Check_MK. It is also possible to configure passive "
"checks that are fed with data from external sources via the "
- "command pipe of the monitoring core."),
+ "command pipe of the monitoring core.") +
+ _("This option can only be used with the permission \"Can add or modify executables\"."
+ ),
elements=[
("service_description",
TextUnicode(
diff --git a/cmk/gui/plugins/wato/check_mk_configuration.py b/cmk/gui/plugins/wato/check_mk_configuration.py
index 1df3723..84071ba 100644
--- a/cmk/gui/plugins/wato/check_mk_configuration.py
+++ b/cmk/gui/plugins/wato/check_mk_configuration.py
@@ -2972,7 +2972,9 @@ class RulespecHostCheckCommands(HostRulespec):
help=_(
"Usually Check_MK uses a series of PING (ICMP echo request) in order to determine "
"whether a host is up. In some cases this is not possible, however. With this rule "
- "you can specify an alternative way of determining the host's state."),
+ "you can specify an alternative way of determining the host's state.") + _(
+ "The option to use a custom command can only be configured with the permission "
+ "\"Can add or modify executables\"."),
choices=self._host_check_command_choices,
default_value="ping",
orientation="horizontal",
diff --git a/cmk/gui/plugins/wato/datasource_programs.py b/cmk/gui/plugins/wato/datasource_programs.py
index ddd5d44..881dc49 100644
--- a/cmk/gui/plugins/wato/datasource_programs.py
+++ b/cmk/gui/plugins/wato/datasource_programs.py
@@ -94,7 +94,9 @@ class RulespecDatasourcePrograms(HostRulespec):
"program that should be called by Check_MK instead of connecting the agent "
"via TCP. That program must output the agent's data on standard output in "
"the same format the agent would do. This is for example useful for monitoring "
- "via SSH.") + monitoring_macro_help(),
+ "via SSH.") + monitoring_macro_help() +
+ _("This option can only be used with the permission \"Can add or modify executables\"."
+ ),
label=_("Command line to execute"),
empty_text=_("Access Check_MK Agent via TCP"),
size=80,
diff --git a/cmk/gui/wato/pages/host_diagnose.py b/cmk/gui/wato/pages/host_diagnose.py
index e2b9fd1..eb2c5b8 100644
--- a/cmk/gui/wato/pages/host_diagnose.py
+++ b/cmk/gui/wato/pages/host_diagnose.py
@@ -266,7 +266,8 @@ class ModeDiagHost(WatoMode):
"program that should be called by Check_MK instead of connecting the agent "
"via TCP. That program must output the agent's data on standard output in "
"the same format the agent would do. This is for example useful for monitoring "
- "via SSH.") + monitoring_macro_help(),
+ "via SSH.") + monitoring_macro_help() + " "
+ + _("This option can only be used with the permission \"Can add or modify executables\"."),
))
]
else:
Module: check_mk
Branch: master
Commit: eec7b36192cc78fcfe76a8aa1a8016ecd8bbfc5b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eec7b36192cc78…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Wed Feb 13 11:42:39 2019 +0100
mk_docker.py: Update manpages
CMK-1660
Change-Id: Ie27456e429a314d6fb406f228746a4a2941768ea
---
checkman/docker_container_status | 6 ++++--
checkman/docker_container_status.health | 6 ++++--
checkman/docker_node_disk_usage | 6 ++++++
checkman/docker_node_info | 4 +++-
checkman/docker_node_info.containers | 2 ++
5 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/checkman/docker_container_status b/checkman/docker_container_status
index 154ad23..acc70e6 100644
--- a/checkman/docker_container_status
+++ b/checkman/docker_container_status
@@ -7,8 +7,10 @@ description:
Monitors the status of docker containers. A status of "running" is treated as OK,
any other status is treated as CRIT.
- To make this check work the agent plugin
- {{mk_docker_container_piggybacked}} have to be installed.
+ To make this check work the agent plugin {{mk_docker.py}} has to be installed.
+ If you are using agent bakery rules, you must enable "Piggybacked docker containers".
+ If you are configuring the plugin via the configuration file, make sure you do not skip the
+ section "docker_containers_client" (the default setting is fine).
item:
None
diff --git a/checkman/docker_container_status.health b/checkman/docker_container_status.health
index 83d861b..42bd809 100644
--- a/checkman/docker_container_status.health
+++ b/checkman/docker_container_status.health
@@ -8,8 +8,10 @@ description:
the HEALTHCHECK API. A Status of "healthy" is treated as OK,
"starting" as WARN, "unhealthy" as CRIT.
- To make this check work the agent plugin
- {{mk_docker_container_piggybacked}} have to be installed.
+ To make this check work the agent plugin {{mk_docker.py}} has to be installed.
+ If you are using agent bakery rules, you must enable "Piggybacked docker containers".
+ If you are configuring the plugin via the configuration file, make sure you do not skip th
+ section "docker_containers_client" (the default setting is fine).
item:
None
diff --git a/checkman/docker_node_disk_usage b/checkman/docker_node_disk_usage
index fcfe6ad..2d011b8 100644
--- a/checkman/docker_node_disk_usage
+++ b/checkman/docker_node_disk_usage
@@ -7,5 +7,11 @@ description:
This check monitors the total and active number as well as the size and
reclaimable size of containers, images, local volumes, and build cache.
+ To make this check work the agent plugin {{mk_docker.py}} has to be installed.
+ If you are using agent bakery rules, you must enable "Fully monitor the docker node"
+ in the section "Docker node" (which is the default).
+ If you are configuring the plugin via the configuration file, make sure you
+ do not skip the section "docker_node_disk_usage" (again the default setting is fine).
+
inventory:
One service per type (i.e. containers, images, volumen, build cache) is created.
diff --git a/checkman/docker_node_info b/checkman/docker_node_info
index cd1f8c6..11addd1 100644
--- a/checkman/docker_node_info
+++ b/checkman/docker_node_info
@@ -6,7 +6,9 @@ distribution: check_mk
description:
This check monitors the status of the docker application.
If the daemon is running, the check is OK, otherwise it is
- CRIT and displays the error message.
+ CRIT and displays an error message.
+
+ To make this check work the agent plugin {{mk_docker.py}} has to be installed.
inventory:
One service is created.
diff --git a/checkman/docker_node_info.containers b/checkman/docker_node_info.containers
index 67c7dfd..46144de 100644
--- a/checkman/docker_node_info.containers
+++ b/checkman/docker_node_info.containers
@@ -8,5 +8,7 @@ description:
of running, paused, and stopped containers. Absolute levels can be defined
for each of these values.
+ To make this check work the agent plugin {{mk_docker.py}} has to be installed.
+
inventory:
One service is created.