Module: check_mk
Branch: master
Commit: da4e9810dfe573e7089d494e4ebd928cb614347f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=da4e9810dfe573…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Tue Nov 27 12:07:06 2018 +0100
Adjust number of allowed Azure API requests
Change-Id: Idc0296735f0f18f9b3e12c677996e6df3efc44a1
---
checkman/azure_agent_info | 2 +-
cmk/gui/plugins/wato/datasource_programs.py | 53 ++++++++++++++++-------------
2 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/checkman/azure_agent_info b/checkman/azure_agent_info
index 42d0830..27a1cdc 100644
--- a/checkman/azure_agent_info
+++ b/checkman/azure_agent_info
@@ -5,7 +5,7 @@ license: GPL
distribution: check_mk
description:
This check reports the general state of the azure special agent.
- It reports the remaining API calls (which are limited to 15.000 per hour),
+ It reports the remaining API calls (which are limited by Microsoft),
the monitored groups and encountered issues.
item:
diff --git a/cmk/gui/plugins/wato/datasource_programs.py b/cmk/gui/plugins/wato/datasource_programs.py
index c2ec3b4..5a0f7fe 100644
--- a/cmk/gui/plugins/wato/datasource_programs.py
+++ b/cmk/gui/plugins/wato/datasource_programs.py
@@ -1295,30 +1295,35 @@ register_rule(
title=_("Secret"),
allow_empty=False,
)),
- ("config",
- Dictionary(
- title=_("Monitoring Settings"),
- help=_("You can choose to to monitor all resources known to "
- "the Azure API. However, be aware that Microsoft limits"
- " API calls to 15,000 per hour (250 per minute)."),
- elements=[
- ('explicit-config',
- ListOf(
- _azure_group_config(),
- title=_("Explicitly specify groups"),
- allow_empty=False,
- magic="@-groups-@",
- )),
- ('fetchall',
- FixedValue(
- "fetchall",
- title=_(
- "Monitor all available resource groups (overrides previous settings)"
- ),
- totext="",
- )),
- ],
- )),
+ (
+ "config",
+ Dictionary(
+ title=_("Monitoring Settings"),
+ # Since we introduced this, Microsoft has already reduced the number
+ # of allowed API requests. At the time of this writing (11/2018)
+ # you can find the number here:
+ # https://docs.microsoft.com/de-de/azure/azure-resource-manager/resource-mana…
+ help=_("You can choose to to monitor all resources known to "
+ "the Azure API. However, be aware that Microsoft limits"
+ " API calls to %s per hour (%s per minute).") % ("12000", "200"),
+ elements=[
+ ('explicit-config',
+ ListOf(
+ _azure_group_config(),
+ title=_("Explicitly specify groups"),
+ allow_empty=False,
+ magic="@-groups-@",
+ )),
+ ('fetchall',
+ FixedValue(
+ "fetchall",
+ title=
+ _("Monitor all available resource groups (overrides previous settings)"
+ ),
+ totext="",
+ )),
+ ],
+ )),
("--piggyback-vms",
DropdownChoice(
title=_("Create piggyback VM data"),
Module: check_mk
Branch: master
Commit: e12187e9a3af7cb0c3d36450713955322ce90400
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e12187e9a3af7c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 27 16:27:32 2018 +0100
6914 FIX LDAP: Fixed wrong diagnose results when using fallback server option
The LDAP connection diagnose was showing wrong results for fallback servers
when a connetion to the server could not be established in the first step.
The diagnose was reusing the established connection to previous servers.
Change-Id: Iba9e127d29d51579c6c093cefc0eec0c8856cdc7
---
.werks/6914 | 14 ++++++++++++++
cmk/gui/plugins/userdb/ldap_connector.py | 2 ++
2 files changed, 16 insertions(+)
diff --git a/.werks/6914 b/.werks/6914
new file mode 100644
index 0000000..88ee6a0
--- /dev/null
+++ b/.werks/6914
@@ -0,0 +1,14 @@
+Title: LDAP: Fixed wrong diagnose results when using fallback server option
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1543237371
+
+The LDAP connection diagnose was showing wrong results for fallback servers
+when a connetion to the server could not be established in the first step.
+
+The diagnose was reusing the established connection to previous servers.
diff --git a/cmk/gui/plugins/userdb/ldap_connector.py b/cmk/gui/plugins/userdb/ldap_connector.py
index 888b8bb..eac85c7 100644
--- a/cmk/gui/plugins/userdb/ldap_connector.py
+++ b/cmk/gui/plugins/userdb/ldap_connector.py
@@ -306,6 +306,7 @@ class LDAPUserConnector(UserConnector):
return # Use existing connections (if connection settings have not changed)
else:
self._logger.info('LDAP CONNECT - Connecting...')
+ self.disconnect()
# Some major config var validations
@@ -347,6 +348,7 @@ class LDAPUserConnector(UserConnector):
def disconnect(self):
self._ldap_obj = None
+ self._ldap_obj_config = None
def _discover_nearest_dc(self, domain):
cached_server = self._get_nearest_dc_from_cache()
Module: check_mk
Branch: master
Commit: f08722ff76c02f0f32266357369371583f28ffff
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f08722ff76c02f…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Sat Nov 24 13:32:31 2018 +0100
k8s_resources: now returns n.a. limits
If at least one container on a node does not specify CPU or memory
limits the check now returns "Limit: unbound" since the container
may consume any amound of resources on that node.
CMK-511
Change-Id: I15db41ea125fa5ea6a723e7afbf2a30e21e06aad
---
agents/special/agent_kubernetes | 13 +++++++++++--
checkman/k8s_resources.cpu | 7 +++++--
checkman/k8s_resources.memory | 7 +++++--
checks/k8s_resources | 8 ++++++--
.../generictests/datasets/k8s_resources_regression.py | 3 ++-
5 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/agents/special/agent_kubernetes b/agents/special/agent_kubernetes
index 79c3da6..5936d3a 100755
--- a/agents/special/agent_kubernetes
+++ b/agents/special/agent_kubernetes
@@ -221,6 +221,11 @@ class Pods(object):
return view
def resources_per_node(self):
+ """
+ Returns the limits and requests of all containers grouped by node. If at least
+ one container does not specify a limit, infinity is returned as the container
+ may consume any amount of resources.
+ """
# TODO: add annotation from below and fix parse_cpu and parse_memory
view = {} # type: Dict[str, Dict[str, Dict[str, Optional[float]]]]
for pod in self.items:
@@ -241,9 +246,13 @@ class Pods(object):
if resources:
limits = resources.limits
if limits:
- node_data['limits']['cpu'] += parse_cpu(limits.get('cpu', '0.0'))
+ node_data['limits']['cpu'] += parse_cpu(limits.get('cpu', 'inf'))
node_data['limits']['memory'] += parse_memory(
- limits.get('memory', '0.0'))
+ limits.get('memory', 'inf'))
+ else:
+ node_data['limits']['cpu'] += float('inf')
+ node_data['limits']['memory'] += float('inf')
+
requests = resources.requests
if requests:
node_data['requests']['cpu'] += parse_cpu(requests.get('cpu', '0.0'))
diff --git a/checkman/k8s_resources.cpu b/checkman/k8s_resources.cpu
index a1b14a0..5442cce 100644
--- a/checkman/k8s_resources.cpu
+++ b/checkman/k8s_resources.cpu
@@ -4,8 +4,11 @@ catalog: app/kubernetes
license: GPL
distribution: check_mk
description:
- This check monitors the CPU resources of a Kubernetes node.
- It always returns {OK}.
+ This check monitors the requested CPU as well as the CPU limits and capacity of
+ a Kubernetes node. If at least one container running on a node does not specify
+ limits, the node has no applicable limits.
+
+ The check always returns {OK}.
inventory:
One service is created.
\ No newline at end of file
diff --git a/checkman/k8s_resources.memory b/checkman/k8s_resources.memory
index 2549d74..3da7fea 100644
--- a/checkman/k8s_resources.memory
+++ b/checkman/k8s_resources.memory
@@ -4,8 +4,11 @@ catalog: app/kubernetes
license: GPL
distribution: check_mk
description:
- This check monitors the memory resources of a Kubernetes node.
- It always returns {OK}.
+ This check monitors the requested memory as well as the memory limits and capacity
+ of a Kubernetes node. If at least one container running on a node does not specify
+ limits, the node has no applicable limits.
+
+ The check always returns {OK}.
inventory:
One service is created.
\ No newline at end of file
diff --git a/checks/k8s_resources b/checks/k8s_resources
index 826e24e..7913b38 100644
--- a/checks/k8s_resources
+++ b/checks/k8s_resources
@@ -65,7 +65,9 @@ def check_k8s_cpu_resources(_no_item, _no_params, parsed):
yield 0, 'Request: %.3f' % request
limit = parsed.get('limits', {}).get('cpu')
- if limit:
+ if math.isinf(limit):
+ yield 0, 'Limit: n.a.'
+ else:
yield 0, 'Limit: %.3f' % limit
capacity = parsed.get('capacity', {}).get('cpu', 0.0)
@@ -89,7 +91,9 @@ def check_k8s_mem_resources(_no_item, _no_params, parsed):
yield 0, 'Request: %s' % get_bytes_human_readable(request)
limit = parsed.get('limits', {}).get('memory')
- if limit:
+ if math.isinf(limit):
+ yield 0, 'Limit: n.a.'
+ else:
yield 0, 'Limit: %s' % get_bytes_human_readable(limit)
capacity = parsed.get('capacity', {}).get('memory', 0.0)
diff --git a/tests/unit/checks/generictests/datasets/k8s_resources_regression.py b/tests/unit/checks/generictests/datasets/k8s_resources_regression.py
index be6f4e6..dc1e039 100644
--- a/tests/unit/checks/generictests/datasets/k8s_resources_regression.py
+++ b/tests/unit/checks/generictests/datasets/k8s_resources_regression.py
@@ -1,7 +1,7 @@
checkname = 'k8s_resources'
info = [[
- u'{"capacity": {"pods": 110, "cpu": 1.0, "memory": 609845248.0}, "requests": {"cpu": 0.2, "memory": 0.0}, "limits": {"cpu": 0.5, "memory": 0.0}, "allocations": {}}'
+ u'{"capacity": {"pods": 110, "cpu": 1.0, "memory": 609845248.0}, "requests": {"cpu": 0.2, "memory": 0.0}, "limits": {"cpu": 0.5, "memory": Infinity}, "allocations": {}}'
]]
discovery = {
@@ -18,6 +18,7 @@ checks = {
])],
'memory': [(None, 'default', [
(0, 'Request: 0.00 B', []),
+ (0, 'Limit: n.a.', []),
(0, 'Capacity: 581.59 MB', []),
])],
'pods': [(None, 'default', [