Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgenii Gordymov <evgenii.gordymov@zabbix.com>2022-11-09 11:03:13 +0300
committerEvgenii Gordymov <evgenii.gordymov@zabbix.com>2022-11-09 11:03:13 +0300
commit8c39dc84f840d3ce17d7fa4517eb36622a6a5d3e (patch)
tree67c406eff5f0590cef9492e9c9a1802a6935642c
parentdea20639a8b3f51b17a219213dbb47a0ac178ecb (diff)
parentf66bb5468894a77b4f2c73aa8f156456506a17af (diff)
.........T [ZBX-20478] fixed script k8s cluster state
* commit 'f66bb5468894a77b4f2c73aa8f156456506a17af': .........T [ZBX-20478] fixed script k8s cluster state
-rw-r--r--ChangeLog.d/feature/ZBX-204781
-rw-r--r--templates/app/kubernetes_http/kubernetes_kubelet_http/README.md12
-rw-r--r--templates/app/kubernetes_http/kubernetes_kubelet_http/template_kubernetes_kubelet.yaml10
-rw-r--r--templates/app/kubernetes_http/kubernetes_state_http/README.md4
-rw-r--r--templates/app/kubernetes_http/kubernetes_state_http/template_kubernetes_state.yaml20
5 files changed, 26 insertions, 21 deletions
diff --git a/ChangeLog.d/feature/ZBX-20478 b/ChangeLog.d/feature/ZBX-20478
new file mode 100644
index 00000000000..eb007242743
--- /dev/null
+++ b/ChangeLog.d/feature/ZBX-20478
@@ -0,0 +1 @@
+.........T [ZBX-20478] fixed script k8s cluster state (egordymov)
diff --git a/templates/app/kubernetes_http/kubernetes_kubelet_http/README.md b/templates/app/kubernetes_http/kubernetes_kubelet_http/README.md
index fe39f4f53bb..198adc7d911 100644
--- a/templates/app/kubernetes_http/kubernetes_kubelet_http/README.md
+++ b/templates/app/kubernetes_http/kubernetes_kubelet_http/README.md
@@ -3,7 +3,7 @@
## Overview
-For Zabbix version: 6.2 and higher
+For Zabbix version: 6.4 and higher.
The template to monitor Kubernetes Controller manager by Zabbix that works without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
@@ -20,7 +20,7 @@ This template was tested on:
## Setup
-> See [Zabbix template operation](https://www.zabbix.com/documentation/6.2/manual/config/templates_out_of_the_box/http) for basic instructions.
+> See [Zabbix template operation](https://www.zabbix.com/documentation/6.4/manual/config/templates_out_of_the_box/http) for basic instructions.
Internal service metrics are collected from /metrics endpoint.
Template needs to use Authorization via API token.
@@ -54,7 +54,7 @@ There are no template links in this template.
|Container memory discovery | |DEPENDENT |kube.kubelet.container.memory.cache.discovery<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON<p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
|Pods discovery | |DEPENDENT |kube.kubelet.pods.discovery<p>**Preprocessing**:</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
|REST client requests discovery | |DEPENDENT |kube.kubelet.rest.requests.discovery<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON<p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Runtime operations discovery | |DEPENDENT |kube.kubelet.runtime_operations_bucket.discovery<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~ "kubelet_runtime_operations_*", operation_type =~ ".*"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p><p>**Overrides:**</p><p>bucket item<br> - {#TYPE} MATCHES_REGEX `buckets`<br> - ITEM_PROTOTYPE LIKE `bucket` - DISCOVER</p><p>total item<br> - {#TYPE} MATCHES_REGEX `totals`<br> - ITEM_PROTOTYPE NOT_LIKE `bucket` - DISCOVER</p> |
+|Runtime operations discovery | |DEPENDENT |kube.kubelet.runtime_operations_bucket.discovery<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~ "kubelet_runtime_operations_*", operation_type =~ ".*"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p><p>**Overrides:**</p><p>bucket item<br> - {#TYPE} MATCHES_REGEX `buckets`<br> - ITEM_PROTOTYPE LIKE `bucket`<br> - DISCOVER</p><p>total item<br> - {#TYPE} MATCHES_REGEX `totals`<br> - ITEM_PROTOTYPE NOT_LIKE `bucket`<br> - DISCOVER</p> |
## Items collected
@@ -81,7 +81,7 @@ There are no template links in this template.
|Kubernetes |Kubernetes: Namespace [{#NAMESPACE}] Pod [{#NAME}] CPU: Load average, 10s |<p>Pods cpu load average over the last 10 seconds.</p> |DEPENDENT |kube.pod.container_cpu_load_average_10s[{#NAMESPACE}/{#NAME}]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `container_cpu_load_average_10s{pod="{#NAME}", namespace="{#NAMESPACE}"}`: `function`: `sum`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p> |
|Kubernetes |Kubernetes: Namespace [{#NAMESPACE}] Pod [{#NAME}] CPU: System seconds, total |<p>The number of cores used for system time.</p> |DEPENDENT |kube.pod.container_cpu_system_seconds_total[{#NAMESPACE}/{#NAME}]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `container_cpu_system_seconds_total{pod="{#NAME}", namespace="{#NAMESPACE}"}`: `function`: `sum`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p> |
|Kubernetes |Kubernetes: Namespace [{#NAMESPACE}] Pod [{#NAME}] CPU: User seconds, total |<p>The number of cores used for user time.</p> |DEPENDENT |kube.pod.container_cpu_user_seconds_total[{#NAMESPACE}/{#NAME}]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `container_cpu_user_seconds_total{pod="{#NAME}", namespace="{#NAMESPACE}"}`: `function`: `sum`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p> |
-|Kubernetes |Kubernetes: Namespace [{#NAMESPACE}] Pod [{#NAME}] CPU: Load average, 10s |<p>Number of HTTP requests, partitioned by status code, method, and host.</p> |DEPENDENT |kube.kubelet.rest.requests["{#CODE}", "{#HOST}", "{#METHOD}"]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `rest_client_requests_total{code="{#CODE}", host="{#HOST}", method="{#METHOD}"}`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Kubernetes: Host [{#HOST}] Request method [{#METHOD}] Code:[{#CODE}] |<p>Number of HTTP requests, partitioned by status code, method, and host.</p> |DEPENDENT |kube.kubelet.rest.requests["{#CODE}", "{#HOST}", "{#METHOD}"]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `rest_client_requests_total{code="{#CODE}", host="{#HOST}", method="{#METHOD}"}`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
|Kubernetes |Kubernetes: Namespace [{#NAMESPACE}] Pod [{#POD}] Container [{#CONTAINER}]: Memory page cache |<p>Number of bytes of page cache memory.</p> |DEPENDENT |kube.kubelet.container.memory.cache["{#CONTAINER}", "{#NAMESPACE}", "{#POD}"]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `container_memory_cache{container="{#CONTAINER}", namespace="{#NAMESPACE}", pod="{#POD}"}`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
|Kubernetes |Kubernetes: Namespace [{#NAMESPACE}] Pod [{#POD}] Container [{#CONTAINER}]: Memory max usage |<p>Maximum memory usage recorded in bytes.</p> |DEPENDENT |kube.kubelet.container.memory.max_usage["{#CONTAINER}", "{#NAMESPACE}", "{#POD}"]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `container_memory_max_usage_bytes{container="{#CONTAINER}", namespace="{#NAMESPACE}", pod="{#POD}"}`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
|Kubernetes |Kubernetes: Namespace [{#NAMESPACE}] Pod [{#POD}] Container [{#CONTAINER}]: RSS |<p>Size of RSS in bytes.</p> |DEPENDENT |kube.kubelet.container.memory.rss["{#CONTAINER}", "{#NAMESPACE}", "{#POD}"]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `container_memory_rss{container="{#CONTAINER}", namespace="{#NAMESPACE}", pod="{#POD}"}`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
@@ -96,7 +96,7 @@ There are no template links in this template.
## Feedback
-Please report any issues with the template at https://support.zabbix.com
+Please report any issues with the template at https://support.zabbix.com.
-You can also provide feedback, discuss the template or ask for help with it at [ZABBIX forums](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback).
+You can also provide feedback, discuss the template, or ask for help at [ZABBIX forums](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback).
diff --git a/templates/app/kubernetes_http/kubernetes_kubelet_http/template_kubernetes_kubelet.yaml b/templates/app/kubernetes_http/kubernetes_kubelet_http/template_kubernetes_kubelet.yaml
index 71308f66177..935b56ab4bc 100644
--- a/templates/app/kubernetes_http/kubernetes_kubelet_http/template_kubernetes_kubelet.yaml
+++ b/templates/app/kubernetes_http/kubernetes_kubelet_http/template_kubernetes_kubelet.yaml
@@ -1,6 +1,6 @@
zabbix_export:
- version: '6.2'
- date: '2022-06-07T19:33:38Z'
+ version: '6.4'
+ date: '2022-10-21T14:38:22Z'
template_groups:
-
uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
@@ -18,7 +18,7 @@ zabbix_export:
You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
- Template tooling version used: 0.41
+ Template tooling version used: 0.42
groups:
-
name: Templates/Applications
@@ -649,7 +649,7 @@ zabbix_export:
item_prototypes:
-
uuid: c569ce73bfb44098be3ceb8d016e3d24
- name: 'Kubernetes: Namespace [{#NAMESPACE}] Pod [{#NAME}] CPU: Load average, 10s'
+ name: 'Kubernetes: Host [{#HOST}] Request method [{#METHOD}] Code:[{#CODE}]'
type: DEPENDENT
key: 'kube.kubelet.rest.requests["{#CODE}", "{#HOST}", "{#METHOD}"]'
delay: '0'
@@ -923,7 +923,6 @@ zabbix_export:
operationobject: ITEM_PROTOTYPE
operator: LIKE
value: bucket
- status: ENABLED
discover: DISCOVER
-
name: 'total item'
@@ -939,7 +938,6 @@ zabbix_export:
operationobject: ITEM_PROTOTYPE
operator: NOT_LIKE
value: bucket
- status: ENABLED
discover: DISCOVER
tags:
-
diff --git a/templates/app/kubernetes_http/kubernetes_state_http/README.md b/templates/app/kubernetes_http/kubernetes_state_http/README.md
index 1066876a235..8da0f121d8a 100644
--- a/templates/app/kubernetes_http/kubernetes_state_http/README.md
+++ b/templates/app/kubernetes_http/kubernetes_state_http/README.md
@@ -227,7 +227,7 @@ There are no template links in this template.
## Feedback
-Please report any issues with the template at https://support.zabbix.com
+Please report any issues with the template at https://support.zabbix.com.
-You can also provide feedback, discuss the template or ask for help at [ZABBIX forums](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback).
+You can also provide feedback, discuss the template, or ask for help at [ZABBIX forums](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback).
diff --git a/templates/app/kubernetes_http/kubernetes_state_http/template_kubernetes_state.yaml b/templates/app/kubernetes_http/kubernetes_state_http/template_kubernetes_state.yaml
index dfdc2745a3e..556c14fc855 100644
--- a/templates/app/kubernetes_http/kubernetes_state_http/template_kubernetes_state.yaml
+++ b/templates/app/kubernetes_http/kubernetes_state_http/template_kubernetes_state.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.4'
- date: '2022-10-18T08:41:16Z'
+ date: '2022-10-21T14:35:40Z'
template_groups:
-
uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
@@ -636,13 +636,19 @@ zabbix_export:
result.response.items.forEach(function (ep) {
if (ep.metadata.name === Kube.params.state_endpoint_name && Array.isArray(ep.subsets)) {
if (typeof ep.subsets[0].addresses !== 'undefined') {
- var subset = ep.subsets[0];
-
- endpoint = {
- address: subset.addresses[0].ip,
- port: port = subset.ports.filter(function (port) {
+ var port, addr
+ ep.subsets.forEach(function(subset){
+ var lp = subset.ports.filter(function (port) {
return port.name === 'http';
- })[0].port || 8080
+ })
+ if (lp.length) {
+ port = lp[0].port
+ addr = subset.addresses[0].ip
+ }
+ })
+ endpoint = {
+ address: addr || ep.subsets[0].addresses[0].ip,
+ port: port || 8080
}
}
}