Skip to content

Commit 409358a

Browse files
authored
Alpine Prometheus LXC (#3547)
1 parent 4f6942b commit 409358a

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

ct/alpine-prometheus.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://prometheus.io/
7+
8+
APP="Alpine-Prometheus"
9+
var_tags="${var_tags:-alpine;monitoring}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-256}"
12+
var_disk="${var_disk:-1}"
13+
var_os="${var_os:-alpine}"
14+
var_version="${var_version:-3.21}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
msg_info "Updating Alpine Packages"
24+
$STD apk update
25+
$STD apk upgrade
26+
msg_ok "Updated Alpine Packages"
27+
28+
msg_info "Updating Prometheus"
29+
$STD apk upgrade prometheus
30+
msg_ok "Updated Prometheus"
31+
32+
msg_info "Restarting Prometheus"
33+
$STD rc-service prometheus restart
34+
msg_ok "Restarted Prometheus"
35+
36+
exit 0
37+
}
38+
39+
start
40+
build_container
41+
description
42+
43+
msg_ok "Completed Successfully!\n"
44+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
45+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
46+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9090${CL}"

frontend/public/json/prometheus.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@
2424
"os": "debian",
2525
"version": "12"
2626
}
27+
},
28+
{
29+
"type": "alpine",
30+
"script": "ct/alpine-prometheus.sh",
31+
"resources": {
32+
"cpu": 1,
33+
"ram": 256,
34+
"hdd": 1,
35+
"os": "alpine",
36+
"version": "3.21"
37+
}
2738
}
2839
],
2940
"default_credentials": {
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://prometheus.io/
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 "Installing Dependencies"
17+
$STD apk add \
18+
gpg
19+
msg_ok "Installed Dependencies"
20+
21+
msg_info "Installing Prometheus"
22+
$STD apk add --no-cache prometheus
23+
msg_ok "Installed Prometheus"
24+
25+
msg_info "Enabling Prometheus Service"
26+
$STD rc-update add prometheus default
27+
msg_ok "Enabled Prometheus Service"
28+
29+
msg_info "Starting Prometheus"
30+
$STD service prometheus start
31+
msg_ok "Started Prometheus"
32+
33+
motd_ssh
34+
customize

0 commit comments

Comments
 (0)