From c3b5196b246d815fe169d81e58b3bf1939676477 Mon Sep 17 00:00:00 2001 From: Pavel Muhortov Date: Thu, 14 Dec 2023 22:18:11 +0300 Subject: [PATCH] added ds18b20 template --- README.md | 2 + templates/sensors/ds18b20/6.0/README.md | 45 ++++++++++++++ .../ds18b20/6.0/sensors-ds18b20-by-ssh.yaml | 61 +++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100755 templates/sensors/ds18b20/6.0/README.md create mode 100755 templates/sensors/ds18b20/6.0/sensors-ds18b20-by-ssh.yaml diff --git a/README.md b/README.md index c0a1a4a..449f900 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ Templates, scripts and hints for Zabbix. * [Wireguard](templates/applications/vpn/wireguard/6.0) * [Components](templates/components) * [certificate](templates/components/certificate/6.0) +* [Sensors](templates/sensors) + * [ds18b20](templates/sensors/ds18b20/6.0) ## Useful links diff --git a/templates/sensors/ds18b20/6.0/README.md b/templates/sensors/ds18b20/6.0/README.md new file mode 100755 index 0000000..54cf3ae --- /dev/null +++ b/templates/sensors/ds18b20/6.0/README.md @@ -0,0 +1,45 @@ + +# Sensors ds18b20 by SSH + +## Overview + +This template is designed for [ds18b20](https://www.analog.com/media/en/technical-documentation/data-sheets/ds18b20.pdf) sensor monitoring by Zabbix and requires external script. + +## Requirements + +- Zabbix version: 6.0 and higher. +- [ds18b20-over-ssh.sh](https://git.hmp.today/pavel.muhortov/utils#ds18b20-over-ssh-sh) + +## Tested versions + +This template has been tested on: + +- sshpass 1.0.9 + +### Macros used + +|Name|Description|Default| +|----|-----------|-------| +|{$HOST}|ssh host|`host.domain.zone`| +|{$PORT}|ssh port|`22`| +|{$USER}|ssh username|`root`| +|{$PASS}|ssh password|`password`| +|{$NODE}|ds18b20 node|`28-0a1b2c3d4e5f`| + +### Items + +|Name|Description|Type|Key and additional info| +|----|-----------|----|-----------------------| +|Temperature|ds18b20 sensor value|External check|ds18b20-over-ssh.sh["{$HOST}","{$PORT}","{$USER}","{$PASS}","{$NODE}"]| + +### Triggers + +There are no triggers in this template. + +### Discovery rules + +There are no discovery rules in this template. + +### Item prototypes for Clients discovery + +There are no item prototypes in this template. diff --git a/templates/sensors/ds18b20/6.0/sensors-ds18b20-by-ssh.yaml b/templates/sensors/ds18b20/6.0/sensors-ds18b20-by-ssh.yaml new file mode 100755 index 0000000..fe0daaf --- /dev/null +++ b/templates/sensors/ds18b20/6.0/sensors-ds18b20-by-ssh.yaml @@ -0,0 +1,61 @@ +zabbix_export: + version: '6.0' + date: '2023-12-14T18:00:00Z' + groups: + - + uuid: 57b7ae836ca64446ba2c296389c009b7 + name: Templates/Modules + templates: + - + uuid: 319aac2db295472bbf0e9e7acd7bd090 + template: 'Sensors ds18b20 by SSH' + name: 'Sensors ds18b20 by SSH' + description: 'Get ds18b20 sensor value over SSH' + groups: + - + name: Templates/Modules + items: + - + uuid: 3b2158a480c048689f709bfd457b0464 + name: Temperature + type: EXTERNAL + key: 'ds18b20-over-ssh.sh["{$HOST}","{$PORT}","{$USER}","{$PASS}","{$NODE}"]' + delay: 5m + value_type: FLOAT + units: C + tags: + - + tag: Sensor + value: ds18b20 + tags: + - + tag: Sensor + value: ds18b20 + macros: + - + macro: '{$HOST}' + value: host.domain.zone + - + macro: '{$NODE}' + value: 28-0a1b2c3d4e5f + - + macro: '{$PASS}' + value: password + - + macro: '{$PORT}' + value: '22' + - + macro: '{$USER}' + value: root + graphs: + - + uuid: 8160100b5a1f4a5280415ce427db71e5 + name: Temperature + show_triggers: 'NO' + graph_items: + - + drawtype: GRADIENT_LINE + color: 00BFFF + item: + host: 'Sensors ds18b20 by SSH' + key: 'ds18b20-over-ssh.sh["{$HOST}","{$PORT}","{$USER}","{$PASS}","{$NODE}"]'