Module: check_mk
Branch: master
Commit: 1016afdc1fe6a72cebd91f533729c25d50d48ece
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1016afdc1fe6a7…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Mon Apr 1 11:59:11 2019 +0200
7416 k8s_resources: now uses default levels of 90% and 95?%
Change-Id: I76627a65d1ba47888ee2de145d91834b31efce48
---
.werks/7416 | 9 +++++++++
checkman/k8s_resources.cpu | 4 ++--
checkman/k8s_resources.memory | 4 ++--
checkman/k8s_resources.pods | 4 ++--
checks/k8s_resources | 9 +++++++++
5 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/.werks/7416 b/.werks/7416
new file mode 100644
index 0000000..f694180
--- /dev/null
+++ b/.werks/7416
@@ -0,0 +1,9 @@
+Title: k8s_resources: now uses default levels of 90% and 95?%
+Level: 1
+Component: checks
+Compatible: incomp
+Edition: cre
+Version: 1.6.0i1
+Date: 1556108625
+Class: feature
+
diff --git a/checkman/k8s_resources.cpu b/checkman/k8s_resources.cpu
index 7f3940d..0fb5eb1 100644
--- a/checkman/k8s_resources.cpu
+++ b/checkman/k8s_resources.cpu
@@ -8,8 +8,8 @@ description:
a Kubernetes entity. If at least one container running on a node does not specify
limits, the node has no applicable limits.
- By default the check always returns {OK}. Optionally levels can be defined
- for the CPU usage, i.e. the ratio between requested and allocatable CPU.
+ The check returns {OK} if the used CPU is below 90%. Below 95% {WARN}
+ is returned and otherwise {CRIT}. Custom levels can be defined in WATO.
inventory:
One service is created.
diff --git a/checkman/k8s_resources.memory b/checkman/k8s_resources.memory
index 62bb2b9..a44f4c9 100644
--- a/checkman/k8s_resources.memory
+++ b/checkman/k8s_resources.memory
@@ -8,8 +8,8 @@ description:
of a Kubernetes entity. If at least one container running on a node does not specify
limits, the node has no applicable limits.
- By default the check always returns {OK}. Optionally levels can be defined
- for the Memory usage, i.e. the ratio between requested and allocatable Memory.
+ The check returns {OK} if the used Memroy is below 90%. Below 95% {WARN}
+ is returned and otherwise {CRIT}. Custom levels can be defined in WATO.
inventory:
One service is created.
diff --git a/checkman/k8s_resources.pods b/checkman/k8s_resources.pods
index e2028e4..24eb474 100644
--- a/checkman/k8s_resources.pods
+++ b/checkman/k8s_resources.pods
@@ -6,8 +6,8 @@ distribution: check_mk
description:
This check monitors the pods of Kubernetes nodes and clusters.
- By default the check always returns {OK}. Optionally levels can be defined
- for the Pod usage, i.e. the ratio between used and allocatable Pods.
+ The check returns {OK} if the used Pods are below 90%. Below 95% {WARN}
+ is returned and otherwise {CRIT}. Custom levels can be defined in WATO.
inventory:
One service is created.
diff --git a/checks/k8s_resources b/checks/k8s_resources
index 45b6161..08246f7 100644
--- a/checks/k8s_resources
+++ b/checks/k8s_resources
@@ -24,6 +24,12 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+factory_settings['k8s_resources_default_levels'] = {
+ 'cpu': (90.0, 95.0),
+ 'memory': (90.0, 95.0),
+ 'pods': (90.0, 95.0),
+}
+
def get_k8s_resources_inventory_function(name):
def inventory_function(parsed):
@@ -77,6 +83,7 @@ check_info['k8s_resources.pods'] = {
'service_description': 'Pod resources',
'has_perfdata': True,
'group': 'k8s_resources',
+ 'default_levels_variable': 'k8s_resources_default_levels',
}
check_info['k8s_resources.cpu'] = {
@@ -85,6 +92,7 @@ check_info['k8s_resources.cpu'] = {
'service_description': 'CPU resources',
'has_perfdata': True,
'group': 'k8s_resources',
+ 'default_levels_variable': 'k8s_resources_default_levels',
}
check_info['k8s_resources.memory'] = {
@@ -93,4 +101,5 @@ check_info['k8s_resources.memory'] = {
'service_description': 'Memory resources',
'has_perfdata': True,
'group': 'k8s_resources',
+ 'default_levels_variable': 'k8s_resources_default_levels',
}