From 50173690472810bea332958fc122ad04dca0a465 Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 22 Dec 2024 14:39:45 +0100 Subject: [PATCH] feat(qemu-quest): Provide both an active and standard template --- README.md | 3 +- .../7.0/EL7_KVM_VM_Stack.yaml | 2 +- Stacks/Servers/EL7_KVM_VM_Stack/7.0/README.md | 2 +- .../7.0/EL8_KVM_VM_Stack.yaml | 2 +- Stacks/Servers/EL8_KVM_VM_Stack/7.0/README.md | 2 +- .../7.0/EL9_KVM_VM_Stack.yaml | 2 +- Stacks/Servers/EL9_KVM_VM_Stack/7.0/README.md | 2 +- Templates/Applications/qemu-ga/7.0/README.md | 2 - .../Applications/qemu-ga/7.0/qemu-ga.yaml | 42 +- .../{qemu-ga => qemu-ga_active}/6.4/README.md | 0 .../6.4/qemu-ga.yaml | 0 .../Applications/qemu-ga_active/7.0/README.md | 377 +++++++++++ .../qemu-ga_active/7.0/docs/gen_ref_pages.py | 6 + .../qemu-ga_active/7.0/mkdocs.yaml | 17 + .../qemu-ga_active/7.0/qemu-ga_active.yaml | 592 ++++++++++++++++++ catalog-info.yaml | 27 + hack/plays/manage.yml | 1 + 17 files changed, 1048 insertions(+), 31 deletions(-) rename Templates/Applications/{qemu-ga => qemu-ga_active}/6.4/README.md (100%) rename Templates/Applications/{qemu-ga => qemu-ga_active}/6.4/qemu-ga.yaml (100%) create mode 100644 Templates/Applications/qemu-ga_active/7.0/README.md create mode 100644 Templates/Applications/qemu-ga_active/7.0/docs/gen_ref_pages.py create mode 100644 Templates/Applications/qemu-ga_active/7.0/mkdocs.yaml create mode 100644 Templates/Applications/qemu-ga_active/7.0/qemu-ga_active.yaml diff --git a/README.md b/README.md index f96b00bc..5d775c14 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,8 @@ inheritance problems. | LVM | [✅](./Templates/Applications/LVM/3.0) | | | | MD-RAID | [✅](./Templates/Applications/MD-RAID/3.0) | | | | ntpd | [✅](./Templates/Applications/ntpd/3.0) | | | -| qemu-ga | | [✅](./Templates/Applications/qemu-ga/6.4) | [✅](./Templates/Applications/qemu-ga/7.0) | +| qemu-ga | | | [✅](./Templates/Applications/qemu-ga/7.0) | +| qemu-ga active | | [✅](./Templates/Applications/qemu-ga_active/6.4) | [✅](./Templates/Applications/qemu-ga_active/7.0) | | Rotter | [✅](./Templates/Applications/Rotter/3.0) | | | | rpc.gssd | | [✅](./Templates/Applications/rpc.gssd/6.4) | [✅](./Templates/Applications/rpc.gssd/7.0) | | rsyslog | | [✅](./Templates/Applications/rsyslog/6.4) | [✅](./Templates/Applications/rsyslog/7.0) | diff --git a/Stacks/Servers/EL7_KVM_VM_Stack/7.0/EL7_KVM_VM_Stack.yaml b/Stacks/Servers/EL7_KVM_VM_Stack/7.0/EL7_KVM_VM_Stack.yaml index 8cbdbdfe..169c72a1 100644 --- a/Stacks/Servers/EL7_KVM_VM_Stack/7.0/EL7_KVM_VM_Stack.yaml +++ b/Stacks/Servers/EL7_KVM_VM_Stack/7.0/EL7_KVM_VM_Stack.yaml @@ -17,7 +17,7 @@ zabbix_export: version: '7.0' templates: - name: 'EL7 Stack' - - name: qemu-ga + - name: 'qemu-ga active' groups: - name: Stacks/Servers tags: diff --git a/Stacks/Servers/EL7_KVM_VM_Stack/7.0/README.md b/Stacks/Servers/EL7_KVM_VM_Stack/7.0/README.md index f7b12ade..a5dc8978 100644 --- a/Stacks/Servers/EL7_KVM_VM_Stack/7.0/README.md +++ b/Stacks/Servers/EL7_KVM_VM_Stack/7.0/README.md @@ -12,7 +12,7 @@ collection](https://github.com/radiorabe/rabe-zabbix). This Zabbix template depends on the following templates. * EL7 Stack -* qemu-ga +* qemu-ga active ## License diff --git a/Stacks/Servers/EL8_KVM_VM_Stack/7.0/EL8_KVM_VM_Stack.yaml b/Stacks/Servers/EL8_KVM_VM_Stack/7.0/EL8_KVM_VM_Stack.yaml index 8fe44d94..c8ff84c5 100644 --- a/Stacks/Servers/EL8_KVM_VM_Stack/7.0/EL8_KVM_VM_Stack.yaml +++ b/Stacks/Servers/EL8_KVM_VM_Stack/7.0/EL8_KVM_VM_Stack.yaml @@ -17,7 +17,7 @@ zabbix_export: version: '7.0' templates: - name: 'EL8 Stack' - - name: qemu-ga + - name: 'qemu-ga active' groups: - name: Stacks/Servers tags: diff --git a/Stacks/Servers/EL8_KVM_VM_Stack/7.0/README.md b/Stacks/Servers/EL8_KVM_VM_Stack/7.0/README.md index 438f464b..bb1a2aec 100644 --- a/Stacks/Servers/EL8_KVM_VM_Stack/7.0/README.md +++ b/Stacks/Servers/EL8_KVM_VM_Stack/7.0/README.md @@ -12,7 +12,7 @@ collection](https://github.com/radiorabe/rabe-zabbix). This Zabbix template depends on the following templates. * EL8 Stack -* qemu-ga +* qemu-ga active ## License diff --git a/Stacks/Servers/EL9_KVM_VM_Stack/7.0/EL9_KVM_VM_Stack.yaml b/Stacks/Servers/EL9_KVM_VM_Stack/7.0/EL9_KVM_VM_Stack.yaml index 7e2e28b2..1733fe5a 100644 --- a/Stacks/Servers/EL9_KVM_VM_Stack/7.0/EL9_KVM_VM_Stack.yaml +++ b/Stacks/Servers/EL9_KVM_VM_Stack/7.0/EL9_KVM_VM_Stack.yaml @@ -17,7 +17,7 @@ zabbix_export: version: '7.0' templates: - name: 'EL9 Stack' - - name: qemu-ga + - name: 'qemu-ga active' groups: - name: Stacks/Servers tags: diff --git a/Stacks/Servers/EL9_KVM_VM_Stack/7.0/README.md b/Stacks/Servers/EL9_KVM_VM_Stack/7.0/README.md index 4da1a673..f12ebab7 100644 --- a/Stacks/Servers/EL9_KVM_VM_Stack/7.0/README.md +++ b/Stacks/Servers/EL9_KVM_VM_Stack/7.0/README.md @@ -12,7 +12,7 @@ collection](https://github.com/radiorabe/rabe-zabbix). This Zabbix template depends on the following templates. * EL9 Stack -* qemu-ga +* qemu-ga active ## License diff --git a/Templates/Applications/qemu-ga/7.0/README.md b/Templates/Applications/qemu-ga/7.0/README.md index c37dca62..b885a73d 100644 --- a/Templates/Applications/qemu-ga/7.0/README.md +++ b/Templates/Applications/qemu-ga/7.0/README.md @@ -23,7 +23,6 @@ Settings: | Item Setting | Value | | ------------ | ----- | -| Type | ZABBIX_ACTIVE | | Value type | TEXT | ### Item: qemu-ga: Unit active state @@ -294,7 +293,6 @@ Settings: | Item Setting | Value | | ------------ | ----- | -| Type | ZABBIX_ACTIVE | | Value type | TEXT | ## Triggers diff --git a/Templates/Applications/qemu-ga/7.0/qemu-ga.yaml b/Templates/Applications/qemu-ga/7.0/qemu-ga.yaml index 6fd6bffc..4131f222 100644 --- a/Templates/Applications/qemu-ga/7.0/qemu-ga.yaml +++ b/Templates/Applications/qemu-ga/7.0/qemu-ga.yaml @@ -4,7 +4,7 @@ zabbix_export: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 name: Templates/Applications templates: - - uuid: 77a0624363cd4616a13d1902430ae186 + - uuid: b16432d2badd4f24b26678a57acbbe1c template: qemu-ga name: 'QEMU Guest Agent' description: | @@ -18,9 +18,8 @@ zabbix_export: groups: - name: Templates/Applications items: - - uuid: 479183626b394584a9faf40cda6e86ff + - uuid: aedc0d5ca3104b62ba424e19efffcee7 name: 'qemu-ga: process summary' - type: ZABBIX_ACTIVE key: 'proc.get[qemu-ga,root,,summary]' history: '0' value_type: TEXT @@ -29,7 +28,7 @@ zabbix_export: tags: - tag: component value: raw - - uuid: 490c3dc19ef844dda08fc71378a65de2 + - uuid: 02c6ae87961d4129a9c2aad521c8cb87 name: 'qemu-ga: Unit active state' type: DEPENDENT key: rabe.qemu-ga.active_state @@ -51,7 +50,7 @@ zabbix_export: - tag: component value: service triggers: - - uuid: 35f0bcdb66a14d9da957bf89f86a5bcd + - uuid: c44acf018d5e486ea9143836c599071d expression: last(/qemu-ga/rabe.qemu-ga.active_state)<>1 name: 'qemu-ga: Service is not running' priority: WARNING @@ -59,7 +58,7 @@ zabbix_export: tags: - tag: scope value: availability - - uuid: 17bd216dfec5463f8ddbc8237bf25fbc + - uuid: e917382db512495c827653ec85ff1ac9 name: 'qemu-ga: CPU seconds (system)' type: DEPENDENT key: rabe.qemu-ga.cputime_system @@ -82,7 +81,7 @@ zabbix_export: tags: - tag: component value: qemu-ga - - uuid: 1def6d220e36452b850cdb00ee088372 + - uuid: 9145fc9350a544beb96bef9ea69db12d name: 'qemu-ga: CPU seconds (user)' type: DEPENDENT key: rabe.qemu-ga.cputime_user @@ -105,7 +104,7 @@ zabbix_export: tags: - tag: component value: qemu-ga - - uuid: 983e40d9d5f04fd483681421cedae2fe + - uuid: 214a2560c2974083aca15a65ce485084 name: 'qemu-ga: Service load state' type: DEPENDENT key: rabe.qemu-ga.load_state @@ -126,7 +125,7 @@ zabbix_export: tags: - tag: component value: service - - uuid: f1dd7d16f45c4fd289cfa085ae1c88b8 + - uuid: ef40f252740b45c49b6a4e59f03e3b43 name: 'qemu-ga: Number of processes' type: DEPENDENT key: rabe.qemu-ga.processes @@ -146,7 +145,7 @@ zabbix_export: - tag: component value: qemu-ga triggers: - - uuid: aa2a46515f98469482296b49600c44c7 + - uuid: 3a1e7916e4084c3c89eb2c29559e7beb expression: 'last(/qemu-ga/rabe.qemu-ga.processes)<{$QEMUGA.THRESHOLD.MIN_PROC}' name: 'qemu-ga: No running processes' priority: HIGH @@ -157,7 +156,7 @@ zabbix_export: tags: - tag: scope value: availability - - uuid: 49bda86d7fa6491e88b9cace94751f34 + - uuid: 2584d752ee864ed3a40ba982d8ac6e51 name: 'qemu-ga: Memory usage (RSS)' type: DEPENDENT key: rabe.qemu-ga.rss @@ -177,7 +176,7 @@ zabbix_export: tags: - tag: component value: qemu-ga - - uuid: 850a82a7000d44509b709951fe00ac98 + - uuid: 91a93eddfafd497eb2cf2f0a61468852 name: 'qemu-ga: Swap usage' type: DEPENDENT key: rabe.qemu-ga.swap @@ -197,7 +196,7 @@ zabbix_export: tags: - tag: component value: qemu-ga - - uuid: b799e7ba76b2442ba0b296c51f7517a4 + - uuid: 5691720c2fd94dd0a478e2033393a758 name: 'qemu-ga: Number of threads' type: DEPENDENT key: rabe.qemu-ga.threads @@ -216,7 +215,7 @@ zabbix_export: tags: - tag: component value: qemu-ga - - uuid: dc3d8fd54e7b44d4951f276f1703496d + - uuid: b6584b0b372c42e58934ed952669134e name: 'qemu-ga: Unit file state' type: DEPENDENT key: rabe.qemu-ga.unitfile_state @@ -237,7 +236,7 @@ zabbix_export: tags: - tag: component value: service - - uuid: b44b4dda6f254b19879ce854b29f5f12 + - uuid: b9be103c032341e9b6d19553e38bf5c9 name: 'qemu-ga: Uptime' type: DEPENDENT key: rabe.qemu-ga.uptime @@ -261,7 +260,7 @@ zabbix_export: - tag: component value: service triggers: - - uuid: d2e99905e5e04957a2953ef7f71081f7 + - uuid: fabb1704509c4b1fb044c94f769e3daf expression: last(/qemu-ga/rabe.qemu-ga.uptime)<=10m name: 'qemu-ga: has been restarted' priority: INFO @@ -269,9 +268,8 @@ zabbix_export: tags: - tag: scope value: notice - - uuid: 609efd8900794691a7ace4002d1c78ae + - uuid: b2da699dab1e410ab15b4b37ea0056ad name: 'qemu-ga: unit info' - type: ZABBIX_ACTIVE key: 'systemd.unit.get["qemu-guest-agent.service"]' history: '0' value_type: TEXT @@ -292,7 +290,7 @@ zabbix_export: value: '1' description: 'Minimum amount of processes expected to be running at all times.' dashboards: - - uuid: 910162aa19a04fd9b91f491190ab4c74 + - uuid: 3bf1bab51c964662a6a53feeafe89485 name: 'qemu-ga: Overview' pages: - widgets: @@ -539,7 +537,7 @@ zabbix_export: name: thresholds.1.threshold value: '1' valuemaps: - - uuid: 3379206daed14761a2104f5bda46651f + - uuid: e00dfbb2a2cb4b6d8aeb5b4bee8f41ad name: 'Unit Active State' mappings: - value: '0' @@ -556,7 +554,7 @@ zabbix_export: newvalue: activating - value: '6' newvalue: deactivating - - uuid: ed6125e7aadc47b1bd6c5a5133fcb676 + - uuid: f64252bbca9f44dba3f30660e4c9d202 name: 'Unit File State' mappings: - value: o @@ -579,7 +577,7 @@ zabbix_export: newvalue: disabled - value: '9' newvalue: runtime - - uuid: 35810908d92e41b2b760d0c38c887ceb + - uuid: f80fe8fe8e164d398cf129c0af560529 name: 'Unit Load State' mappings: - value: '0' diff --git a/Templates/Applications/qemu-ga/6.4/README.md b/Templates/Applications/qemu-ga_active/6.4/README.md similarity index 100% rename from Templates/Applications/qemu-ga/6.4/README.md rename to Templates/Applications/qemu-ga_active/6.4/README.md diff --git a/Templates/Applications/qemu-ga/6.4/qemu-ga.yaml b/Templates/Applications/qemu-ga_active/6.4/qemu-ga.yaml similarity index 100% rename from Templates/Applications/qemu-ga/6.4/qemu-ga.yaml rename to Templates/Applications/qemu-ga_active/6.4/qemu-ga.yaml diff --git a/Templates/Applications/qemu-ga_active/7.0/README.md b/Templates/Applications/qemu-ga_active/7.0/README.md new file mode 100644 index 00000000..195a2f1b --- /dev/null +++ b/Templates/Applications/qemu-ga_active/7.0/README.md @@ -0,0 +1,377 @@ +# Zabbix Template: QEMU Guest Agent (active) + +![class: software](https://img.shields.io/badge/class-software-00c9bf) ![target: qemu-ga](https://img.shields.io/badge/target-qemu-ga-00c9bf) ![vendor: RaBe](https://img.shields.io/badge/vendor-RaBe-00c9bf) ![version: 7.0](https://img.shields.io/badge/version-7.0-00c9bf) + +Monitoring of the [QEMU Guest Agent](https://www.qemu.org/docs/master/interop/qemu-ga.html). + +This template is part of [RaBe's Zabbix template and helpers +collection](https://github.com/radiorabe/rabe-zabbix). + +## Items + +### Item: qemu-ga: process summary + +![component: raw](https://img.shields.io/badge/component-raw-00c9bf) + +Get info about qemu-ga processes + +```console +proc.get[qemu-ga,root,,summary] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | ZABBIX_ACTIVE | +| Value type | TEXT | + +### Item: qemu-ga: Unit active state + +![component: service](https://img.shields.io/badge/component-service-00c9bf) + +State value that reflects whether the unit is currently active or not. The following states are currently defined: "active", "reloading", "inactive", "failed", "activating", and "deactivating". + +```console +rabe.qemu-ga.active_state +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `systemd.unit.get["qemu-guest-agent.service"]` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.ActiveState.state"]` | +| DISCARD_UNCHANGED_HEARTBEAT | `["30m"]` | + +### Item: qemu-ga: CPU seconds (system) + +![component: qemu-ga](https://img.shields.io/badge/component-qemu-ga-00c9bf) + +Total CPU seconds (system) of qemu-ga processes. + +```console +rabe.qemu-ga.cputime_system +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | FLOAT | +| History | 7d | +| Source item | `proc.get[qemu-ga,root,,summary]` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$[*].cputime_system.first()"]` | +| SIMPLE_CHANGE | `[""]` | +| DISCARD_UNCHANGED_HEARTBEAT | `["5m"]` | + +### Item: qemu-ga: CPU seconds (user) + +![component: qemu-ga](https://img.shields.io/badge/component-qemu-ga-00c9bf) + +Total CPU seconds (user) of qemu-ga processes. + +```console +rabe.qemu-ga.cputime_user +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | FLOAT | +| History | 7d | +| Source item | `proc.get[qemu-ga,root,,summary]` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$[*].cputime_user.first()"]` | +| SIMPLE_CHANGE | `[""]` | +| DISCARD_UNCHANGED_HEARTBEAT | `["5m"]` | + +### Item: qemu-ga: Service load state + +![component: service](https://img.shields.io/badge/component-service-00c9bf) + +State value that reflects whether the configuration file of this unit has been loaded. The following states are currently defined: "loaded", "error", and "masked". + +```console +rabe.qemu-ga.load_state +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `systemd.unit.get["qemu-guest-agent.service"]` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.LoadState.state"]` | +| DISCARD_UNCHANGED_HEARTBEAT | `["30m"]` | + +### Item: qemu-ga: Number of processes + +![component: qemu-ga](https://img.shields.io/badge/component-qemu-ga-00c9bf) + +Number of qemu-ga processes. + +```console +rabe.qemu-ga.processes +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `proc.get[qemu-ga,root,,summary]` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$[*].processes.first()"]` | +| DISCARD_UNCHANGED_HEARTBEAT | `["5m"]` | + +### Item: qemu-ga: Memory usage (RSS) + +![component: qemu-ga](https://img.shields.io/badge/component-qemu-ga-00c9bf) + +Memory usage of qemu-ga processes. + +```console +rabe.qemu-ga.rss +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `proc.get[qemu-ga,root,,summary]` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$[*].rss.first()"]` | +| DISCARD_UNCHANGED_HEARTBEAT | `["5m"]` | + +### Item: qemu-ga: Swap usage + +![component: qemu-ga](https://img.shields.io/badge/component-qemu-ga-00c9bf) + +Swap usage of qemu-ga processes. + +```console +rabe.qemu-ga.swap +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `proc.get[qemu-ga,root,,summary]` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$[*].swap.first()"]` | +| DISCARD_UNCHANGED_HEARTBEAT | `["5m"]` | + +### Item: qemu-ga: Number of threads + +![component: qemu-ga](https://img.shields.io/badge/component-qemu-ga-00c9bf) + +Number of qemu-ga threads. + +```console +rabe.qemu-ga.threads +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `proc.get[qemu-ga,root,,summary]` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$[*].threads.first()"]` | +| DISCARD_UNCHANGED_HEARTBEAT | `["5m"]` | + +### Item: qemu-ga: Unit file state + +![component: service](https://img.shields.io/badge/component-service-00c9bf) + +Encodes the install state of the unit file of FragmentPath. It currently knows the following states: "enabled", "enabled-runtime", "linked", "linked-runtime", "masked", "masked-runtime", "static", "disabled", and "invalid". + +```console +rabe.qemu-ga.unitfile_state +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `systemd.unit.get["qemu-guest-agent.service"]` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.UnitFileState.state"]` | +| DISCARD_UNCHANGED_HEARTBEAT | `["30m"]` | + +### Item: qemu-ga: Uptime + +![component: service](https://img.shields.io/badge/component-service-00c9bf) + +Number of seconds since unit entered the active state. + +```console +rabe.qemu-ga.uptime +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | FLOAT in uptime | +| History | 7d | +| Source item | `systemd.unit.get["qemu-guest-agent.service"]` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JAVASCRIPT | `["data = JSON.parse(value);\nif (data.ActiveEnterTimestamp > data.ActiveExitTimestamp) {\n return Math.floor(Date.now() / 1000) - Number(data.ActiveEnterTimestamp) / 1000000;\n}\nreturn null;\n"]` | + +### Item: qemu-ga: unit info + +![component: raw](https://img.shields.io/badge/component-raw-00c9bf) ![component: unit](https://img.shields.io/badge/component-unit-00c9bf) + +Get unit info from systemd + +```console +systemd.unit.get["qemu-guest-agent.service"] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | ZABBIX_ACTIVE | +| Value type | TEXT | + +## Triggers + +### Trigger: qemu-ga: Service is not running + +![scope: availability](https://img.shields.io/badge/scope-availability-00c9bf) + + +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | WARNING | +| Manual close | YES | + +```console +last(/qemu-ga active/rabe.qemu-ga.active_state)<>1 +``` + +### Trigger: qemu-ga: No running processes + +![scope: availability](https://img.shields.io/badge/scope-availability-00c9bf) + +No running qemu-ga processes. +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | HIGH | + +```console +last(/qemu-ga active/rabe.qemu-ga.processes)<{$QEMUGA.THRESHOLD.MIN_PROC} +``` + +### Trigger: qemu-ga: has been restarted + +![scope: notice](https://img.shields.io/badge/scope-notice-00c9bf) + + +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | INFO | +| Manual close | YES | + +```console +last(/qemu-ga active/rabe.qemu-ga.uptime)<=10m +``` + +## Macros + +The following Zabbix macros are configured via this template. + +### Macro: `{$QEMUGA.THRESHOLD.MIN_PROC}` + +Minimum amount of processes expected to be running at all times. + +Default: + +```console +1 +``` + +## Dashboards + +The following Zabbix dashboards are included in this template. + +* qemu-ga: Overview + +## License + +This template is free software: you can redistribute it and/or modify it under +the terms of the GNU Affero General Public License as published by the Free +Software Foundation, version 3 of the License. + +## Copyright + +Copyright (c) 2017 - 2024 [Radio Bern RaBe](http://www.rabe.ch) diff --git a/Templates/Applications/qemu-ga_active/7.0/docs/gen_ref_pages.py b/Templates/Applications/qemu-ga_active/7.0/docs/gen_ref_pages.py new file mode 100644 index 00000000..bd02be1b --- /dev/null +++ b/Templates/Applications/qemu-ga_active/7.0/docs/gen_ref_pages.py @@ -0,0 +1,6 @@ +from pathlib import Path + +import mkdocs_gen_files + +with mkdocs_gen_files.open("index.md", "w", encoding="utf-8") as index: + index.writelines(Path("README.md").open("r").read()) diff --git a/Templates/Applications/qemu-ga_active/7.0/mkdocs.yaml b/Templates/Applications/qemu-ga_active/7.0/mkdocs.yaml new file mode 100644 index 00000000..9d234745 --- /dev/null +++ b/Templates/Applications/qemu-ga_active/7.0/mkdocs.yaml @@ -0,0 +1,17 @@ +site_name: "Zabbix Template: QEMU Guest Agent (active)" +repo_url: https://github.com/radiorabe/rabe-zabbix +repo_name: radiorabe/rabe-zabbix +markdown_extensions: + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.inlinehilite + - pymdownx.snippets + - pymdownx.superfences +plugins: + - search + - gen-files: + scripts: + - docs/gen_ref_pages.py + - literate-nav +nav: + - README: index.md diff --git a/Templates/Applications/qemu-ga_active/7.0/qemu-ga_active.yaml b/Templates/Applications/qemu-ga_active/7.0/qemu-ga_active.yaml new file mode 100644 index 00000000..1c0d2c5c --- /dev/null +++ b/Templates/Applications/qemu-ga_active/7.0/qemu-ga_active.yaml @@ -0,0 +1,592 @@ +zabbix_export: + version: '7.0' + template_groups: + - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 + name: Templates/Applications + templates: + - uuid: 77a0624363cd4616a13d1902430ae186 + template: 'qemu-ga active' + name: 'QEMU Guest Agent (active)' + description: | + Monitoring of the [QEMU Guest Agent](https://www.qemu.org/docs/master/interop/qemu-ga.html). + + This template is part of [RaBe's Zabbix template and helpers + collection](https://github.com/radiorabe/rabe-zabbix). + vendor: + name: RaBe + version: '7.0' + groups: + - name: Templates/Applications + items: + - uuid: 479183626b394584a9faf40cda6e86ff + name: 'qemu-ga: process summary' + type: ZABBIX_ACTIVE + key: 'proc.get[qemu-ga,root,,summary]' + history: '0' + value_type: TEXT + trends: '0' + description: 'Get info about qemu-ga processes' + tags: + - tag: component + value: raw + - uuid: 490c3dc19ef844dda08fc71378a65de2 + name: 'qemu-ga: Unit active state' + type: DEPENDENT + key: rabe.qemu-ga.active_state + delay: '0' + history: 7d + description: 'State value that reflects whether the unit is currently active or not. The following states are currently defined: "active", "reloading", "inactive", "failed", "activating", and "deactivating".' + valuemap: + name: 'Unit Active State' + preprocessing: + - type: JSONPATH + parameters: + - $.ActiveState.state + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 30m + master_item: + key: 'systemd.unit.get["qemu-guest-agent.service"]' + tags: + - tag: component + value: service + triggers: + - uuid: 35f0bcdb66a14d9da957bf89f86a5bcd + expression: 'last(/qemu-ga active/rabe.qemu-ga.active_state)<>1' + name: 'qemu-ga: Service is not running' + priority: WARNING + manual_close: 'YES' + tags: + - tag: scope + value: availability + - uuid: 17bd216dfec5463f8ddbc8237bf25fbc + name: 'qemu-ga: CPU seconds (system)' + type: DEPENDENT + key: rabe.qemu-ga.cputime_system + delay: '0' + history: 7d + value_type: FLOAT + description: 'Total CPU seconds (system) of qemu-ga processes.' + preprocessing: + - type: JSONPATH + parameters: + - '$[*].cputime_system.first()' + - type: SIMPLE_CHANGE + parameters: + - '' + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 5m + master_item: + key: 'proc.get[qemu-ga,root,,summary]' + tags: + - tag: component + value: qemu-ga + - uuid: 1def6d220e36452b850cdb00ee088372 + name: 'qemu-ga: CPU seconds (user)' + type: DEPENDENT + key: rabe.qemu-ga.cputime_user + delay: '0' + history: 7d + value_type: FLOAT + description: 'Total CPU seconds (user) of qemu-ga processes.' + preprocessing: + - type: JSONPATH + parameters: + - '$[*].cputime_user.first()' + - type: SIMPLE_CHANGE + parameters: + - '' + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 5m + master_item: + key: 'proc.get[qemu-ga,root,,summary]' + tags: + - tag: component + value: qemu-ga + - uuid: 983e40d9d5f04fd483681421cedae2fe + name: 'qemu-ga: Service load state' + type: DEPENDENT + key: rabe.qemu-ga.load_state + delay: '0' + history: 7d + description: 'State value that reflects whether the configuration file of this unit has been loaded. The following states are currently defined: "loaded", "error", and "masked".' + valuemap: + name: 'Unit Load State' + preprocessing: + - type: JSONPATH + parameters: + - $.LoadState.state + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 30m + master_item: + key: 'systemd.unit.get["qemu-guest-agent.service"]' + tags: + - tag: component + value: service + - uuid: f1dd7d16f45c4fd289cfa085ae1c88b8 + name: 'qemu-ga: Number of processes' + type: DEPENDENT + key: rabe.qemu-ga.processes + delay: '0' + history: 7d + description: 'Number of qemu-ga processes.' + preprocessing: + - type: JSONPATH + parameters: + - '$[*].processes.first()' + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 5m + master_item: + key: 'proc.get[qemu-ga,root,,summary]' + tags: + - tag: component + value: qemu-ga + triggers: + - uuid: aa2a46515f98469482296b49600c44c7 + expression: 'last(/qemu-ga active/rabe.qemu-ga.processes)<{$QEMUGA.THRESHOLD.MIN_PROC}' + name: 'qemu-ga: No running processes' + priority: HIGH + description: 'No running qemu-ga processes.' + dependencies: + - name: 'qemu-ga: Service is not running' + expression: 'last(/qemu-ga active/rabe.qemu-ga.active_state)<>1' + tags: + - tag: scope + value: availability + - uuid: 49bda86d7fa6491e88b9cace94751f34 + name: 'qemu-ga: Memory usage (RSS)' + type: DEPENDENT + key: rabe.qemu-ga.rss + delay: '0' + history: 7d + units: B + description: 'Memory usage of qemu-ga processes.' + preprocessing: + - type: JSONPATH + parameters: + - '$[*].rss.first()' + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 5m + master_item: + key: 'proc.get[qemu-ga,root,,summary]' + tags: + - tag: component + value: qemu-ga + - uuid: 850a82a7000d44509b709951fe00ac98 + name: 'qemu-ga: Swap usage' + type: DEPENDENT + key: rabe.qemu-ga.swap + delay: '0' + history: 7d + units: B + description: 'Swap usage of qemu-ga processes.' + preprocessing: + - type: JSONPATH + parameters: + - '$[*].swap.first()' + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 5m + master_item: + key: 'proc.get[qemu-ga,root,,summary]' + tags: + - tag: component + value: qemu-ga + - uuid: b799e7ba76b2442ba0b296c51f7517a4 + name: 'qemu-ga: Number of threads' + type: DEPENDENT + key: rabe.qemu-ga.threads + delay: '0' + history: 7d + description: 'Number of qemu-ga threads.' + preprocessing: + - type: JSONPATH + parameters: + - '$[*].threads.first()' + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 5m + master_item: + key: 'proc.get[qemu-ga,root,,summary]' + tags: + - tag: component + value: qemu-ga + - uuid: dc3d8fd54e7b44d4951f276f1703496d + name: 'qemu-ga: Unit file state' + type: DEPENDENT + key: rabe.qemu-ga.unitfile_state + delay: '0' + history: 7d + description: 'Encodes the install state of the unit file of FragmentPath. It currently knows the following states: "enabled", "enabled-runtime", "linked", "linked-runtime", "masked", "masked-runtime", "static", "disabled", and "invalid".' + valuemap: + name: 'Unit File State' + preprocessing: + - type: JSONPATH + parameters: + - $.UnitFileState.state + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 30m + master_item: + key: 'systemd.unit.get["qemu-guest-agent.service"]' + tags: + - tag: component + value: service + - uuid: b44b4dda6f254b19879ce854b29f5f12 + name: 'qemu-ga: Uptime' + type: DEPENDENT + key: rabe.qemu-ga.uptime + delay: '0' + history: 7d + value_type: FLOAT + units: uptime + description: 'Number of seconds since unit entered the active state.' + preprocessing: + - type: JAVASCRIPT + parameters: + - | + data = JSON.parse(value); + if (data.ActiveEnterTimestamp > data.ActiveExitTimestamp) { + return Math.floor(Date.now() / 1000) - Number(data.ActiveEnterTimestamp) / 1000000; + } + return null; + master_item: + key: 'systemd.unit.get["qemu-guest-agent.service"]' + tags: + - tag: component + value: service + triggers: + - uuid: d2e99905e5e04957a2953ef7f71081f7 + expression: 'last(/qemu-ga active/rabe.qemu-ga.uptime)<=10m' + name: 'qemu-ga: has been restarted' + priority: INFO + manual_close: 'YES' + tags: + - tag: scope + value: notice + - uuid: 609efd8900794691a7ace4002d1c78ae + name: 'qemu-ga: unit info' + type: ZABBIX_ACTIVE + key: 'systemd.unit.get["qemu-guest-agent.service"]' + history: '0' + value_type: TEXT + trends: '0' + description: 'Get unit info from systemd' + tags: + - tag: component + value: raw + - tag: component + value: unit + tags: + - tag: class + value: software + - tag: target + value: qemu-ga + macros: + - macro: '{$QEMUGA.THRESHOLD.MIN_PROC}' + value: '1' + description: 'Minimum amount of processes expected to be running at all times.' + dashboards: + - uuid: 910162aa19a04fd9b91f491190ab4c74 + name: 'qemu-ga: Overview' + pages: + - widgets: + - type: item + width: '24' + height: '4' + hide_header: 'YES' + fields: + - type: STRING + name: description + value: 'active state' + - type: ITEM + name: itemid + value: + host: 'qemu-ga active' + key: rabe.qemu-ga.active_state + - type: INTEGER + name: show + value: '1' + - type: INTEGER + name: show + value: '2' + - type: STRING + name: thresholds.0.color + value: 4CAF50 + - type: STRING + name: thresholds.0.threshold + value: '1' + - type: STRING + name: thresholds.1.color + value: FF0000 + - type: STRING + name: thresholds.1.threshold + value: '2' + - type: STRING + name: thresholds.2.color + value: FF0000 + - type: STRING + name: thresholds.2.threshold + value: '3' + - type: INTEGER + name: units_bold + value: '0' + - type: INTEGER + name: units_show + value: '0' + - type: graph + 'y': '4' + width: '36' + height: '5' + fields: + - type: ITEM + name: itemid + value: + host: 'qemu-ga active' + key: rabe.qemu-ga.cputime_user + - type: STRING + name: reference + value: AABJX + - type: INTEGER + name: source_type + value: '1' + - type: graph + 'y': '9' + width: '36' + height: '5' + fields: + - type: ITEM + name: itemid + value: + host: 'qemu-ga active' + key: rabe.qemu-ga.rss + - type: STRING + name: reference + value: AABJY + - type: INTEGER + name: source_type + value: '1' + - type: item + x: '24' + width: '18' + height: '4' + hide_header: 'YES' + fields: + - type: STRING + name: description + value: uptime + - type: ITEM + name: itemid + value: + host: 'qemu-ga active' + key: rabe.qemu-ga.uptime + - type: INTEGER + name: show + value: '1' + - type: INTEGER + name: show + value: '2' + - type: INTEGER + name: value_size + value: '15' + - type: graph + x: '36' + 'y': '4' + width: '36' + height: '5' + fields: + - type: ITEM + name: itemid + value: + host: 'qemu-ga active' + key: rabe.qemu-ga.cputime_system + - type: STRING + name: reference + value: AABJZ + - type: INTEGER + name: source_type + value: '1' + - type: graph + x: '36' + 'y': '9' + width: '36' + height: '5' + fields: + - type: ITEM + name: itemid + value: + host: 'qemu-ga active' + key: rabe.qemu-ga.swap + - type: STRING + name: reference + value: AABKA + - type: INTEGER + name: source_type + value: '1' + - type: item + x: '42' + width: '12' + hide_header: 'YES' + fields: + - type: STRING + name: description + value: 'unit file state' + - type: ITEM + name: itemid + value: + host: 'qemu-ga active' + key: rabe.qemu-ga.unitfile_state + - type: INTEGER + name: show + value: '1' + - type: INTEGER + name: show + value: '2' + - type: STRING + name: thresholds.0.color + value: FF0000 + - type: STRING + name: thresholds.0.threshold + value: '0' + - type: STRING + name: thresholds.1.color + value: 4CAF50 + - type: STRING + name: thresholds.1.threshold + value: '1' + - type: STRING + name: thresholds.2.color + value: FF0000 + - type: STRING + name: thresholds.2.threshold + value: '2' + - type: item + x: '42' + 'y': '2' + width: '12' + hide_header: 'YES' + fields: + - type: STRING + name: description + value: 'service load state' + - type: ITEM + name: itemid + value: + host: 'qemu-ga active' + key: rabe.qemu-ga.load_state + - type: INTEGER + name: show + value: '1' + - type: INTEGER + name: show + value: '2' + - type: STRING + name: thresholds.0.color + value: FF0000 + - type: STRING + name: thresholds.0.threshold + value: '0' + - type: STRING + name: thresholds.1.color + value: 4CAF50 + - type: STRING + name: thresholds.1.threshold + value: '1' + - type: STRING + name: thresholds.2.color + value: FF0000 + - type: STRING + name: thresholds.2.threshold + value: '2' + - type: item + x: '60' + width: '12' + height: '4' + hide_header: 'YES' + fields: + - type: INTEGER + name: decimal_places + value: '0' + - type: STRING + name: description + value: processes + - type: ITEM + name: itemid + value: + host: 'qemu-ga active' + key: rabe.qemu-ga.processes + - type: INTEGER + name: show + value: '1' + - type: INTEGER + name: show + value: '2' + - type: STRING + name: thresholds.0.color + value: FF0000 + - type: STRING + name: thresholds.0.threshold + value: '0' + - type: STRING + name: thresholds.1.color + value: 4CAF50 + - type: STRING + name: thresholds.1.threshold + value: '1' + valuemaps: + - uuid: 3379206daed14761a2104f5bda46651f + name: 'Unit Active State' + mappings: + - value: '0' + newvalue: unknown + - value: '1' + newvalue: active + - value: '2' + newvalue: reloading + - value: '3' + newvalue: inactive + - value: '4' + newvalue: failed + - value: '5' + newvalue: activating + - value: '6' + newvalue: deactivating + - uuid: ed6125e7aadc47b1bd6c5a5133fcb676 + name: 'Unit File State' + mappings: + - value: o + newvalue: unknown + - value: '1' + newvalue: enabled + - value: '2' + newvalue: enabled-runtime + - value: '3' + newvalue: linked + - value: '4' + newvalue: linked-runtime + - value: '5' + newvalue: masked + - value: '6' + newvalue: masked-runtime + - value: '7' + newvalue: static + - value: '8' + newvalue: disabled + - value: '9' + newvalue: runtime + - uuid: 35810908d92e41b2b760d0c38c887ceb + name: 'Unit Load State' + mappings: + - value: '0' + newvalue: unknown + - value: '1' + newvalue: loaded + - value: '2' + newvalue: error + - value: '3' + newvalue: masked diff --git a/catalog-info.yaml b/catalog-info.yaml index c995c0e7..3b775451 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -540,6 +540,33 @@ spec: system: rabe-zabbix subcomponentOf: rabe-zabbix-templates --- +# Templates/Applications/qemu-ga_active/7.0/qemu-ga_active.yaml +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + name: zabbix-template-qemu-ga_active + title: "Zabbix Template: QEMU Guest Agent (active)" + description: | + Monitoring of the [QEMU Guest Agent](https://www.qemu.org/docs/master/interop/qemu-ga.html). + + This template is part of [RaBe's Zabbix template and helpers + collection](https://github.com/radiorabe/rabe-zabbix). + + annotations: + backstage.io/techdocs-ref: dir:./Templates/Applications/qemu-ga_active/7.0 + github.com/project-slug: radiorabe/rabe-zabbix + links: + - url: https://github.com/radiorabe/rabe-zabbix/tree/develop/Templates/Applications/qemu-ga_active/7.0 + title: GitHub + icon: github + tags: [software, qemu-ga] +spec: + type: zabbix-template + lifecycle: experimental + owner: it-reaktion + system: rabe-zabbix + subcomponentOf: rabe-zabbix-templates +--- # Templates/Applications/rpc.gssd/7.0/rpc.gssd.yaml apiVersion: backstage.io/v1alpha1 kind: Component diff --git a/hack/plays/manage.yml b/hack/plays/manage.yml index e10ec182..f2a2b5c3 100644 --- a/hack/plays/manage.yml +++ b/hack/plays/manage.yml @@ -23,6 +23,7 @@ - template_name: "Netgear GS by SNMP" - template_name: "Nginx with TLS by HTTP Stack" - template_name: "qemu-ga" + - template_name: "qemu-ga active" - template_name: "rsyslog" - template_name: "rpc.gssd" - template_name: "Songticker"