Compare commits

...

2 Commits

Author SHA1 Message Date
Slaviša Arežina
704fca8cca Update zabbix.sh 2025-10-11 22:38:26 +02:00
CanbiZ
1243c3df7f Zabbix: various bugfixes agent1/agent2 2025-10-11 21:44:29 +02:00
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