Skip to content

Commit 164e487

Browse files
telegraf (#7576)
1 parent a4660ad commit 164e487

File tree

4 files changed

+137
-0
lines changed

4 files changed

+137
-0
lines changed

ct/headers/telegraf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
__ __ ____
2+
/ /____ / /__ ____ __________ _/ __/
3+
/ __/ _ \/ / _ \/ __ `/ ___/ __ `/ /_
4+
/ /_/ __/ / __/ /_/ / / / /_/ / __/
5+
\__/\___/_/\___/\__, /_/ \__,_/_/
6+
/____/

ct/telegraf.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: CrazyWolf13
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/influxdata/telegraf
7+
8+
APP="telegraf"
9+
var_tags="${var_tags:-collector;metrics}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-1024}"
12+
var_disk="${var_disk:-4}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -f /etc/telegraf/telegraf.conf ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
31+
msg_info "Stopping $APP"
32+
systemctl stop telegraf
33+
msg_ok "Stopped $APP"
34+
35+
msg_info "Updating $APP"
36+
$STD apt-get update
37+
$STD apt-get upgrade telegraf -y
38+
msg_ok "Updated $APP"
39+
40+
msg_info "Starting $APP"
41+
systemctl start telegraf
42+
msg_ok "Started $APP"
43+
msg_ok "Updated Successfully"
44+
exit
45+
}
46+
47+
start
48+
build_container
49+
description
50+
51+
msg_ok "Completed Successfully!\n"
52+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"

frontend/public/json/telegraf.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Telegraf",
3+
"slug": "telegraf",
4+
"categories": [
5+
9
6+
],
7+
"date_created": "2025-09-11",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": null,
12+
"documentation": "https://docs.influxdata.com/telegraf/v1/",
13+
"config_path": "/etc/telegraf/telegraf.conf",
14+
"website": "https://github.com/influxdata/telegraf",
15+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/telegraf.webp",
16+
"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.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/telegraf.sh",
21+
"resources": {
22+
"cpu": 1,
23+
"ram": 1024,
24+
"hdd": 4,
25+
"os": "Debian",
26+
"version": "12"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": [
35+
{
36+
"text": "Make sure to configure an output for the telegraf config and start the service with `systemctl start telegraf`.",
37+
"type": "info"
38+
}
39+
]
40+
}

install/telegraf-install.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: CrazyWolf13
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/influxdata/telegraf
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Adding Telegraf key and repository"
17+
curl -fsSL -O https://repos.influxdata.com/influxdata-archive.key
18+
gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 \
19+
| grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' \
20+
&& cat influxdata-archive.key \
21+
| gpg --dearmor \
22+
| tee /etc/apt/keyrings/influxdata-archive.gpg > /dev/null \
23+
&& echo 'deb [signed-by=/etc/apt/keyrings/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' \
24+
| tee /etc/apt/sources.list.d/influxdata.list > /dev/null
25+
msg_ok "Added Telegraf Repository"
26+
27+
msg_info "Installing Telegraf"
28+
$STD apt-get update
29+
$STD apt-get install telegraf -y
30+
msg_ok "Installed Telegraf"
31+
32+
motd_ssh
33+
customize
34+
35+
msg_info "Cleaning up"
36+
$STD apt-get -y autoremove
37+
$STD apt-get -y autoclean
38+
rm /influxdata-archive.key
39+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)