'Add new script'

This commit is contained in:
push-app-to-main[bot] 2025-09-11 14:30:00 +00:00
parent 4478f8f6e0
commit 3694dfb121
4 changed files with 138 additions and 0 deletions

6
ct/headers/telegraf Normal file
View File

@ -0,0 +1,6 @@
__ __ ____
/ /____ / /__ ____ __________ _/ __/
/ __/ _ \/ / _ \/ __ `/ ___/ __ `/ /_
/ /_/ __/ / __/ /_/ / / / /_/ / __/
\__/\___/_/\___/\__, /_/ \__,_/_/
/____/

53
ct/telegraf.sh Normal file
View File

@ -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}"

View File

@ -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"
}
]
}

View File

@ -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"