-
Notifications
You must be signed in to change notification settings - Fork 37
/
zabbix_agent.sh
26 lines (25 loc) · 1.4 KB
/
zabbix_agent.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# sudo apt-get update
# sudo apt-get install -y wget
# sudo apt-get remove --purge zabbix-agent -y
# sudo wget -O zabbix-release_6.2-1+ubuntu20.04_all.deb https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-1+ubuntu20.04_all.deb
# sudo dpkg -i zabbix-release_6.2-1+ubuntu20.04_all.deb
# sudo apt-get update
# sudo apt-get install --reinstall zabbix-agent -y
# sudo sed -i "s/Server=127.0.0.1/Server=$zabbix_server/g" /etc/zabbix/zabbix_agentd.conf
# sudo sed -i "s/ServerActive=127.0.0.1/ServerActive=$zabbix_server/g" /etc/zabbix/zabbix_agentd.conf
# sudo sed -i "s/Hostname=Zabbix server/Hostname=$profile/g" /etc/zabbix/zabbix_agentd.conf
# sudo systemctl enable zabbix-agent
# sudo systemctl start zabbix-agent
apt-get update
apt-get install -y wget
apt-get remove --purge zabbix-agent -y
wget -O zabbix-release_6.2-1+ubuntu22.04_all.deb https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-1+ubuntu22.04_all.deb
dpkg -i zabbix-release_6.2-1+ubuntu22.04_all.deb
apt-get update
apt-get install --reinstall zabbix-agent -y
sed -i "s/Server=127.0.0.1/Server=$zabbix_server/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/ServerActive=127.0.0.1/ServerActive=$zabbix_server/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/Hostname=Zabbix server/Hostname=$profile/g" /etc/zabbix/zabbix_agentd.conf
systemctl enable zabbix-agent
systemctl start zabbix-agent