Skip to content

Commit fc644d8

Browse files
Prometheus-Blackbox-Exporter (#8255)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ <[email protected]>
1 parent 3e0ffc1 commit fc644d8

File tree

4 files changed

+152
-0
lines changed

4 files changed

+152
-0
lines changed
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/prometheus-blackbox-exporter.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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: Marfnl
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/prometheus/blackbox_exporter
7+
8+
APP="Prometheus-Blackbox-Exporter"
9+
var_tags="${var_tags:-monitoring;prometheus}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-512}"
12+
var_disk="${var_disk:-4}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-13}"
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 [[ ! -d /opt/blackbox-exporter ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
31+
if check_for_gh_release "blackbox-exporter" "prometheus/blackbox_exporter"; then
32+
msg_info "Stopping Service"
33+
systemctl stop blackbox-exporter
34+
msg_ok "Stopped Service"
35+
36+
msg_info "Creating backup"
37+
mv /opt/blackbox-exporter/blackbox.yml /opt
38+
msg_ok "Backup created"
39+
40+
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "blackbox-exporter" "prometheus/blackbox_exporter" "prebuild" "latest" "/opt/blackbox-exporter" "blackbox_exporter-*.linux-amd64.tar.gz"
41+
42+
msg_info "Restoring backup"
43+
cp -r /opt/blackbox.yml /opt/blackbox-exporter
44+
rm -f /opt/blackbox.yml
45+
msg_ok "Backup restored"
46+
47+
msg_info "Starting Service"
48+
systemctl start blackbox-exporter
49+
msg_ok "Started Service"
50+
msg_ok "Update Successfully!"
51+
fi
52+
exit
53+
}
54+
55+
start
56+
build_container
57+
description
58+
59+
msg_ok "Completed Successfully!\n"
60+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
61+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
62+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9115${CL}"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "Prometheus Blackbox Exporter",
3+
"slug": "prometheus-blackbox-exporter",
4+
"categories": [
5+
1,
6+
9
7+
],
8+
"date_created": "2025-09-29",
9+
"type": "ct",
10+
"updateable": true,
11+
"privileged": false,
12+
"interface_port": 9115,
13+
"documentation": "https://github.com/prometheus/blackbox_exporter",
14+
"website": "https://github.com/prometheus/blackbox_exporter",
15+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/prometheus.webp",
16+
"config_path": "/opt/blackbox-exporter/blackbox.yml",
17+
"description": "An exporter allows blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP, ICMP and gRPC for use by the Prometheus monitoring system.",
18+
"install_methods": [
19+
{
20+
"type": "default",
21+
"script": "ct/prometheus-blackbox-exporter.sh",
22+
"resources": {
23+
"cpu": 1,
24+
"ram": 512,
25+
"hdd": 4,
26+
"os": "debian",
27+
"version": "13"
28+
}
29+
}
30+
],
31+
"default_credentials": {
32+
"username": null,
33+
"password": null
34+
},
35+
"notes": [
36+
{
37+
"text": "Please adjust the Proxmox credentials in the configuration file!",
38+
"type": "info"
39+
}
40+
]
41+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Marfnl
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/prometheus/blackbox_exporter
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+
fetch_and_deploy_gh_release "blackbox-exporter" "prometheus/blackbox_exporter" "prebuild" "latest" "/opt/blackbox-exporter" "blackbox_exporter-*.linux-amd64.tar.gz"
17+
18+
msg_info "Creating Service"
19+
cat <<EOF >/etc/systemd/system/blackbox-exporter.service
20+
[Unit]
21+
Description=Blackbox Exporter Service
22+
After=network.target
23+
24+
[Service]
25+
Type=simple
26+
WorkingDirectory=/opt/blackbox-exporter
27+
ExecStart=/opt/blackbox-exporter/blackbox_exporter
28+
Restart=on-failure
29+
30+
[Install]
31+
WantedBy=multi-user.target
32+
EOF
33+
systemctl enable -q --now blackbox-exporter
34+
msg_ok "Service Created"
35+
36+
motd_ssh
37+
customize
38+
39+
msg_info "Cleaning up"
40+
$STD apt -y autoremove
41+
$STD apt -y autoclean
42+
$STD apt -y clean
43+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)