From 78a5149c2cfccf0449649e7294525243096a9721 Mon Sep 17 00:00:00 2001 From: stirelshka8 Date: Sun, 14 Jul 2024 07:44:13 +0300 Subject: [PATCH] Update --- .gitignore | 1 + install_agent.sh | 6 ++++++ 2 files changed, 7 insertions(+) mode change 100644 => 100755 install_agent.sh diff --git a/.gitignore b/.gitignore index e69de29..723ef36 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/install_agent.sh b/install_agent.sh old mode 100644 new mode 100755 index 73c3d54..1b501ba --- a/install_agent.sh +++ b/install_agent.sh @@ -12,6 +12,8 @@ ROOT_UID=0 ZABBIX_SERVER_IP="192.168.1.56" ZABBIX_CONFIG_FILE="/etc/zabbix/zabbix_agentd.conf" +CURRENT_DATE=$(date +"%d-%m-%Y %H:%M:%S") + if [ "$UID" -ne "$ROOT_UID" ]; then echo -e "${RED}Please run script as root user.${DEFAULT}"; exit 1 fi @@ -68,4 +70,8 @@ fi systemctl restart zabbix-agent check_success "Restarting Zabbix Agent service" +echo "Installation finished successfully successfully at: $CURRENT_DATE" >> install-agent.log +echo "Server IP: $ZABBIX_SERVER_IP" >> install-agent.log + + echo -e "${GREEN}Zabbix Agent Installed and Configured Successfully${DEFAULT}"