Skip to content

Commit

Permalink
Merge pull request #63 from djerfy/feat/add-systempods
Browse files Browse the repository at this point in the history
feat: add systempods
  • Loading branch information
djerfy authored Nov 14, 2024
2 parents a6023b0 + abbda98 commit 7012a93
Show file tree
Hide file tree
Showing 11 changed files with 584 additions and 510 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ RUN apt-get update && \
useradd -u 2000 -d /app -s /bin/bash -M -g ${CONTAINER_GROUP} ${CONTAINER_USER} && \
python3 -m venv venv

ARG SUPERCRONIC_VER="0.2.31"
ARG SUPERCRONIC_SHA="fb4242e9d28528a76b70d878dbf69fe8d94ba7d2"
ARG SUPERCRONIC_VER="0.2.33"
ARG SUPERCRONIC_SHA="71b0d58cc53f6bd72cf2f293e09e294b79c666d8"

RUN curl -fsSLO "https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VER}/supercronic-linux-amd64" && \
echo "${SUPERCRONIC_SHA} supercronic-linux-amd64" | sha1sum -c - && \
Expand Down
124 changes: 67 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Kubernetes monitoring for Zabbix with discovery objects:
* StatefulSets
* Cronjobs
* PersistentVolumeClaims
* SystemPods

Works with 2 variables only by default:

Expand Down Expand Up @@ -97,7 +98,7 @@ usage: zabbix-kubernetes-discovery.py [-h]
[--zabbix-timeout ZABBIX_TIMEOUT]
--zabbix-endpoint ZABBIX_ENDPOINT
--kubernetes-name KUBERNETES_NAME
--monitoring-mode {volume,deployment,daemonset,node,statefulset,cronjob}
--monitoring-mode {volume,deployment,daemonset,node,statefulset,cronjob,systempod}
--monitoring-type {discovery,item,json}
[--object-name OBJECT_NAME]
[--match-label KEY=VALUE]
Expand Down Expand Up @@ -130,57 +131,57 @@ After downloading, you need to import it as below:

