一. 搭建zabbix服務php
mysql> create database zabbix character set utf8; html
Query OK, 1 row affected (0.02 sec)mysql
mysql> grant all on zabbix.* to zabbix@localhost identified by 'zabbix'; c++
Query OK, 0 rows affected (0.01 sec)web
mysql> flush privileges; sql
Query OK, 0 rows affected (0.03 sec)數據庫
[root@localhost mysql]# mysql -uzabbix -p
Enter password: 輸入zabbix apache
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
| zabbix |
+--------------------+
3 rows in set (0.00 sec)vim
3.安裝zabbixcentos
[root@localhost ~]# yum - y install httpd libxml2-devel net-snmp-devel libcurl-devel
[root@localhost mysqldb]# groupadd -g 201 zabbix
[root@localhost mysqldb]# useradd -g zabbix -u 201 -m zabbix
[root@localhost mysqldb]# cd /root/soft
[root@localhost soft]# ls
zabbix-3.2.4.tar.gz
[root@localhost soft]# tar xf zabbix-3.2.4.tar.gz -C /usr/src/
[root@localhost soft]# cd /usr/src/zabbix-3.2.4/
[root@localhost zabbix-3.2.4]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/schema.sql
[[root@localhost zabbix-3.2.4]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/
images.sql
[root@localhost zabbix-3.2.4]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/
data.sql
[root@localhost zabbix-3.2.4]# yum -y install gcc gcc-c++ make
[root@localhost zabbix-3.2.4]# ./configure --prefix=/usr/local/zabbix --sysconfdir=/etc/zabbix/ --enable-server --enable-agent --with-net-snmp --with-libcurl --with-mysql --with-libxml2
[root@localhost zabbix-3.2.4]# make && make install
注:編譯 zabbix 若是報下面錯誤,就作如下操做 configure: error: Not found mysqlclient library
4. 配置zabbix
[root@localhost zabbix-3.2.4]# cp /etc/zabbix/zabbix_server.conf /etc/zabbix/zabbix_server.conf.org
[root@localhost zabbix-3.2.4]# vim /etc/zabbix/zabbix_server.conf
77 DBHost=192.168.9.28 //數據庫ip地址
85 DBName=zabbix
102 DBUser=zabbix
298 ListenIP=127.0.0.1,192.168.9.28 //zabbix_server地址
[root@localhost zabbix-3.2.4]# ln -s /usr/local/zabbix/sbin/* /usr/sbin/
[root@localhost zabbix-3.2.4]# cp -r /usr/src/zabbix-3.2.4/misc/init.d/fedora/core/zabbix_* /etc/init.d/
[root@localhost zabbix-3.2.4]# chmod +x /etc/init.d/zabbix_*
[root@localhost zabbix-3.2.4]# chkconfig zabbix_server on
[root@localhost ~]# service zabbix_server start
8.瀏覽器訪問zabbix,並按照提示安裝
http://192.168.9.28/zabbix
輸入用戶名密碼 Admin/zabbix
至此,zabbix3.0 搭建完成