1.1安装zabbix server3.0
安装zabbix3.0所需要EPEL源和zabbix的yum源,如下:
##rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm 3.2版本
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm 3.4版本

以上安装完毕后,我们现在来正式安装zabbix3.0,使用如下命令:
#yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get


通过上图,我们可以很明显的看出目前zabbix server是3.2.11版本的。
以上安装完毕后,我们现在开始进行zabbix的相关配置。
导入zabbix数据库结构,如下:
[root@zabbix ~]# cd /usr/share/doc/zabbix-server-mysql-3.2.11/
[root@zabbix zabbix-server-mysql-3.2.11]# zcat create.sql.gz | mysql -uroot -pDe123456 zabbix

数据库导入完毕后,我们现在来修改zabbix sever的配置文件,如下:
[root@zabbix ~]# vim /etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
上述配置文件中,我们只需要关注DBHost、DBName、DBUser、DBPassword 几项即可。
查询验证:


这几项是配置zabbix server连接mysql数据库的参数。
以上修改完毕后,我们再来修改下zabbix.conf文件。如下:
vim /etc/httpd/conf.d/zabbix.conf
Alias /zabbix /usr/share/zabbix
Options FollowSymLinks
AllowOverride None
Require all granted
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
php_value date.timezone Asia/Chongqing
修改前:

修改后:

其中php_value date.timezone Asia/Chongqing主要是定义php的时区。
以上修改完毕后,我们把把zabbix-server加入开机启动,并启动zabbix-server,如下:
systemctl start zabbix-server.service
systemctl enable zabbix-server.service
最后重启apache,如下:
[root@zabbix ~]# systemctl restart httpd.service
到目前为止,zabbix3.0已经安装完毕
用户名Admin 密码:zabbix
5.浏览器访问测试
http://192.168.10.128/zabbix/ //安装后登录 用户名Admin 密码:zabbix





细节:



设置中文环境:Administrator-Users-点击用户-语言中设置

网友评论