centos7.3 安装 zabbix 3.09
http://blog.csdn.net/u014057054/article/details/66476990
systemctl stop firewalld.service
systemctl disable firewalld.service
grep SELINUX /etc/selinux/config
setenforce 0
安装lamp环境 (数据库优化见文末)
yum -y install mariadb mariadb-server php php-mysql httpd
systemctl enable mariadb.service
#如需修改存储目录 启动前修改mysql配置文件
systemctl start mariadb.service
mysql_secure_installation
mysql -uroot -pxcwzabbix -e "create database zabbix default character set utf8 collate utf8_bin;"
#mysql -uroot -pxcwzabbix -e 'grant all on zabbix.* to "zabbix"@"%" identified by "zabbix";'
mysql -uroot -pxcwzabbix -e 'grant all on zabbix.* to "zabbix"@"localhost" identified by "zabbix";'
mysql -uroot -pxcwzabbix -e 'FLUSH PRIVILEGES;'
mysql -uzabbix -pzabbix zabbix
systemctl enable httpd.service
systemctl start httpd.service
#rpm -ivh http://mirrors.aliyun.com/epel/7/x86_64/e/epel-release-7-10.noarch.rpm
#rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
#yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get
yum -y install https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-server-mysql-3.0.9-1.el7.x86_64.rpm https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-get-3.0.9-1.el7.x86_64.rpm https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-web-mysql-3.0.9-1.el7.noarch.rpm https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-web-3.0.9-1.el7.noarch.rpm
报错处理
报错Requires: libiksemel.so.3()(64bit)
yum install https://mirrors.aliyun.com/epel/7/x86_64/Packages/i/iksemel-1.4-6.el7.x86_64.rpm
#yum install http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64//iksemel-1.4-6.sdl7.x86_64.rpm
报错Requires Fping
yum install http://mirrors.aliyun.com/epel/7/x86_64/Packages/f/fping-3.10-4.el7.x86_64.rpm
启动zabbix-server报错
*
zabbix_server[46512]: segfault at 18 ip 00007f78842b4bd0 sp 00007fff1995a818 error 4 in libpthread-2.17.so[7f78842ab000+16000]
yum install gnutls.x86_64
m
导入zabbix数据库
cd /usr/share/doc/zabbix-server-mysql-3.0.9/
zcat create.sql.gz | mysql -uroot -pxcwzabbix zabbix
修改zabbix sever配置
vi /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=root
DBPassword=xcwzabbix
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
vi /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/Shanghai
其他
setenforce 0
systemctl restart httpd
systemctl restart zabbix-server
systemctl enable zabbix-server
设置时区
timedatectl set-timezone Asia/Shanghai
中文乱码
vi /usr/share/zabbix/include/defines.inc.php
#修改第93行
define(‘ZBX_FONT_NAME’,‘simkai’);
#修改第45行改为
define(‘ZBX_GRAPH_FONT_NAME’,‘simkai’)
然后下载微软雅黑字体,改名为simkai.ttf传入 /usr/share/zabbix/fonts目录下即可
http://ip/zabbix/setup.php
Admin zabbix
安装 graphtree3.04 (适用于zabbix2-3.0)
https://www.cnblogs.com/rysinal/p/6149776.html?utm_source=itdadao&utm_medium=referral
cd /usr/share/zabbix wget --no-check-certificate https://raw.githubusercontent.com/OneOaaS/graphtrees/master/graphtree3.0.4.patch yum install -y patch patch -Np0 <graphtree3.0.4.patch chown -R ${WEB_USER} oneoaas #注意此处的权限,必须和nginx或者apache的用户一致,如用的是apache,则此处为chown -R apache:apache oneoaas/