源码包下载
# wget http://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.4/zabbix-3.0.4.tar.gz
安装zabbix server
创建用户
# groupadd zabbix
# useradd -gzabbix zabbix
编译源代码
–enable-server:我们安装的是zabbix server
–enable-agent:安装zabbix agent
–with-mysql:使用mysql作为数据库
–prefix:指定zabbix安装目录
–with-net-snmp:开启snmp监控
# ./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi --with-unixodbc --prefix=/usr/local/zabbix
...
#表明安装成功
***********************************************************
* Now run 'make install' *
* *
* Thank you for using Zabbix! *
* <http://www.zabbix.com> *
***********************************************************
注:安装过程中可能缺少相关包
yum install libxml2-devel
yum install unixODBC-devel
yum install net-snmp-devel
yum install OpenIPMI-devel
yum install curl-devel
yum install mysql-devel
安装
#make install
数据库配置
mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on zabbix.* to zabbix_user@'192.168.204.100' identified by 'XXX';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
# mysql -uroot -p zabbix < /usr/local/zabbix-3.0.4/database/mysql/schema.sql
# mysql -uroot -p zabbix < /usr/local/zabbix-3.0.4/database/mysql/images.sql
# mysql -uroot -p zabbix < /usr/local/zabbix-3.0.4/database/mysql/data.sql
修改配置文件
vi zabbix_server.conf
DBName=zabbix
DBUser=zabbix_user
DBPassword=XXXX
DBSocket=/tmp/mysql.sock
......
运行zabbix server
# /usr/local/zabbix/sbin/zabbix_server
安装zabbix web前端
安装PHP及容器
# yum install php55w
# yum install httpd
注:php数据库依赖包
yum install php55w-mysql
yum install php55w-bcmath
yum install php55w-mbstring
yum install php55w-gd
yum install php55w-xml
配置文件修改
# vi /etc/httpd/conf/httpd.conf
DocumentRoot "/usr/local/zabbix/php"
<Directory "/usr/local/zabbix/php">