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-10 15:38:18 +0300
committerEvgenii Gordymov <evgenii.gordymov@zabbix.com>2022-11-10 15:38:18 +0300
commit461674a091134b760060484e12c49e5fb7df5879 (patch)
tree15b1f21f83b07216da005295470224feca429895
parented684d7edfb39c06aab528167d9700322c12d47d (diff)
parent34495a3c0dd27ed8dbce87068a258dfb9099da43 (diff)
.........T [ZBX-21588] optimized template k8s nodes by http
* commit '34495a3c0dd27ed8dbce87068a258dfb9099da43': .........T [ZBX-21588] optimized template k8s nodes by http .........T [ZBX-21588] optimized template k8s nodes by http .........T [ZBX-21588] optimized template k8s nodes by http .........T [ZBX-21588] optimized template k8s nodes by http
-rw-r--r--ChangeLog.d/feature/ZBX-215881
-rw-r--r--templates/app/kubernetes_http/kubernetes_nodes_http/README.md81
-rw-r--r--templates/app/kubernetes_http/kubernetes_nodes_http/template_kubernetes_nodes.yaml193
3 files changed, 165 insertions, 110 deletions
diff --git a/ChangeLog.d/feature/ZBX-21588 b/ChangeLog.d/feature/ZBX-21588
new file mode 100644
index 00000000000..f0f2aa394d9
--- /dev/null
+++ b/ChangeLog.d/feature/ZBX-21588
@@ -0,0 +1 @@
+.........T [ZBX-21588] optimized template k8s nodes by http (egordymov)
diff --git a/templates/app/kubernetes_http/kubernetes_nodes_http/README.md b/templates/app/kubernetes_http/kubernetes_nodes_http/README.md
index 76f85c4ef2e..f1f83f25f09 100644
--- a/templates/app/kubernetes_http/kubernetes_nodes_http/README.md
+++ b/templates/app/kubernetes_http/kubernetes_nodes_http/README.md
@@ -3,10 +3,10 @@
## Overview
-For Zabbix version: 6.4 and higher
+For Zabbix version: 6.4 and higher.
The template to monitor Kubernetes nodes that work without any external scripts.
It works without external scripts and uses the script item to make HTTP requests to the Kubernetes API.
-Install the Zabbix Helm Chart (https://git.zabbix.com/projects/ZT/repos/kubernetes-helm/browse?at=refs%2Fheads%2Frelease%2F6.0) in your Kubernetes cluster.
+Install the Zabbix Helm Chart (https://git.zabbix.com/projects/ZT/repos/kubernetes-helm/browse?at=refs%2Fheads%2Fmaster) in your Kubernetes cluster.
Set the `{$KUBE.API.ENDPOINT.URL}` such as `<scheme>://<host>:<port>/api`.
@@ -16,6 +16,7 @@ Get the generated service account token using the command
Then set it to the macro `{$KUBE.API.TOKEN}`.
+Set `{$KUBE.NODES.ENDPOINT.NAME}` with Zabbix agent's endpoint name. See `kubectl -n monitoring get ep`. Default: `zabbix-zabbix-helm-chrt-agent`.
Set up the macros to filter the metrics of discovered nodes
@@ -117,41 +118,43 @@ There are no template links in this template.
|-----|----|-----------|----|---------------------|
|Kubernetes |Kubernetes: Get nodes |<p>Collecting and processing cluster nodes data via Kubernetes API.</p> |SCRIPT |kube.nodes<p>**Expression**:</p>`The text is too long. Please see the template.` |
|Kubernetes |Get nodes check |<p>Data collection check.</p> |DEPENDENT |kube.nodes.check<p>**Preprocessing**:</p><p>- JSONPATH: `$.error`</p><p>⛔️ON_FAIL: `CUSTOM_VALUE -> `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node LLD |<p>Generation of data for node discovery rules.</p> |DEPENDENT |kube.nodes.lld<p>**Preprocessing**:</p><p>- JAVASCRIPT: `function parseFilters(filter) { var pairs = {}; filter.split(/\s*,\s*/).forEach(function (kv) { if (/([\w\.-]+\/[\w\.-]+):\s*.+/.test(kv)) { var pair = kv.split(/\s*:\s*/); pairs[pair[0]] = pair[1]; } }); return pairs; } function filter(name, data, filters) { var filtered = true; if (typeof data === 'object') { Object.keys(filters).some(function (filter) { var exclude = filter.match(/^!(.+)/); if (filter in data || (exclude && exclude[1] in data)) { if ((exclude && new RegExp(filters[filter]).test(data[exclude[1]])) || (!exclude && !(new RegExp(filters[filter]).test(data[filter])))) { Zabbix.log(4, '[ Kubernetes discovery ] Discarded "' + name + '" by filter "' + filter + ': ' + filters[filter] + '"'); filtered = false; return true; } }; }); } return filtered; } try { var input = JSON.parse(value), output = []; api_url = '{$KUBE.API.ENDPOINT.URL}', hostname = api_url.match(/\/\/(.+):/); if (typeof hostname[1] === 'undefined') { Zabbix.log(4, '[ Kubernetes ] Received incorrect Kubernetes API url: ' + api_url + '. Expected format: <scheme>://<host>:<port>'); throw 'Cannot get hostname from Kubernetes API url. Check debug log for more information.'; }; if (typeof input !== 'object' || typeof input.items === 'undefined') { Zabbix.log(4, '[ Kubernetes ] Received incorrect JSON: ' + input); throw 'Incorrect JSON. Check debug log for more information.'; } var filterLabels = parseFilters('{$KUBE.NODE.FILTER.LABELS}'), filterAnnotations = parseFilters('{$KUBE.NODE.FILTER.ANNOTATIONS}'); input.items.forEach(function (node) { if (filter(node.metadata.name, node.metadata.labels, filterLabels) && filter(node.metadata.name, node.metadata.annotations, filterAnnotations)) { Zabbix.log(4, '[ Kubernetes discovery ] Filtered node "' + node.metadata.name + '"'); var internalIPs = node.status.addresses.filter(function (addr) { return addr.type === 'InternalIP'; }); var internalIP = internalIPs.length && internalIPs[0].address; if (internalIP in input.endpointIPs) { output.push({ '{#NAME}': node.metadata.name, '{#IP}': internalIP, '{#ROLES}': node.status.roles, '{#ARCH}': node.metadata.labels['kubernetes.io/arch'] || '', '{#OS}': node.metadata.labels['kubernetes.io/os'] || '', '{#CLUSTER_HOSTNAME}': hostname[1] }); } else { Zabbix.log(4, '[ Kubernetes discovery ] Node "' + node.metadata.name + '" is not included in the list of endpoint IPs'); } } }); return JSON.stringify(output); } catch (error) { error += (String(error).endsWith('.')) ? '' : '.'; Zabbix.log(3, '[ Kubernetes discovery ] ERROR: ' + error); throw 'Discovery error: ' + error; } `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node [{#NAME}] Addresses: External IP |<p>Typically the IP address of the node that is externally routable (available from outside the cluster).</p> |DEPENDENT |kube.node.addresses.external_ip[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.addresses[?(@.type == "ExternalIP")].address.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node [{#NAME}] Addresses: Internal IP |<p>Typically the IP address of the node that is routable only within the cluster.</p> |DEPENDENT |kube.node.addresses.internal_ip[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.addresses[?(@.type == "InternalIP")].address.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node [{#NAME}] Allocatable: CPU |<p>Allocatable CPU.</p><p>'Allocatable' on a Kubernetes node is defined as the amount of compute resources that are available for pods. The scheduler does not over-subscribe 'Allocatable'. 'CPU', 'memory' and 'ephemeral-storage' are supported as of now.</p> |DEPENDENT |kube.node.allocatable.cpu[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.allocatable.cpu.first()`</p> |
-|Kubernetes |Node [{#NAME}] Allocatable: Memory |<p>Allocatable Memory.</p><p>'Allocatable' on a Kubernetes node is defined as the amount of compute resources that are available for pods. The scheduler does not over-subscribe 'Allocatable'. 'CPU', 'memory' and 'ephemeral-storage' are supported as of now.</p> |DEPENDENT |kube.node.allocatable.memory[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.allocatable.memory.first()`</p> |
-|Kubernetes |Node [{#NAME}] Allocatable: Pods |<p>https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/</p> |DEPENDENT |kube.node.allocatable.pods[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.allocatable.pods.first()`</p> |
-|Kubernetes |Node [{#NAME}] Capacity: CPU |<p>CPU resource capacity.</p><p>https://kubernetes.io/docs/concepts/architecture/nodes/#capacity</p> |DEPENDENT |kube.node.capacity.cpu[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.capacity.cpu.first()`</p> |
-|Kubernetes |Node [{#NAME}] Capacity: Memory |<p>Memory resource capacity.</p><p>https://kubernetes.io/docs/concepts/architecture/nodes/#capacity</p> |DEPENDENT |kube.node.capacity.memory[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.capacity.memory.first()`</p> |
-|Kubernetes |Node [{#NAME}] Capacity: Pods |<p>https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/</p> |DEPENDENT |kube.node.capacity.pods[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.capacity.pods.first()`</p> |
-|Kubernetes |Node [{#NAME}] Conditions: Disk pressure |<p>True if pressure exists on the disk size - that is, if the disk capacity is low; otherwise False.</p> |DEPENDENT |kube.node.conditions.diskpressure[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.conditions[?(@.type == "DiskPressure")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
-|Kubernetes |Node [{#NAME}] Conditions: Memory pressure |<p>True if pressure exists on the node memory - that is, if the node memory is low; otherwise False.</p> |DEPENDENT |kube.node.conditions.memorypressure[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.conditions[?(@.type == "MemoryPressure")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
-|Kubernetes |Node [{#NAME}] Conditions: Network unavailable |<p>True if the network for the node is not correctly configured, otherwise False.</p> |DEPENDENT |kube.node.conditions.networkunavailable[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.conditions[?(@.type == "NetworkUnavailable")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
-|Kubernetes |Node [{#NAME}] Conditions: PID pressure |<p>True if pressure exists on the processes - that is, if there are too many processes on the node; otherwise False.</p> |DEPENDENT |kube.node.conditions.pidpressure[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.conditions[?(@.type == "PIDPressure")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
-|Kubernetes |Node [{#NAME}] Conditions: Ready |<p>True if the node is healthy and ready to accept pods, False if the node is not healthy and is not accepting pods, and Unknown if the node controller has not heard from the node in the last node-monitor-grace-period (default is 40 seconds).</p> |DEPENDENT |kube.node.conditions.ready[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.conditions[?(@.type == "Ready")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
-|Kubernetes |Node [{#NAME}] Info: Architecture |<p>Node architecture.</p> |DEPENDENT |kube.node.info.architecture[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.architecture.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node [{#NAME}] Info: Container runtime |<p>Container runtime.</p><p>https://kubernetes.io/docs/setup/production-environment/container-runtimes/</p> |DEPENDENT |kube.node.info.containerruntime[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.containerRuntimeVersion.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node [{#NAME}] Info: Kernel version |<p>Node kernel version.</p> |DEPENDENT |kube.node.info.kernelversion[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.kernelVersion.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node [{#NAME}] Info: Kubelet version |<p>Version of Kubelet.</p> |DEPENDENT |kube.node.info.kubeletversion[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.kubeletVersion.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node [{#NAME}] Info: KubeProxy version |<p>Version of KubeProxy.</p> |DEPENDENT |kube.node.info.kubeproxyversion[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.kubeProxyVersion.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node [{#NAME}] Info: Operating system |<p>Node operating system.</p> |DEPENDENT |kube.node.info.operatingsystem[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.operatingSystem.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node [{#NAME}] Info: OS image |<p>Node OS image.</p> |DEPENDENT |kube.node.info.osversion[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.kernelVersion.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node [{#NAME}] Info: Roles |<p>Node roles.</p> |DEPENDENT |kube.node.info.roles[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.roles.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
-|Kubernetes |Node [{#NAME}] Limits: CPU |<p>Node CPU limits.</p><p>https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/</p> |DEPENDENT |kube.node.limits.cpu[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].pods[*].containers.limits.cpu.sum()`</p> |
-|Kubernetes |Node [{#NAME}] Limits: Memory |<p>Node Memory limits.</p><p>https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/</p> |DEPENDENT |kube.node.limits.memory[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].pods[*].containers.limits.memory.sum()`</p> |
-|Kubernetes |Node [{#NAME}] Requests: CPU |<p>Node CPU requests.</p><p>https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/</p> |DEPENDENT |kube.node.requests.cpu[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].pods[*].containers.requests.cpu.sum()`</p> |
-|Kubernetes |Node [{#NAME}] Requests: Memory |<p>Node Memory requests.</p><p>https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/</p> |DEPENDENT |kube.node.requests.memory[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].pods[*].containers.requests.memory.sum()`</p> |
-|Kubernetes |Node [{#NAME}] Uptime |<p>Node uptime.</p> |DEPENDENT |kube.node.uptime[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].metadata.creationTimestamp.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return Math.floor((Date.now() - new Date(value)) / 1000);`</p> |
-|Kubernetes |Node [{#NAME}] Used: Pods |<p>Current number of pods on the node.</p> |DEPENDENT |kube.node.used.pods[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].status.podsCount.first()`</p> |
-|Kubernetes |Node [{#NODE}] Pod [{#POD}] Conditions: Containers ready |<p>All containers in the Pod are ready.</p><p>https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions</p> |DEPENDENT |kube.pod.conditions.containers_ready[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].conditions[?(@.type == "ContainersReady")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
-|Kubernetes |Node [{#NODE}] Pod [{#POD}] Conditions: Initialized |<p>All init containers have started successfully.</p><p>https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions</p> |DEPENDENT |kube.pod.conditions.initialized[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].conditions[?(@.type == "Initialized")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
-|Kubernetes |Node [{#NODE}] Pod [{#POD}] Conditions: Ready |<p>The Pod is able to serve requests and should be added to the load balancing pools of all matching Services.</p><p>https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions</p> |DEPENDENT |kube.pod.conditions.ready[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].conditions[?(@.type == "Ready")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
-|Kubernetes |Node [{#NODE}] Pod [{#POD}] Conditions: Scheduled |<p>The Pod has been scheduled to a node.</p><p>https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions</p> |DEPENDENT |kube.pod.conditions.scheduled[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].conditions[?(@.type == "PodScheduled")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
-|Kubernetes |Node [{#NODE}] Pod [{#POD}] Containers: Restarts |<p>The number of times the container has been restarted, currently based on the number of dead containers that have not yet been removed. Note that this is calculated from dead containers. But those containers are subject to garbage collection.</p> |DEPENDENT |kube.pod.containers.restartcount[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].containers.restartCount.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p> |
-|Kubernetes |Node [{#NODE}] Pod [{#POD}] Status: Phase |<p>The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle.</p><p>https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase</p> |DEPENDENT |kube.pod.status.phase[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].phase.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['Pending', 'Running', 'Succeeded', 'Failed', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
-|Kubernetes |Node [{#NODE}] Pod [{#POD}] Uptime |<p>Pod uptime.</p> |DEPENDENT |kube.pod.uptime[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].startTime.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return Math.floor((Date.now() - new Date(value)) / 1000);`</p> |
+|Kubernetes |Node LLD |<p>Generation of data for node discovery rules.</p> |DEPENDENT |kube.nodes.lld<p>**Preprocessing**:</p><p>- JAVASCRIPT: `function parseFilters(filter) { var pairs = {}; filter.split(/\s*,\s*/).forEach(function (kv) { if (/([\w\.-]+\/[\w\.-]+):\s*.+/.test(kv)) { var pair = kv.split(/\s*:\s*/); pairs[pair[0]] = pair[1]; } }); return pairs; } function filter(name, data, filters) { var filtered = true; if (typeof data === 'object') { Object.keys(filters).some(function (filter) { var exclude = filter.match(/^!(.+)/); if (filter in data || (exclude && exclude[1] in data)) { if ((exclude && new RegExp(filters[filter]).test(data[exclude[1]])) || (!exclude && !(new RegExp(filters[filter]).test(data[filter])))) { Zabbix.log(4, '[ Kubernetes discovery ] Discarded "' + name + '" by filter "' + filter + ': ' + filters[filter] + '"'); filtered = false; return true; } }; }); } return filtered; } try { var input = JSON.parse(value), output = []; api_url = '{$KUBE.API.ENDPOINT.URL}', hostname = api_url.match(/\/\/(.+):/); if (typeof hostname[1] === 'undefined') { Zabbix.log(4, '[ Kubernetes ] Received incorrect Kubernetes API url: ' + api_url + '. Expected format: <scheme>://<host>:<port>'); throw 'Cannot get hostname from Kubernetes API url. Check debug log for more information.'; }; if (typeof input !== 'object' || typeof input.items === 'undefined') { Zabbix.log(4, '[ Kubernetes ] Received incorrect JSON: ' + value); throw 'Incorrect JSON. Check debug log for more information.'; } var filterLabels = parseFilters('{$KUBE.NODE.FILTER.LABELS}'), filterAnnotations = parseFilters('{$KUBE.NODE.FILTER.ANNOTATIONS}'); input.items.forEach(function (node) { if (filter(node.metadata.name, node.metadata.labels, filterLabels) && filter(node.metadata.name, node.metadata.annotations, filterAnnotations)) { Zabbix.log(4, '[ Kubernetes discovery ] Filtered node "' + node.metadata.name + '"'); var internalIPs = node.status.addresses.filter(function (addr) { return addr.type === 'InternalIP'; }); var internalIP = internalIPs.length && internalIPs[0].address; if (internalIP in input.endpointIPs) { output.push({ '{#NAME}': node.metadata.name, '{#IP}': internalIP, '{#ROLES}': node.status.roles, '{#ARCH}': node.metadata.labels['kubernetes.io/arch'] || '', '{#OS}': node.metadata.labels['kubernetes.io/os'] || '', '{#CLUSTER_HOSTNAME}': hostname[1] }); } else { Zabbix.log(4, '[ Kubernetes discovery ] Node "' + node.metadata.name + '" is not included in the list of endpoint IPs'); } } }); return JSON.stringify(output); } catch (error) { error += (String(error).endsWith('.')) ? '' : '.'; Zabbix.log(3, '[ Kubernetes discovery ] ERROR: ' + error); throw 'Discovery error: ' + error; } `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Node [{#NAME}]: Get data |<p>Collecting and processing cluster by node [{#NAME}] data via Kubernetes API.</p> |DEPENDENT |kube.node.get[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NAME}")].first()`</p> |
+|Kubernetes |Node [{#NAME}] Addresses: External IP |<p>Typically the IP address of the node that is externally routable (available from outside the cluster).</p> |DEPENDENT |kube.node.addresses.external_ip[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.addresses[?(@.type == "ExternalIP")].address.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Node [{#NAME}] Addresses: Internal IP |<p>Typically the IP address of the node that is routable only within the cluster.</p> |DEPENDENT |kube.node.addresses.internal_ip[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.addresses[?(@.type == "InternalIP")].address.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Node [{#NAME}] Allocatable: CPU |<p>Allocatable CPU.</p><p>'Allocatable' on a Kubernetes node is defined as the amount of compute resources that are available for pods. The scheduler does not over-subscribe 'Allocatable'. 'CPU', 'memory' and 'ephemeral-storage' are supported as of now.</p> |DEPENDENT |kube.node.allocatable.cpu[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.allocatable.cpu`</p> |
+|Kubernetes |Node [{#NAME}] Allocatable: Memory |<p>Allocatable Memory.</p><p>'Allocatable' on a Kubernetes node is defined as the amount of compute resources that are available for pods. The scheduler does not over-subscribe 'Allocatable'. 'CPU', 'memory' and 'ephemeral-storage' are supported as of now.</p> |DEPENDENT |kube.node.allocatable.memory[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.allocatable.memory`</p> |
+|Kubernetes |Node [{#NAME}] Allocatable: Pods |<p>https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/</p> |DEPENDENT |kube.node.allocatable.pods[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.allocatable.pods`</p> |
+|Kubernetes |Node [{#NAME}] Capacity: CPU |<p>CPU resource capacity.</p><p>https://kubernetes.io/docs/concepts/architecture/nodes/#capacity</p> |DEPENDENT |kube.node.capacity.cpu[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.capacity.cpu`</p> |
+|Kubernetes |Node [{#NAME}] Capacity: Memory |<p>Memory resource capacity.</p><p>https://kubernetes.io/docs/concepts/architecture/nodes/#capacity</p> |DEPENDENT |kube.node.capacity.memory[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.capacity.memory`</p> |
+|Kubernetes |Node [{#NAME}] Capacity: Pods |<p>https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/</p> |DEPENDENT |kube.node.capacity.pods[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.capacity.pods`</p> |
+|Kubernetes |Node [{#NAME}] Conditions: Disk pressure |<p>True if pressure exists on the disk size - that is, if the disk capacity is low; otherwise False.</p> |DEPENDENT |kube.node.conditions.diskpressure[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.conditions[?(@.type == "DiskPressure")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
+|Kubernetes |Node [{#NAME}] Conditions: Memory pressure |<p>True if pressure exists on the node memory - that is, if the node memory is low; otherwise False.</p> |DEPENDENT |kube.node.conditions.memorypressure[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.conditions[?(@.type == "MemoryPressure")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
+|Kubernetes |Node [{#NAME}] Conditions: Network unavailable |<p>True if the network for the node is not correctly configured, otherwise False.</p> |DEPENDENT |kube.node.conditions.networkunavailable[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.conditions[?(@.type == "NetworkUnavailable")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
+|Kubernetes |Node [{#NAME}] Conditions: PID pressure |<p>True if pressure exists on the processes - that is, if there are too many processes on the node; otherwise False.</p> |DEPENDENT |kube.node.conditions.pidpressure[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.conditions[?(@.type == "PIDPressure")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
+|Kubernetes |Node [{#NAME}] Conditions: Ready |<p>True if the node is healthy and ready to accept pods, False if the node is not healthy and is not accepting pods, and Unknown if the node controller has not heard from the node in the last node-monitor-grace-period (default is 40 seconds).</p> |DEPENDENT |kube.node.conditions.ready[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.conditions[?(@.type == "Ready")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
+|Kubernetes |Node [{#NAME}] Info: Architecture |<p>Node architecture.</p> |DEPENDENT |kube.node.info.architecture[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.nodeInfo.architecture`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Node [{#NAME}] Info: Container runtime |<p>Container runtime.</p><p>https://kubernetes.io/docs/setup/production-environment/container-runtimes/</p> |DEPENDENT |kube.node.info.containerruntime[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.nodeInfo.containerRuntimeVersion`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Node [{#NAME}] Info: Kernel version |<p>Node kernel version.</p> |DEPENDENT |kube.node.info.kernelversion[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.nodeInfo.kernelVersion`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Node [{#NAME}] Info: Kubelet version |<p>Version of Kubelet.</p> |DEPENDENT |kube.node.info.kubeletversion[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.nodeInfo.kubeletVersion`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Node [{#NAME}] Info: KubeProxy version |<p>Version of KubeProxy.</p> |DEPENDENT |kube.node.info.kubeproxyversion[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.nodeInfo.kubeProxyVersion`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Node [{#NAME}] Info: Operating system |<p>Node operating system.</p> |DEPENDENT |kube.node.info.operatingsystem[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.nodeInfo.operatingSystem`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Node [{#NAME}] Info: OS image |<p>Node OS image.</p> |DEPENDENT |kube.node.info.osversion[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.nodeInfo.kernelVersion`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Node [{#NAME}] Info: Roles |<p>Node roles.</p> |DEPENDENT |kube.node.info.roles[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.roles`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `3h`</p> |
+|Kubernetes |Node [{#NAME}] Limits: CPU |<p>Node CPU limits.</p><p>https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/</p> |DEPENDENT |kube.node.limits.cpu[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.pods[*].containers.limits.cpu.sum()`</p> |
+|Kubernetes |Node [{#NAME}] Limits: Memory |<p>Node Memory limits.</p><p>https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/</p> |DEPENDENT |kube.node.limits.memory[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.pods[*].containers.limits.memory.sum()`</p> |
+|Kubernetes |Node [{#NAME}] Requests: CPU |<p>Node CPU requests.</p><p>https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/</p> |DEPENDENT |kube.node.requests.cpu[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.pods[*].containers.requests.cpu.sum()`</p> |
+|Kubernetes |Node [{#NAME}] Requests: Memory |<p>Node Memory requests.</p><p>https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/</p> |DEPENDENT |kube.node.requests.memory[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.pods[*].containers.requests.memory.sum()`</p> |
+|Kubernetes |Node [{#NAME}] Uptime |<p>Node uptime.</p> |DEPENDENT |kube.node.uptime[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.metadata.creationTimestamp`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return Math.floor((Date.now() - new Date(value)) / 1000);`</p> |
+|Kubernetes |Node [{#NAME}] Used: Pods |<p>Current number of pods on the node.</p> |DEPENDENT |kube.node.used.pods[{#NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.status.podsCount`</p> |
+|Kubernetes |Node [{#NODE}] Pod [{#POD}]: Get data |<p>Collecting and processing cluster by node [{#NODE}] data via Kubernetes API.</p> |DEPENDENT |kube.pod.get[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].first()`</p> |
+|Kubernetes |Node [{#NODE}] Pod [{#POD}] Conditions: Containers ready |<p>All containers in the Pod are ready.</p><p>https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions</p> |DEPENDENT |kube.pod.conditions.containers_ready[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.conditions[?(@.type == "ContainersReady")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
+|Kubernetes |Node [{#NODE}] Pod [{#POD}] Conditions: Initialized |<p>All init containers have started successfully.</p><p>https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions</p> |DEPENDENT |kube.pod.conditions.initialized[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.conditions[?(@.type == "Initialized")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
+|Kubernetes |Node [{#NODE}] Pod [{#POD}] Conditions: Ready |<p>The Pod is able to serve requests and should be added to the load balancing pools of all matching Services.</p><p>https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions</p> |DEPENDENT |kube.pod.conditions.ready[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.conditions[?(@.type == "Ready")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
+|Kubernetes |Node [{#NODE}] Pod [{#POD}] Conditions: Scheduled |<p>The Pod has been scheduled to a node.</p><p>https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions</p> |DEPENDENT |kube.pod.conditions.scheduled[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.conditions[?(@.type == "PodScheduled")].status.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['True', 'False', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
+|Kubernetes |Node [{#NODE}] Pod [{#POD}] Containers: Restarts |<p>The number of times the container has been restarted, currently based on the number of dead containers that have not yet been removed. Note that this is calculated from dead containers. But those containers are subject to garbage collection.</p> |DEPENDENT |kube.pod.containers.restartcount[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.containers.restartCount`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p> |
+|Kubernetes |Node [{#NODE}] Pod [{#POD}] Status: Phase |<p>The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle.</p><p>https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase</p> |DEPENDENT |kube.pod.status.phase[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.phase`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return ['Pending', 'Running', 'Succeeded', 'Failed', 'Unknown'].indexOf(value) + 1 || 'Problem with status processing in JS'; `</p> |
+|Kubernetes |Node [{#NODE}] Pod [{#POD}] Uptime |<p>Pod uptime.</p> |DEPENDENT |kube.pod.uptime[{#POD}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.startTime`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `return Math.floor((Date.now() - new Date(value)) / 1000);`</p> |
## Triggers
@@ -178,7 +181,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_nodes_http/template_kubernetes_nodes.yaml b/templates/app/kubernetes_http/kubernetes_nodes_http/template_kubernetes_nodes.yaml
index 7b9ee2583a4..7957c135b04 100644
--- a/templates/app/kubernetes_http/kubernetes_nodes_http/template_kubernetes_nodes.yaml
+++ b/templates/app/kubernetes_http/kubernetes_nodes_http/template_kubernetes_nodes.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.4'
- date: '2022-07-07T11:07:51Z'
+ date: '2022-11-10T10:19:26Z'
template_groups:
-
uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
@@ -391,7 +391,7 @@ zabbix_export:
};
if (typeof input !== 'object' || typeof input.items === 'undefined') {
- Zabbix.log(4, '[ Kubernetes ] Received incorrect JSON: ' + input);
+ Zabbix.log(4, '[ Kubernetes ] Received incorrect JSON: ' + value);
throw 'Incorrect JSON. Check debug log for more information.';
}
@@ -485,14 +485,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.addresses[?(@.type == "ExternalIP")].address.first()'
+ - '$.status.addresses[?(@.type == "ExternalIP")].address.first()'
error_handler: DISCARD_VALUE
-
type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -514,14 +514,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.addresses[?(@.type == "InternalIP")].address.first()'
+ - '$.status.addresses[?(@.type == "InternalIP")].address.first()'
error_handler: DISCARD_VALUE
-
type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -545,9 +545,9 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.allocatable.cpu.first()'
+ - $.status.allocatable.cpu
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -571,9 +571,9 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.allocatable.memory.first()'
+ - $.status.allocatable.memory
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -593,9 +593,9 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.allocatable.pods.first()'
+ - $.status.allocatable.pods
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -619,9 +619,9 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.capacity.cpu.first()'
+ - $.status.capacity.cpu
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -645,9 +645,9 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.capacity.memory.first()'
+ - $.status.capacity.memory
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -667,9 +667,9 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.capacity.pods.first()'
+ - $.status.capacity.pods
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -691,14 +691,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.conditions[?(@.type == "DiskPressure")].status.first()'
+ - '$.status.conditions[?(@.type == "DiskPressure")].status.first()'
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return [''True'', ''False'', ''Unknown''].indexOf(value) + 1 || ''Problem with status processing in JS'';'
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -732,14 +732,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.conditions[?(@.type == "MemoryPressure")].status.first()'
+ - '$.status.conditions[?(@.type == "MemoryPressure")].status.first()'
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return [''True'', ''False'', ''Unknown''].indexOf(value) + 1 || ''Problem with status processing in JS'';'
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -773,14 +773,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.conditions[?(@.type == "NetworkUnavailable")].status.first()'
+ - '$.status.conditions[?(@.type == "NetworkUnavailable")].status.first()'
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return [''True'', ''False'', ''Unknown''].indexOf(value) + 1 || ''Problem with status processing in JS'';'
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -814,14 +814,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.conditions[?(@.type == "PIDPressure")].status.first()'
+ - '$.status.conditions[?(@.type == "PIDPressure")].status.first()'
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return [''True'', ''False'', ''Unknown''].indexOf(value) + 1 || ''Problem with status processing in JS'';'
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -855,14 +855,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.conditions[?(@.type == "Ready")].status.first()'
+ - '$.status.conditions[?(@.type == "Ready")].status.first()'
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return [''True'', ''False'', ''Unknown''].indexOf(value) + 1 || ''Problem with status processing in JS'';'
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -885,6 +885,30 @@ zabbix_export:
tag: scope
value: availability
-
+ uuid: 3d8536659ac44347b36e61f60873fa61
+ name: 'Node [{#NAME}]: Get data'
+ type: DEPENDENT
+ key: 'kube.node.get[{#NAME}]'
+ delay: '0'
+ history: '0'
+ trends: '0'
+ value_type: CHAR
+ description: 'Collecting and processing cluster by node [{#NAME}] data via Kubernetes API.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - '$.items[?(@.metadata.name == "{#NAME}")].first()'
+ master_item:
+ key: kube.nodes
+ tags:
+ -
+ tag: component
+ value: raw
+ -
+ tag: node
+ value: '{#NAME}'
+ -
uuid: 8f9152074e2041d7b5cd2c6215e06832
name: 'Node [{#NAME}] Info: Architecture'
type: DEPENDENT
@@ -898,13 +922,13 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.architecture.first()'
+ - $.status.nodeInfo.architecture
-
type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -929,13 +953,13 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.containerRuntimeVersion.first()'
+ - $.status.nodeInfo.containerRuntimeVersion
-
type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -957,13 +981,13 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.kernelVersion.first()'
+ - $.status.nodeInfo.kernelVersion
-
type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -985,13 +1009,13 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.kubeletVersion.first()'
+ - $.status.nodeInfo.kubeletVersion
-
type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -1013,13 +1037,13 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.kubeProxyVersion.first()'
+ - $.status.nodeInfo.kubeProxyVersion
-
type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -1041,13 +1065,13 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.operatingSystem.first()'
+ - $.status.nodeInfo.operatingSystem
-
type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -1069,13 +1093,13 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.nodeInfo.kernelVersion.first()'
+ - $.status.nodeInfo.kernelVersion
-
type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -1097,13 +1121,13 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.roles.first()'
+ - $.status.roles
-
type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -1127,9 +1151,9 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].pods[*].containers.limits.cpu.sum()'
+ - '$.pods[*].containers.limits.cpu.sum()'
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -1153,9 +1177,9 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].pods[*].containers.limits.memory.sum()'
+ - '$.pods[*].containers.limits.memory.sum()'
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -1179,9 +1203,9 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].pods[*].containers.requests.cpu.sum()'
+ - '$.pods[*].containers.requests.cpu.sum()'
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -1205,9 +1229,9 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].pods[*].containers.requests.memory.sum()'
+ - '$.pods[*].containers.requests.memory.sum()'
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -1228,14 +1252,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].metadata.creationTimestamp.first()'
+ - $.metadata.creationTimestamp
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return Math.floor((Date.now() - new Date(value)) / 1000);'
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -1267,9 +1291,9 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NAME}")].status.podsCount.first()'
+ - $.status.podsCount
master_item:
- key: kube.nodes
+ key: 'kube.node.get[{#NAME}]'
tags:
-
tag: component
@@ -1538,14 +1562,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].conditions[?(@.type == "ContainersReady")].status.first()'
+ - '$.conditions[?(@.type == "ContainersReady")].status.first()'
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return [''True'', ''False'', ''Unknown''].indexOf(value) + 1 || ''Problem with status processing in JS'';'
master_item:
- key: kube.nodes
+ key: 'kube.pod.get[{#POD}]'
tags:
-
tag: component
@@ -1576,14 +1600,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].conditions[?(@.type == "Initialized")].status.first()'
+ - '$.conditions[?(@.type == "Initialized")].status.first()'
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return [''True'', ''False'', ''Unknown''].indexOf(value) + 1 || ''Problem with status processing in JS'';'
master_item:
- key: kube.nodes
+ key: 'kube.pod.get[{#POD}]'
tags:
-
tag: component
@@ -1614,14 +1638,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].conditions[?(@.type == "Ready")].status.first()'
+ - '$.conditions[?(@.type == "Ready")].status.first()'
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return [''True'', ''False'', ''Unknown''].indexOf(value) + 1 || ''Problem with status processing in JS'';'
master_item:
- key: kube.nodes
+ key: 'kube.pod.get[{#POD}]'
tags:
-
tag: component
@@ -1652,14 +1676,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].conditions[?(@.type == "PodScheduled")].status.first()'
+ - '$.conditions[?(@.type == "PodScheduled")].status.first()'
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return [''True'', ''False'', ''Unknown''].indexOf(value) + 1 || ''Problem with status processing in JS'';'
master_item:
- key: kube.nodes
+ key: 'kube.pod.get[{#POD}]'
tags:
-
tag: component
@@ -1685,10 +1709,10 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].containers.restartCount.first()'
+ - $.containers.restartCount
error_handler: DISCARD_VALUE
master_item:
- key: kube.nodes
+ key: 'kube.pod.get[{#POD}]'
tags:
-
tag: component
@@ -1714,6 +1738,33 @@ zabbix_export:
tag: scope
value: availability
-
+ uuid: 34a542538cf449f287a99052870988be
+ name: 'Node [{#NODE}] Pod [{#POD}]: Get data'
+ type: DEPENDENT
+ key: 'kube.pod.get[{#POD}]'
+ delay: '0'
+ history: '0'
+ trends: '0'
+ value_type: CHAR
+ description: 'Collecting and processing cluster by node [{#NODE}] data via Kubernetes API.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - '$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].first()'
+ master_item:
+ key: kube.nodes
+ tags:
+ -
+ tag: component
+ value: raw
+ -
+ tag: node
+ value: '{#NODE}'
+ -
+ tag: pod
+ value: '{#POD}'
+ -
uuid: 6862be81e52b4abcb319a8847b022634
name: 'Node [{#NODE}] Pod [{#POD}] Status: Phase'
type: DEPENDENT
@@ -1730,14 +1781,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].phase.first()'
+ - $.phase
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return [''Pending'', ''Running'', ''Succeeded'', ''Failed'', ''Unknown''].indexOf(value) + 1 || ''Problem with status processing in JS'';'
master_item:
- key: kube.nodes
+ key: 'kube.pod.get[{#POD}]'
tags:
-
tag: component
@@ -1775,14 +1826,14 @@ zabbix_export:
-
type: JSONPATH
parameters:
- - '$.items[?(@.metadata.name == "{#NODE}")].pods[?(@.name == "{#POD}")].startTime.first()'
+ - $.startTime
error_handler: DISCARD_VALUE
-
type: JAVASCRIPT
parameters:
- 'return Math.floor((Date.now() - new Date(value)) / 1000);'
master_item:
- key: kube.nodes
+ key: 'kube.pod.get[{#POD}]'
tags:
-
tag: component
@@ -1842,7 +1893,7 @@ zabbix_export:
output = [];
if (typeof input !== 'object' || typeof input.items === 'undefined') {
- Zabbix.log(4, '[ Kubernetes ] Received incorrect JSON: ' + input);
+ Zabbix.log(4, '[ Kubernetes ] Received incorrect JSON: ' + value);
throw 'Incorrect JSON. Check debug log for more information.';
}