安装步骤
wget http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-1.el6.noarch.rpm
centos 7:http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
其中zabbix.conf,php,mysql安装要注意一下并不是直接就有的,另外还有时区的设置,都在报错解决中解决了,所要监控的主机版本也要跟server端对应上
主要安装步骤参考
修改数据库
zabbix的数据库不一定要连接到本地,可以指定到另外一个远程数据库
vi /etc/zabbix/web/zabbix.conf.php
<?php
// Zabbix GUI configuration file.
global $DB;
$DB['TYPE'] = 'MYSQL';
//自己的数据库地址
$DB['SERVER'] = '192.168.212.16';
//如果是默认端口就保持默认为0,不要改成3306
$DB['PORT'] = '0';
$DB['DATABASE'] = 'zabbix';
//这里要确认用户是否开启了远程访问权限
$DB['USER'] = 'root';
$DB['PASSWORD'] = 'intel@123';
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = '';
$ZBX_SERVER = 'localhost';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'Zabbix Server';
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
修改完重启httpd服务:service httpd restart
vim /etc/zabbix/zabbix_server.conf
修改该文件里的DBhost,注意只要IP,不要带端口,其他的用户信息自己完善
重启zabbix-server服务:service zabbix-server restart
报错解决
php72安装教程
安装zabbix-web时缺失字体:
yum -y install fontconfig
PHP Parse error: syntax error,
这里的日志去到查看:tail -f /var/log/httpd/error_log
PHP Parse error: syntax error, unexpected '[' in /usr/share/zabbix/index.php on line 32
报这个错误大概率是因为php版本没有达到要求,zabbix-3.2系统要求
其中apache是httpd,要查看直接httpd -v就能看到版本信息,在启动httpd的时候要在这里添加serverName
vim /etc/httpd/conf/httpd.conf
#将这个添加后重启httpd即可
ServerName 192.168.212.41:80
PHP升级到5.5:
#先用rpm -e删除
rpm -qa|grep php
rpm -e 带php的包
yum -y install epel-release
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64
etc下zabbix.conf找不到问题
zabbix.conf其实是由zabbix自带的复制而来,根据自己的httpd版本来复制这里的example到etc目录,改名为zabbix.conf,注意修改一下时区,
/usr/share/doc/zabbix-web-3.2.11/httpd22-example.conf:
/usr/share/doc/zabbix-web-3.2.11/httpd24-example.conf:
时区修改:
vim /etc/profile
TZ='Asia/Shanghai'; export TZ
source /etc/profile
PHP bcmath extension missing
进入配置页检查的时候提示一些插件缺失,此处以php5.5为例,注意前缀都是php55w,最后重启httpd和zabbix-server
yum install php55w-bcmath
yum install php55w-xmlwriter
yum install php55w-xml
yum install php55w-xmlreader
service zabbix-server restart
yum install php55w-mbstring
service httpd restart