mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-13 15:43:02 +00:00
telegraf (#7576)
This commit is contained in:
parent
a4660adedd
commit
164e487090
6
ct/headers/telegraf
Normal file
6
ct/headers/telegraf
Normal file
@ -0,0 +1,6 @@
|
||||
__ __ ____
|
||||
/ /____ / /__ ____ __________ _/ __/
|
||||
/ __/ _ \/ / _ \/ __ `/ ___/ __ `/ /_
|
||||
/ /_/ __/ / __/ /_/ / / / /_/ / __/
|
||||
\__/\___/_/\___/\__, /_/ \__,_/_/
|
||||
/____/
|
52
ct/telegraf.sh
Normal file
52
ct/telegraf.sh
Normal file
@ -0,0 +1,52 @@
|
||||
#!/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}"
|
40
frontend/public/json/telegraf.json
Normal file
40
frontend/public/json/telegraf.json
Normal 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/telegraf.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": "Make sure to configure an output for the telegraf config and start the service with `systemctl start telegraf`.",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
39
install/telegraf-install.sh
Normal file
39
install/telegraf-install.sh
Normal 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 -fsSL -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 -y
|
||||
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"
|
Loading…
x
Reference in New Issue
Block a user