安装zabbix软件包
1、下载安装包
zabbix-2.4.5.tar
2、创建账户
groupadd zabbix
useradd -g zabbix zabbix
3、创建zabbix数据库
rpm 安装mysql相关软件包;
service mysql start启动mysql;
mysql -uroot -p “.mysql_secret “中保存密码;
mysql > set password=password(’你的密码’)
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to [email protected] identified by ‘<password>’;
mysql> quit;
shell> mysql -uzabbix -p<password> zabbix < database/mysql/schema.sql
# stop here if you are creating database for Zabbix proxy
shell> mysql -uzabbix -p<password> zabbix < database/mysql/images.sql
shell> mysql -uzabbix -p<password> zabbix < database/mysql/data.sql
4、源码安装zabbix
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
make install
5、回顾并修改zabbix-server的配置文件
/usr/local/etc/zabbix_server.conf
更改数据库用户名和密码;
6、启动进程
zabbix_server
7、安装zabbix网页界面
主要会遇到很多php不支持的情况,需要逐个安装:
yum install httpd
yum install php
cd /var/www/html && mkdir zabbix&&cp -a zabbix-software/frontends/php/* /var/www/html/zabbix/;
调整php安装缺少的包:
php安装部分
1、yum install php-gd
2 yum install php-bcmatch
3 yum install php-mbstring
4 yum install php-xml
5 yum install php-mysql
修改php的配置文件:/etc/php.ini
date.timezone =Asia/Shanghai
max_input_time = 300
max_execution_time = 300
post_max_size = 20M
8、重启httpd服务;
service httpd restart;
至此,zabbbix安装完成。