From 3694dfb12167aea145c3699f198cb0d2b673bdeb Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:30:00 +0000 Subject: [PATCH] 'Add new script' --- ct/headers/telegraf | 6 ++++ ct/telegraf.sh | 53 ++++++++++++++++++++++++++++++ frontend/public/json/telegraf.json | 40 ++++++++++++++++++++++ install/telegraf-install.sh | 39 ++++++++++++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 ct/headers/telegraf create mode 100644 ct/telegraf.sh create mode 100644 frontend/public/json/telegraf.json create mode 100644 install/telegraf-install.sh diff --git a/ct/headers/telegraf b/ct/headers/telegraf new file mode 100644 index 000000000..14c860970 --- /dev/null +++ b/ct/headers/telegraf @@ -0,0 +1,6 @@ + __ __ ____ + / /____ / /__ ____ __________ _/ __/ + / __/ _ \/ / _ \/ __ `/ ___/ __ `/ /_ +/ /_/ __/ / __/ /_/ / / / /_/ / __/ +\__/\___/_/\___/\__, /_/ \__,_/_/ + /____/ diff --git a/ct/telegraf.sh b/ct/telegraf.sh new file mode 100644 index 000000000..36b533b86 --- /dev/null +++ b/ct/telegraf.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: CrazyWolf13 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/influxdata/telegraf + +APP="telegraf" +var_tags="${var_tags:-collector;metrics}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-4}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -f /etc/telegraf/telegraf.conf ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + msg_info "Stopping $APP" + systemctl stop telegraf + msg_ok "Stopped $APP" + + msg_info "Updating $APP" + $STD apt-get update + $STD apt-get upgrade telegraf -y + msg_ok "Updated $APP" + + msg_info "Starting $APP" + systemctl start telegraf + msg_ok "Started $APP" + msg_ok "Updated Successfully" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Check out /etc/telegraf/telegraf.conf to configure telegraf${CL}" diff --git a/frontend/public/json/telegraf.json b/frontend/public/json/telegraf.json new file mode 100644 index 000000000..775371da4 --- /dev/null +++ b/frontend/public/json/telegraf.json @@ -0,0 +1,40 @@ +{ + "name": "Telegraf", + "slug": "telegraf", + "categories": [ + 9 + ], + "date_created": "2025-09-11", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": null, + "documentation": "https://docs.influxdata.com/telegraf/v1/", + "config_path": "/etc/telegraf/telegraf.conf", + "website": "https://github.com/influxdata/telegraf", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/influxdb.webp", + "description": "Telegraf collects and sends time series data from databases, systems, and IoT sensors. It has no external dependencies, is easy to install, and requires minimal memory.", + "install_methods": [ + { + "type": "default", + "script": "ct/telegraf.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 4, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "Check out the config afterwards and adapt to your needs.", + "type": "info" + } + ] +} diff --git a/install/telegraf-install.sh b/install/telegraf-install.sh new file mode 100644 index 000000000..a92ffe9b0 --- /dev/null +++ b/install/telegraf-install.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: CrazyWolf13 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/influxdata/telegraf + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Adding Telegraf key and repository" +curl --silent --location -O https://repos.influxdata.com/influxdata-archive.key +gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 \ +| grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' \ +&& cat influxdata-archive.key \ +| gpg --dearmor \ +| tee /etc/apt/keyrings/influxdata-archive.gpg > /dev/null \ +&& echo 'deb [signed-by=/etc/apt/keyrings/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' \ +| tee /etc/apt/sources.list.d/influxdata.list > /dev/null +msg_ok "Added Telegraf Repository" + +msg_info "Installing Telegraf" +$STD apt-get update +$STD apt-get install telegraf +msg_ok "Installed Telegraf" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +rm /influxdata-archive.key +msg_ok "Cleaned"