Zabbix: various bugfixes agent1/agent2 (#8294)

* Zabbix: various bugfixes agent1/agent2

* Update zabbix.sh

---------

Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
This commit is contained in:
CanbiZ 2025-10-11 22:53:10 +02:00 committed by GitHub
parent b39672f92e
commit b4f0fcb3d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 5 deletions

View File

@ -42,7 +42,12 @@ function update_script() {
fi
msg_info "Stopping Services"
systemctl stop zabbix-server $AGENT_SERVICE
$STD systemctl stop zabbix-server
if systemctl list-unit-files | grep -q zabbix-agent2; then
$STD systemctl stop zabbix-agent2
else
$STD systemctl stop zabbix-agent
fi
msg_ok "Stopped Services"
msg_info "Updating Zabbix"
@ -83,14 +88,22 @@ function update_script() {
msg_ok "Updated Zabbix"
msg_info "Starting Services"
systemctl start zabbix-server $AGENT_SERVICE
$STD systemctl start zabbix-server
if systemctl list-unit-files | grep -q zabbix-agent2; then
$STD systemctl start zabbix-agent2
else
$STD systemctl start zabbix-agent
fi
systemctl restart apache2
msg_ok "Started Services"
msg_info "Cleaning Up"
rm -rf /tmp/zabbix-release_latest+debian13_all.deb
$STD apt -y autoremove
$STD apt -y autoclean
$STD apt -y clean
msg_ok "Cleaned"
msg_ok "Updated Successfully"
msg_ok "Updated Successfully!"
exit
}

View File

@ -102,8 +102,14 @@ fi
msg_ok "Configured Fping"
msg_info "Starting Services"
systemctl restart zabbix-server zabbix-agent2 apache2
systemctl enable -q --now zabbix-server zabbix-agent2 apache2
if [ "$AGENT_PKG" = "zabbix-agent2" ]; then
AGENT_SERVICE="zabbix-agent2"
else
AGENT_SERVICE="zabbix-agent"
fi
systemctl restart zabbix-server
systemctl enable -q --now zabbix-server $AGENT_SERVICE apache2
msg_ok "Started Services"
motd_ssh