From 5ff3a2457e7b6b45398a0ffa38877139e5733b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franc=CC=A7ois=20Bonelle?= Date: Sun, 23 Jan 2022 09:06:19 +0100 Subject: [PATCH] first commit --- repository.json | 5 ++ telegraf/CHANGELOG.md | 72 ++++++++++++++++ telegraf/README.md | 186 ++++++++++++++++++++++++++++++++++++++++++ telegraf/config.json | 140 +++++++++++++++++++++++++++++++ telegraf/icon.png | Bin 0 -> 5858 bytes 5 files changed, 403 insertions(+) create mode 100644 repository.json create mode 100644 telegraf/CHANGELOG.md create mode 100644 telegraf/README.md create mode 100755 telegraf/config.json create mode 100644 telegraf/icon.png diff --git a/repository.json b/repository.json new file mode 100644 index 0000000..bc5cba0 --- /dev/null +++ b/repository.json @@ -0,0 +1,5 @@ +{ + "name" : "Francois's repo", + "url" : "https://gitea.bonelle-family.dscloud.biz/francois.bonelle/hassio-repo.git", + "maintainer" : "Francois Bonellee " +} diff --git a/telegraf/CHANGELOG.md b/telegraf/CHANGELOG.md new file mode 100644 index 0000000..a059058 --- /dev/null +++ b/telegraf/CHANGELOG.md @@ -0,0 +1,72 @@ +# All Changes will be posted here + +## 0.6.0 - 17/06/2021 +* Update and fix that happened in 0.5.7 +* Changed to a s6 container - specifically homeassistant community addons base + +## 0.5.6 - 18/01/2021 +* Enable prometheus exporter output for telegraf (#32) @fliphess +* Update telegraf to 1.17.0 (#31) @fliphess +* Version skipped because of ocnfig mess up + +## 0.5.4 - 23/02/2020 +- forgot to update ver in config + +## 0.5.3 - 23/02/2020 +- chore: update custom config to copy instead of moving +-[See full Changelog](https://github.com/Sabuto/hassio-telegraf/releases/tag/0.5.3) + +## 0.5.2 - 20/02/2020 +- feature: added thhe ability to use a custom config. +-[See full Changelog](https://github.com/Sabuto/hassio-telegraf/releases/tag/0.5.2) + +## 0.5.1 - 11/02/2020 +- feature: add support for scrapping thermal subsystem +- enhancement: install smartmontools from backports repository +-[See full Changelog](https://github.com/Sabuto/hassio-telegraf/releases/tag/0.5.1) + +## 0.5.0 - 05/02/2020 +- chore: Updated the config +- chore: move to GitHub workflow (#19) @Sabuto +- feature: added support for influxDBv2 (#18) @Sabuto +- [See full Changelog](https://github.com/Sabuto/hassio-telegraf/releases/tag/0.5.0) + +## 0.4.3 - 20/11/2019 +- Updated bug with ipmi sensors +- made username, password and retention_policy optional as requested +- [See full changelog](https://github.com/Sabuto/hassio-telegraf/releases/tag/0.4.3) + +## 0.4.2 - 13/11/2019 +- Added ipmi to the config as requested in the forums +- [See full changelog](https://github.com/Sabuto/hassio-telegraf/releases/tag/0.4.2) + +## 0.4.1 - 08/11/2019 +- Added more config variables +- [See full changelog](https://github.com/Sabuto/hassio-telegraf/releases/tag/0.4.1) + +## 0.4.0 - 06/11/2019 +-Changed Dockerfile to ubuntu to fix not installing on different Arch's + +## 0.3.1 - 04/11/2019 +- Replaces hdd_temp for smart monitoring + +## 0.3.0 - 03/11/2019 +- Bumped telegraf Version to 1.12.4 (why it is 0.3.0 release) +- added support for hdd_temp +- changed formatting of config.json (also why 0.3.0) + +## 0.2.20 - 02/11/2019 +- Updated base images +- Fixed breaks + +## 0.2.18 - 29/10/2019 +- Added defualt sensors measurements (temperatures) + +## 0.2.17 - 29/10/2019 +- Added todo +- Added changelog +- Added request template +- Fixed type (#1) + +## 0.2.16 - 28/10/2019 +- Initial release after local dev diff --git a/telegraf/README.md b/telegraf/README.md new file mode 100644 index 0000000..525ce3a --- /dev/null +++ b/telegraf/README.md @@ -0,0 +1,186 @@ +# Telegraf Plugin for Hassio + +[![GitHub Release][releases-shield]][releases] +[![License][license-shield]](LICENSE.md) + +![Supports aarch64 Architecture][aarch64-shield] +![Supports amd64 Architecture][amd64-shield] +![Supports armhf Architecture][armhf-shield] +![Supports armv7 Architecture][armv7-shield] +![Supports i386 Architecture][i386-shield] + +![Travis Ci][travis-shield] +[![Github Activity][commits-shield]][commits] + +# Please Note! +Upgrading to 0.5.0 although isn't nessaserily a breaking change, hte config has been adjusted and how it is interprited so please make sure you update the config too! + +# Notable mentions + +I wanted to mention people/repos that i have borrowed code from to make this work and also who have helped me make this work. + +First I wanted to say thanks to [@pvizeli](https://github.com/pvizeli). He helped me with regard to building the image. and just the general work he does on a daily basis + +Second I want to say thanks to [@Frenck](https://github.com/frenck). He has helped me a lot on Discord getting this addon working when i was running into errors. His addon for influx db helped me migrate this from Alpine to ubuntu also. + +Third I want to say thanks to [@Daniel Welch](https://github.com/danielwelch). I looked at his script for travis builds, he did a write up [here](https://danielwelch.github.io/hassio-dev-env.html) that helped me form a basis of my script. + +All of these people are amazing! + +# Description + +This is a very simple hassio plugin that ebnables you to run telegraf on your hassio system, I am still working on this so please bear with me, I am happy to accept PR's + +# Installation + +To Install this addon simply go to: Hassio->Addon-store. + +Then add https://github.com/Sabuto/hassio-repo in the add repository by URL box. + +Scroll down to Rob's Repo and install Telegraf. Give it a few minutes to install and update. + +# Config + +The config is simple but there are some things to consider, + +```yaml +custom_conf: + enabled: false + location: /share/telegraf.conf +``` + +This allows you to specify a custom configuration file so you can add things for yourself if this addon doesn't currently support it. Please note this must be a full telegraf config file not just parts. + +```yaml +hostname: '' +``` +This allows you set your hostname to something easy + +You must have a running influxDB instance (the hassio plugin works) + +```yaml +influxDB: + enabled: true, + url: 'http://a0d7b954-influxdb:8086' + db: telegraf + retention_policy: optional + username: optional + password: optional +``` +This has been moved into it's own block as that made sense with the other options, some have been made optional (previous versions) + + +```yaml +kernel: + enabled: true +``` + +This monitors the kernel + +```yaml +swap: + enabled: true +``` + +This monitors the swap usasge + +```yaml +docker: + enabled: false + timeout: 5s +``` + +This monitors the docker containers + +```yaml +smart_monitor: + enabled: false + timeout: 30s +``` + +This allows you to monitor the temperature of the hard drives + +```yaml +impi_sensor: + enabled: false + interval: 30s + timeout: 20s + server_user_id: user + server_password: password + server_protocol: lan + server_ip: 192.168.1.2 +``` + +This allows you to enable the impi settings. + +```yaml +influxDBv2: + enabled: false + url: 'http://127.0.0.1:9999' + organization: '' + token: '' + bucket: '' +``` + +This allows you to use InfluxDBv2 if you have an instance running. + +```yaml +prometheus: + enabled: false + metrics_path: '/metrics' +``` +This allows you to use the promethus output + +# Known issues + +~~For some reason at the moment i have figured out how to communicate with the docker.sock therefore i cannot get the process' for docker contaisners. I will look into this and fix it when i can, if you have any idea please submit a PR~~ + +# TO-DO + +~~Add dev branch~~ + +Add images to installation steps + +~~Add PR Template~~ + +~~Add Issue Template~~ + +Configure more options to edit for the inputs + +Configure different outputs (so it doesn't have to be influxDB dependant, would appreciate it if people could reccomend ones they would find useful.) + +## License + +MIT License + +Copyright (c) 2019 Robert Dunne + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg +[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg +[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg +[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg +[i386-shield]: https://img.shields.io/badge/i386-yes-green.svg +[commits-shield]: https://img.shields.io/github/commit-activity/y/sabuto/hassio-telegraf?style=plastic +[commits]: https://github.com/sabuto/hassio-telegraf/commits/master +[travis-shield]: https://img.shields.io/travis/sabuto/hassio-telegraf +[releases-shield]: https://img.shields.io/github/v/release/sabuto/hassio-telegraf +[releases]: https://github.com/sabuto/hassio-telegraf/releases +[license-shield]: https://img.shields.io/github/license/sabuto/hassio-telegraf diff --git a/telegraf/config.json b/telegraf/config.json new file mode 100755 index 0000000..93a3c50 --- /dev/null +++ b/telegraf/config.json @@ -0,0 +1,140 @@ +{ + "name": "Telegraf", + "version": "0.6.0", + "slug": "hassio_telegraf", + "description": "An addon to add telegraf to hassio.", + "url": "https://gitea.bonelle-family.dscloud.biz/francois.bonelle/hassio-telegraf.git", + "arch": [ + "armhf", + "armv7", + "aarch64", + "amd64", + "i386" + ], + "init": false, + "startup": "services", + "boot": "manual", + "hassio_api": true, + "hassio_role": "default", + "auth_api": true, + "docker_api": true, + "host_network": true, + "host_pid": true, + "apparmor": false, + "map": [ + "config:rw", + "ssl:rw", + "addons:rw", + "backup:rw", + "share:rw" + ], + "privileged": [ + "SYS_ADMIN" + ], + "full_access": true, + "options": { + "custom_conf": { + "enabled": false, + "location": "/share/telegraf.conf" + }, + "hostname": "test", + "influxDB": { + "enabled": true, + "url": "http://a0d7b954-influxdb:8086", + "db": "telegraf" + }, + "kernel": { + "enabled": true + }, + "swap": { + "enabled": true + }, + "docker": { + "enabled": false, + "timeout": "5s" + }, + "thermal": { + "enabled": false + }, + "smart_monitor": { + "enabled": false, + "timeout": "30s" + }, + "ipmi_sensor": { + "enabled": false, + "interval": "30s", + "timeout": "20s", + "server_user_id": "user", + "server_password": "password", + "server_protocol": "lan", + "server_ip": "192.168.1.2" + }, + "influxDBv2": { + "enabled": false, + "url": "http://127.0.0.1:9999", + "organization": "", + "token": "", + "bucket": "" + }, + "prometheus": { + "enabled": false, + "metrics_path": "/metrics" + } + }, + "schema": { + "custom_conf": { + "enabled": "bool", + "location": "str" + }, + "hostname": "str", + "influxDB": { + "enabled": "bool", + "url": "str", + "db": "str", + "retention_policy": "str?", + "username": "str?", + "password": "str?" + }, + "kernel": { + "enabled": "bool" + }, + "swap": { + "enabled": "bool" + }, + "docker": { + "enabled": "bool", + "timeout": "str" + }, + "thermal": { + "enabled": "bool" + }, + "smart_monitor": { + "enabled": "bool", + "timeout": "str" + }, + "ipmi_sensor": { + "enabled": "bool", + "interval": "str", + "timeout": "str", + "server_user_id": "str", + "server_password": "str", + "server_protocol": "str", + "server_ip": "str" + }, + "influxDBv2": { + "enabled": "bool", + "url": "str", + "organization": "str", + "token": "str", + "bucket": "str" + }, + "prometheus": { + "enabled": "bool", + "metrics_path": "str" + } + }, + "ports": { + "9273/tcp": 9273 + }, + "image" : "sabuto/{arch}-hassio-telegraf" +} diff --git a/telegraf/icon.png b/telegraf/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..5461afd2babe2268d442ff1904a3a191ed73fe4c GIT binary patch literal 5858 zcma)AX*iVM-?y*Xx3WhFA!TW%Fk@#z_GpYOr7V$|vhP2kWQ$}U%Vf()*0Gg-mL%L0 zH8hDd&D@fZL5=M{p8vb&#dAF`&V830Jnp)u(V|J@A_~u*SulY9%vR8!G8}2>quyw zKMRXwgpE1eB@(q#HrJ|Z5jV2;ukTu_%aGzTH{9uVs;b6<9qe*wRh>Jlp8Hojc&gX& zs#n^BClOUa8qe!Rog@m8bvPv{U0eZJ9yc*-Xpr$O_PWFB)>LiG_3j;#kWzj5H!NTD2Mrf^vuCOX=-PORvoBDh0qfpmDnV~>txHC=^SJ_z zZk7Kh(=TB1VCSGXVVC%wIw+*0pS?epN)0mUn%P}02{jDer5*fAu=-Hy0w=Xa{Ed(U z6b={!YWDtCr+va2BH;WV)|Y|u4cJxw8>};2TRA4%LNRmTBsZ?%qAPGk7fNOk)CJJ4 ze>SNH+X*qQyq@}C=BtDa2U^oB+b2AOX?0Y_QoARRR7xaq-O$*mY#_u-H;K~K6%EJd z11xH(j0>J}pbG33Bz*0m_29-D&NZ=N6otH$CvVDt-6lILebmVDO}OU;@YKpUYxo5Y zX#8sbD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