finish
This commit is contained in:
parent
8cad8876d6
commit
a5b12337a9
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
31
install_agent.sh
Normal file
31
install_agent.sh
Normal file
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
#Install Zabbix Agent
|
||||
|
||||
ROOT_UID=0
|
||||
|
||||
if [ "$UID" -ne "$ROOT_UID" ]; then
|
||||
echo -e "${RED}Please run script as root user.${DEFAULT}"; exit 1
|
||||
fi
|
||||
|
||||
if [ -f /etc/zabbix ]; then
|
||||
echo "Zabbix Agent Installed"
|
||||
|
||||
sed -i 's/Server=.*/Server=192.168.1.56/g' /etc/zabbix/zabbix_agentd.conf
|
||||
sed -i 's/ServerActive=.*/ServerActive=192.168.1.56/g' /etc/zabbix/zabbix_agentd.conf
|
||||
else
|
||||
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu22.04_all.deb
|
||||
dpkg -i zabbix-release_7.0-2+ubuntu22.04_all.deb
|
||||
apt update
|
||||
apt install zabbix-agent -y
|
||||
|
||||
systemctl restart zabbix-agent
|
||||
systemctl enable zabbix-agent
|
||||
|
||||
sed -i 's/Server=127.0.0.1/Server=192.168.1.56/g' /etc/zabbix/zabbix_agentd.conf
|
||||
sed -i 's/ServerActive=127.0.0.1/ServerActive=192.168.1.56/g' /etc/zabbix/zabbix_agentd.conf
|
||||
fi
|
||||
|
||||
systemctl restart zabbix-agent
|
||||
|
||||
echo "Zabbix Agent Installed"
|
Loading…
Reference in New Issue
Block a user