* Daemonset
* Items: 4
* `Daemonset {#KUBERNETES_DAEMONSET_NAME}: Available replicas`
* `Daemonset {#KUBERNETES_DAEMONSET_NAME}: Current replicas`
* `Daemonset {#KUBERNETES_DAEMONSET_NAME}: Desired replicas`
* `Daemonset {#KUBERNETES_DAEMONSET_NAME}: Ready replicas`
* `Daemonset {#KUBERNETES_DAEMONSET_NAMESPACE}/{#KUBERNETES_DAEMONSET_NAME}: Available replicas`
* `Daemonset {#KUBERNETES_DAEMONSET_NAMESPACE}/{#KUBERNETES_DAEMONSET_NAME}: Current replicas`
* `Daemonset {#KUBERNETES_DAEMONSET_NAMESPACE}/{#KUBERNETES_DAEMONSET_NAME}: Desired replicas`
* `Daemonset {#KUBERNETES_DAEMONSET_NAMESPACE}/{#KUBERNETES_DAEMONSET_NAME}: Ready replicas`
* Triggers: 5
* `Daemonset {#KUBERNETES_DAEMONSET_NAME}: Available replicas nodata`
* `Daemonset {#KUBERNETES_DAEMONSET_NAME}: Current replicas nodata`
* `Daemonset {#KUBERNETES_DAEMONSET_NAME}: Desired replicas nodata`
* `Daemonset {#KUBERNETES_DAEMONSET_NAME}: Ready replicas nodata`
* `Daemonset {#KUBERNETES_DAEMONSET_NAME}: Problem items nodata`
* `Daemonset {#KUBERNETES_DAEMONSET_NAMESPACE}/{#KUBERNETES_DAEMONSET_NAME}: Available replicas nodata`
* `Daemonset {#KUBERNETES_DAEMONSET_NAMESPACE}/{#KUBERNETES_DAEMONSET_NAME}: Current replicas nodata`
* `Daemonset {#KUBERNETES_DAEMONSET_NAMESPACE}/{#KUBERNETES_DAEMONSET_NAME}: Desired replicas nodata`
* `Daemonset {#KUBERNETES_DAEMONSET_NAMESPACE}/{#KUBERNETES_DAEMONSET_NAME}: Ready replicas nodata`
* `Daemonset {#KUBERNETES_DAEMONSET_NAMESPACE}/{#KUBERNETES_DAEMONSET_NAME}: Problem items nodata`
* Graphs: 1
* `Daemonset {#KUBERNETES_DAEMONSET_NAME}: Graph replicas`
* `Daemonset {#KUBERNETES_DAEMONSET_NAMESPACE}/{#KUBERNETES_DAEMONSET_NAME}: Graph replicas`
* Deployment
* Items: 3
* `Deployment {#KUBERNETES_DEPLOYMENT_NAME}: Available replicas`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAME}: Desired replicas`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAME}: Ready replicas`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAMESPACE}/{#KUBERNETES_DEPLOYMENT_NAME}: Available replicas`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAMESPACE}/{#KUBERNETES_DEPLOYMENT_NAME}: Desired replicas`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAMESPACE}/{#KUBERNETES_DEPLOYMENT_NAME}: Ready replicas`
* Triggers: 5
* `Deployment {#KUBERNETES_DEPLOYMENT_NAME}: Available replicas nodata`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAME}: Desired replicas nodata`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAME}: Ready replicas nodata`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAME}: Problem items nodata`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAME}: Problem number of replicas`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAMESPACE}/{#KUBERNETES_DEPLOYMENT_NAME}: Available replicas nodata`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAMESPACE}/{#KUBERNETES_DEPLOYMENT_NAME}: Desired replicas nodata`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAMESPACE}/{#KUBERNETES_DEPLOYMENT_NAME}: Ready replicas nodata`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAMESPACE}/{#KUBERNETES_DEPLOYMENT_NAME}: Problem items nodata`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAMESPACE}/{#KUBERNETES_DEPLOYMENT_NAME}: Problem number of replicas`
* Graphs: 1
* `Deployment {#KUBERNETES_DEPLOYMENT_NAME}: Graph replicas`
* `Deployment {#KUBERNETES_DEPLOYMENT_NAMESPACE}/{#KUBERNETES_DEPLOYMENT_NAME}: Graph replicas`
* Statefulset
* Items: 3
* `Statefulset {#KUBERNETES_STATEFULSET_NAME}: Available replicas`
* `Statefulset {#KUBERNETES_STATEFULSET_NAME}: Desired replicas`
* `Statefulset {#KUBERNETES_STATEFULSET_NAME}: Ready replicas`
* `Statefulset {#KUBERNETES_STATEFULSET_NAMESPACE}/{#KUBERNETES_STATEFULSET_NAME}: Available replicas`
* `Statefulset {#KUBERNETES_STATEFULSET_NAMESPACE}/{#KUBERNETES_STATEFULSET_NAME}: Desired replicas`
* `Statefulset {#KUBERNETES_STATEFULSET_NAMESPACE}/{#KUBERNETES_STATEFULSET_NAME}: Ready replicas`
* Triggers: 5
* `Statefulset {#KUBERNETES_STATEFULSET_NAME}: Available replicas nodata`
* `Stetafulset {#KUBERNETES_STATEFULSET_NAME}: Desired replicas nodata`
* `Statefulset {#KUBERNETES_STATEFULSET_NAME}: Ready replicas nodata`
* `Statefulset {#KUBERNETES_STATEFULSET_NAME}: Problem items nodata`
* `Statefulset {#KUBERNETES_STATEFULSET_NAME}: Problem number of replicas`
* `Statefulset {#KUBERNETES_STATEFULSET_NAMESPACE}/{#KUBERNETES_STATEFULSET_NAME}: Available replicas nodata`
* `Stetafulset {#KUBERNETES_STATEFULSET_NAMESPACE}/{#KUBERNETES_STATEFULSET_NAME}: Desired replicas nodata`
* `Statefulset {#KUBERNETES_STATEFULSET_NAMESPACE}/{#KUBERNETES_STATEFULSET_NAME}: Ready replicas nodata`
* `Statefulset {#KUBERNETES_STATEFULSET_NAMESPACE}/{#KUBERNETES_STATEFULSET_NAME}: Problem items nodata`
* `Statefulset {#KUBERNETES_STATEFULSET_NAMESPACE}/{#KUBERNETES_STATEFULSET_NAME}: Problem number of replicas`
* Graphs: 1
* `Deployment {#KUBERNETES_STATEFULSET_NAME}: Graph replicas`
* `Deployment {#KUBERNETES_STATEFULSET_NAMESPACE}/{#KUBERNETES_STATEFULSET_NAME}: Graph replicas`
* Cronjob
* Items: 3
* `Cronjob {#KUBERNETES_CRONJOB_NAME}: Job exitcode`
* `Cronjob {#KUBERNETES_CRONJOB_NAME}: Job restart`
* `Cronjob {#KUBERNETES_CRONJOB_NAME}: Job reason`
* `Cronjob {#KUBERNETES_CRONJOB_NAMESPACE}/{#KUBERNETES_CRONJOB_NAME}: Job exitcode`
* `Cronjob {#KUBERNETES_CRONJOB_NAMESPACE}/{#KUBERNETES_CRONJOB_NAME}: Job restart`
* `Cronjob {#KUBERNETES_CRONJOB_NAMESPACE}/{#KUBERNETES_CRONJOB_NAME}: Job reason`
* Triggers: 5
* `Cronjob {#KUBERNETES_CRONJOB_NAME}: Job exitcode nodata`
* `Cronjob {#KUBERNETES_CRONJOB_NAME}: Job restart nodata`
* `Cronjob {#KUBERNETES_CRONJOB_NAME}: Job reason nodata`
* `Cronjob {#KUBERNETES_CRONJOB_NAME}: Problem items nodata`
* `Cronjob {#KUBERNETES_CRONJOB_NAME}: Problem last job`
* `Cronjob {#KUBERNETES_CRONJOB_NAMESPACE}/{#KUBERNETES_CRONJOB_NAME}: Job exitcode nodata`
* `Cronjob {#KUBERNETES_CRONJOB_NAMESPACE}/{#KUBERNETES_CRONJOB_NAME}: Job restart nodata`
* `Cronjob {#KUBERNETES_CRONJOB_NAMESPACE}/{#KUBERNETES_CRONJOB_NAME}: Job reason nodata`
* `Cronjob {#KUBERNETES_CRONJOB_NAMESPACE}/{#KUBERNETES_CRONJOB_NAME}: Problem items nodata`
* `Cronjob {#KUBERNETES_CRONJOB_NAMESPACE}/{#KUBERNETES_CRONJOB_NAME}: Problem last job`
* Graphs: 1
* `Cronjob {#KUBERNETES_CRONJOB_NAME}: Graph jobs`
* `Cronjob {#KUBERNETES_CRONJOB_NAMESPACE}/{#KUBERNETES_CRONJOB_NAME}: Graph jobs`
* Node
* Items: 8
* `Node {#KUBERNETES_NODE_NAME}: Allocatable cpu`
Expand All @@ -204,27 +205,36 @@ After downloading, you need to import it as below:
* `Node {#KUBERNETES_NODE_NAME}: Graph pods`
* VolumeClaim
* Items: 6
* `Volume {#KUBERNETES_PVC_NAME}: Available bytes`
* `Volume {#KUBERNETES_PVC_NAME}: Capacity bytes`
* `Volume {#KUBERNETES_PVC_NAME}: Capacity inodes`
* `Volume {#KUBERNETES_PVC_NAME}: Free inodes`
* `Volume {#KUBERNETES_PVC_NAME}: Used bytes`
* `Volume {#KUBERNETES_PVC_NAME}: Used inodes`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Available bytes`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Capacity bytes`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Capacity inodes`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Free inodes`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Used bytes`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Used inodes`
* Triggers: 11
* `Volume {#KUBERNETES_PVC_NAME}: Available bytes nodata`
* `Volume {#KUBERNETES_PVC_NAME}: Capacity bytes nodata`
* `Volume {#KUBERNETES_PVC_NAME}: Capacity inodes nodata`
* `Volume {#KUBERNETES_PVC_NAME}: Consumption bytes critical`
* `Volume {#KUBERNETES_PVC_NAME}: Consumption bytes warning`
* `Volume {#KUBERNETES_PVC_NAME}: Consumption inodes critical`
* `Volume {#KUBERNETES_PVC_NAME}: Consumption inodes warning`
* `Volume {#KUBERNETES_PVC_NAME}: Free inodes nodata`
* `Volume {#KUBERNETES_PVC_NAME}: Used bytes nodata`
* `Volume {#KUBERNETES_PVC_NAME}: Used inodes nodata`
* `Volume {#KUBERNETES_PVC_NAME}: Problem items nodata`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Available bytes nodata`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Capacity bytes nodata`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Capacity inodes nodata`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Consumption bytes critical`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Consumption bytes warning`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Consumption inodes critical`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Consumption inodes warning`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Free inodes nodata`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Used bytes nodata`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Used inodes nodata`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Problem items nodata`
* Graphs: 2
* `Volume {#KUBERNETES_PVC_NAME}: Graph bytes`
* `Volume {#KUBERNETES_PVC_NAME}: Graph inodes`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Graph bytes`
* `Volume {#KUBERNETES_PVC_NAMESPACE}/{#KUBERNETES_PVC_NAME}: Graph inodes`
* Systempod
* Items: 2
* `Systempod {#KUBERNETES_SYSTEMPOD_NAMESPACE}/{#KUBERNETES_SYSTEMPOD_NAME}: Desired pod`
* `Systempod {#KUBERNETES_SYSTEMPOD_NAMESPACE}/{#KUBERNETES_SYSTEMPOD_NAME}: Running pod`
* Triggers: 2
* `Systempod {#KUBERNETES_SYSTEMPOD_NAMESPACE}/{#KUBERNETES_SYSTEMPOD_NAME}: Problem items nodata`
* `Systempod {#KUBERNETES_SYSTEMPOD_NAMESPACE}/{#KUBERNETES_SYSTEMPOD_NAME}: Problem pod`
* Graphs: 1
* `Systempod {#KUBERNETES_SYSTEMPOD_NAMESPACE}/{#KUBERNETES_SYSTEMPOD_NAME}: Graph status`

## Development

Expand Down
23 changes: 17 additions & 6 deletions helm/zabbix-kubernetes-discovery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,27 @@ $ helm delete zabbix-kubernetes-discovery \
| `zabbix.verbose` | string | `no` |
| `zabbix.debug` | string | `no` |
| `crontab.name` | string | `zabbix-kubernetes-discovery` |
| `crontab.node.discovery` | string | `*/30 * * * *` |
| `crontab.node.enabled` | string | `true` |
| `crontab.node.discovery` | string | `*/30 * * * *` |
| `crontab.node.item` | string | `*/2 * * * *` |
| `crontab.daemonset.discovery` | string | `*/30 * * * *` |
| `crontab.daemonset.enabled` | string | `true` |
| `crontab.daemonset.discovery` | string | `*/30 * * * *` |
| `crontab.daemonset.item` | string | `*/2 * * * *` |
| `crontab.volume.discovery` | string | `*/30 * * * *` |
| `crontab.volume.enabled` | string | `true` |
| `crontab.volume.discovery` | string | `*/30 * * * *` |
| `crontab.volume.item` | string | `*/2 * * * *` |
| `crontab.deployment.discovery` | string | `*/30 * * * *` |
| `crontab.deployment.enabled` | string | `true` |
| `crontab.deployment.discovery` | string | `*/30 * * * *` |
| `crontab.deployment.item` | string | `*/2 * * * *` |
| `crontab.statefulset.discovery` | string | `*/30 * * * *` |
| `crontab.statefulset.enabled` | string | `true` |
| `crontab.statefulset.discovery` | string | `*/30 * * * *` |
| `crontab.statefulset.item` | string | `*/2 * * * *` |
| `crontab.cronjob.discovery` | string | `*/30 * * * *` |
| `crontab.cronjob.enabled` | string | `true` |
| `crontab.cronjob.discovery` | string | `*/30 * * * *` |
| `crontab.cronjob.item` | string | `*/2 * * * *` |
| `crontab.systempod.enabled` | string | `true` |
| `crontab.systempod.discovery` | string | `*/30 * * * *` |
| `crontab.systempod.item` | string | `*/2 * * * *` |
| `monitoring.node.match_label` | string | `""` |
| `monitoring.node.include_name` | string | `""` |
| `monitoring.node.exclude_name` | string | `""` |
Expand Down Expand Up @@ -94,6 +103,8 @@ $ helm delete zabbix-kubernetes-discovery \
| `monitoring.cronjob.include_namespace` | string | `""` |
| `monitoring.cronjob.exclude_name` | string | `""` |
| `monitoring.cronjob.exclude_namespace` | string | `""` |
| `monitoring.systempod.include_name` | string | `""` |
| `monitoring.systempod.exclude_name` | string | `""` |
| `resources.requests.cpu` | string | `50m` |
| `resources.requests.memory` | string | `128Mi` |
| `resources.limits.cpu` | string | `1000m` |
Expand Down
Loading

0 comments on commit 7012a93

Please sign in to comment.