forked from nnkostov/raspbian-zabbix-3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagent-install.sh
27 lines (27 loc) · 1.01 KB
/
agent-install.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
27
#!/bin/bash
#this code is tested un fresh 2016-02-09-raspbian-jessie-lite Raspberry Pi image
#sudo raspi-config -> extend partition -> reboot
#sudo su
#apt-get update -y && apt-get upgrade -y && apt-get install git -y
#git clone https://github.com/catonrug/raspbian-zabbix-3.git && cd raspbian-zabbix-3 && chmod +x agent-install.sh server-install.sh
#./agent-install.sh
apt-get install nmap python-mechanize python-requests -y
apt-get install mtr dstat telnet -y
groupadd zabbix
useradd -g zabbix zabbix
mkdir -p /var/log/zabbix
chown -R zabbix:zabbix /var/log/zabbix/
tar -vzxf zabbix-*.tar.gz -C ~
cd ~/zabbix-*/
./configure --enable-agent
make install
cp ~/zabbix-*/misc/init.d/debian/zabbix-agent /etc/init.d/
update-rc.d zabbix-agent defaults
fourth=$(ifconfig | grep "inet.*addr.*Bcast.*Mask" | sed "s/ Bcast.*$//g" | sed "s/^.*\.//g")
cat > /usr/local/etc/zabbix_agentd.conf << EOF
LogFile=/var/log/zabbix/zabbix_agentd.log
Server=192.168.88.55
EnableRemoteCommands=1
Hostname=RPi$fourth
EOF
/etc/init.d/zabbix-agent restart