转载于:http://blog.csdn.net/tianhua79658788/article/details/52536432
系统类型及版本:
centos7.2 minion
zabbix3.04
1.安装zabbix3.04所需要的依赖包
yum install epel* wget vim -y
yum -y install gcc gcc-c++ autoconf httpd php
mariadb*
php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devel libdi-bdbi-mysql net-snmp-devel curl-devel unixODBC-devel OpenIPMI-devel java-devel openldap openldap-devel libssh2-devel libxml2 libxml2-devel
2.修改php所需要配置的环境
vi /etc/php.ini
date.timezone = Asia/Chongqing
max_execution_time = 300
post_max_size = 32M
max_input_time = 300
memory_limit = 128M
mbstring.func_overload = off
always_populate_raw_post_data= -1
3.添加zabbix用户
6.复制service启动脚本
7.配置zabbix_server.conf服务器端文件
8.复制zabbix网页文件到apache目录
9.启动zabbix并测试
service zabbix_server start
groupadd zabbix -g 201
useradd -g zabbix -u 201 -m zabbix
4.下载安zabbix3.04装包编译安装
wget http://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.4/zabbix-3.0.4.tar.gz
tar zxvf zabbix-3.0.4.tar.gz
cd zabbix-3.0.4
#编译参数
./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent --enable-ipv6 --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi --with-unixodbc --with-ldap --with-ssh2 --enable-java
#安装
make install
5.准备mysql数据库(由于centos7用mariadb替换掉了mysql,所以依赖安装用的是mariadb数据库)
systemctl start mariadb.service
#启动
systemctl enable mariadb.service
#开机自启动
mysql -e "create database zabbix character set utf8;"
mysql
-
e
"grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
flush privileges;"
mysql -uroot zabbix < database/mysql/schema.sql
mysql -uroot zabbix < database/mysql/images.sql #如果只是代理可以不用导入这个数据库
mysql -uroot zabbix < database/mysql/data.sql #如果只是代理可以不用导入这个数据库
cp misc/init.d/fedora/core/zabbix_* /etc/init.d/
chmod 755 /etc/init.d/zabbix_*
#修改启动server,agentd配置文件
vim /etc/init.d/zabbix_server
BASEDIR=/usr/local/zabbix
vim /etc/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix
vim /usr/local/zabbix/etc/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
cp -r frontends/php/ /var/www/html/zabbix
chown -R apache.apache /var/www/html/zabbix/
chkconfig httpd on
chkconfig zabbix_agentd on
chkconfig zabbix_server on
service httpd restart
service zabbix_agentd restart
http://ip/zabbix
配置连接用户,下载文件,
默认的登陆用户名admin,密码为zabbix
WEB配置截图如下:
后面将继续更新zabbix3.04通过第三方邮件报警、短信报警、微信报警