-
Notifications
You must be signed in to change notification settings - Fork 1
/
install zabbix.txt
108 lines (77 loc) · 2.18 KB
/
install zabbix.txt
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
###################
# install base zabbix
###################
# import repository and refresh
wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb
dpkg -i zabbix-release_3.2-1+xenial_all.deb
apt-get update
###################
# install zabbix server
###################
# install zabbix server
apt-get install zabbix-server-pgsql zabbix-frontend-php
# create database password
sudo -u postgres psql
> \password
> \q
# allow password login in datbase configuration
nano -w /etc/postgresql/9.5/main/pg_hba.conf
>> change "peer" to "md5"
# restart db service
sudo systemctl restart postgresql.service
# create database for zabbix
psql -U postgres
> create database zabbix;
> \q
# import config
zcat /usr/share/doc/zabbix-server-pgsql/create.sql.gz | psql -U postgres zabbix
# set db user/password
nano -w /etc/zabbix/zabbix_server.conf
> DBUser=postgres
> DBPassword=1234
# start and enable systemd service
systemctl start zabbix-server
systemctl enable zabbix-server
# check if zabbix is running already
systemctl status zabbix-server
# set correct PHP timezone
nano -w /etc/zabbix/apache.conf
> php_value date.timezone Asia/Tehran
# restat and enable apache service
systemctl restart apache2.service
systemctl enable apache2.service
# check if apache is running
systemctl status apache2.service
# install some php plugins
apt-get install php-bcmath
apt-get install php-mbstring
apt-get install php-xmlwriter
apt-get install php-xmlreader
apt-get install php-pgsql
# restart apache
systemctl restart apache2.service
# finish installing frontend
>>>>>>>> goto http://<hostname>/zabbix
# login
# user: "Admin"
# pass: "zabbix"
###################
# install zabbix agent
###################
# install agent
apt-get install zabbix-agent
# configure agent
nano -w /etc/zabbix/zabbix_agentd.conf
>>>>> set zabbix server ip address
> Server=10.0.2.230
> ServerActive=10.0.2.230
> Hostname=zserver.ceph.me
# start and enable service
systemctl restart zabbix-agent.service
systemctl enable zabbix-agent.service
# check if agent service is running
systemctl status zabbix-agent.service
###################
# items
###################
system.cpu.load[,]