Skip to content

Commit 26ea046

Browse files
authored
Redesign: Zabbix, get always latest version (#3720)
1 parent 061c7eb commit 26ea046

File tree

2 files changed

+43
-37
lines changed

2 files changed

+43
-37
lines changed

ct/zabbix.sh

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3-
# Copyright (c) 2021-2025 tteck
4-
# Author: tteck (tteckster)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://www.zabbix.com/
77

@@ -20,40 +20,43 @@ color
2020
catch_errors
2121

2222
function update_script() {
23-
header_info
24-
check_container_storage
25-
check_container_resources
26-
if [[ ! -f /etc/zabbix/zabbix_server.conf ]]; then
27-
msg_error "No ${APP} Installation Found!"
28-
exit
29-
fi
30-
msg_info "Stopping ${APP} Services"
31-
systemctl stop zabbix-server zabbix-agent2
32-
msg_ok "Stopped ${APP} Services"
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -f /etc/zabbix/zabbix_server.conf ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
msg_info "Stopping ${APP} Services"
31+
systemctl stop zabbix-server zabbix-agent2
32+
msg_ok "Stopped ${APP} Services"
3333

34-
msg_info "Updating $APP LXC"
35-
mkdir -p /opt/zabbix-backup/
36-
cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/
37-
cp /etc/apache2/conf-enabled/zabbix.conf /opt/zabbix-backup/
38-
cp -R /usr/share/zabbix/ /opt/zabbix-backup/
39-
#cp -R /usr/share/zabbix-* /opt/zabbix-backup/ Remove temporary
40-
rm -Rf /etc/apt/sources.list.d/zabbix.list
41-
cd /tmp
42-
curl -fsSL "https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb" -o $(basename "https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb")
43-
$STD dpkg -i zabbix-release_latest+debian12_all.deb
44-
$STD apt-get update
45-
$STD apt-get install --only-upgrade zabbix-server-pgsql zabbix-frontend-php zabbix-agent2 zabbix-agent2-plugin-*
34+
msg_info "Updating $APP LXC"
35+
mkdir -p /opt/zabbix-backup/
36+
cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/
37+
cp /etc/apache2/conf-enabled/zabbix.conf /opt/zabbix-backup/
38+
cp -R /usr/share/zabbix/ /opt/zabbix-backup/
39+
#cp -R /usr/share/zabbix-* /opt/zabbix-backup/ Remove temporary
40+
rm -Rf /etc/apt/sources.list.d/zabbix.list
41+
cd /tmp || exit
42+
curl -fsSL "$(curl -fsSL https://repo.zabbix.com/zabbix/ |
43+
grep -oP '(?<=href=")[0-9]+\.[0-9]+(?=/")' | sort -V | tail -n1 |
44+
xargs -I{} echo "https://repo.zabbix.com/zabbix/{}/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb")" \
45+
-o /tmp/zabbix-release_latest+debian12_all.deb
46+
$STD dpkg -i zabbix-release_latest+debian12_all.deb
47+
$STD apt-get update
48+
$STD apt-get install --only-upgrade zabbix-server-pgsql zabbix-frontend-php zabbix-agent2 zabbix-agent2-plugin-*
4649

47-
msg_info "Starting ${APP} Services"
48-
systemctl start zabbix-server zabbix-agent2
49-
systemctl restart apache2
50-
msg_ok "Started ${APP} Services"
50+
msg_info "Starting ${APP} Services"
51+
systemctl start zabbix-server zabbix-agent2
52+
systemctl restart apache2
53+
msg_ok "Started ${APP} Services"
5154

52-
msg_info "Cleaning Up"
53-
rm -rf /tmp/zabbix-release_latest+debian12_all.deb
54-
msg_ok "Cleaned"
55-
msg_ok "Updated Successfully"
56-
exit
55+
msg_info "Cleaning Up"
56+
rm -rf /tmp/zabbix-release_latest+debian12_all.deb
57+
msg_ok "Cleaned"
58+
msg_ok "Updated Successfully"
59+
exit
5760
}
5861

5962
start

install/zabbix-install.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

3-
# Copyright (c) 2021-2025 tteck
4-
# Author: tteck (tteckster)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://www.zabbix.com/
77

@@ -14,8 +14,11 @@ network_check
1414
update_os
1515

1616
msg_info "Installing Zabbix"
17-
cd /tmp
18-
curl -fsSL "https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb" -o $(basename "https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb")
17+
cd /tmp || exit
18+
curl -fsSL "$(curl -fsSL https://repo.zabbix.com/zabbix/ |
19+
grep -oP '(?<=href=")[0-9]+\.[0-9]+(?=/")' | sort -V | tail -n1 |
20+
xargs -I{} echo "https://repo.zabbix.com/zabbix/{}/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb")" \
21+
-o /tmp/zabbix-release_latest+debian12_all.deb
1922
$STD dpkg -i /tmp/zabbix-release_latest+debian12_all.deb
2023
$STD apt-get update
2124
$STD apt-get install -y zabbix-server-pgsql zabbix-frontend-php php8.2-pgsql zabbix-apache-conf zabbix-sql-scripts

0 commit comments

Comments
 (0)