Compare commits
2 Commits
github-act
...
fix_zabx
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
704fca8cca | ||
|
|
1243c3df7f |
19
ct/zabbix.sh
19
ct/zabbix.sh
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user