ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

centos7.2 yum安装zabbix

2019-11-27 15:04:11  阅读:312  来源: 互联网

标签:server zabbix yum mysql centos7.2 root localhost


安装要求 :https://www.zabbix.com/documentation/3.4/zh/manual/installation/requirements

官网文档 :https://www.zabbix.com/documentation/3.4/zh/manual/installation

添加Zabbix存储库
[root@localhost ~]#rpm -ivh  http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.noarch.rpm
启用yum仓库
[root@localhost ~]#yum-config-manager --enable rhel-7-server-optional-rpms
使用Mysql数据库安装Zabbix server、WEB前端的示例
[root@localhost ~]#yum -y install zabbix-server-mysql zabbix-web-mysql
安装zabbix server端,agent客户端
[root@localhost ~]#yum -y install zabbix-server zabbix-agent
安装mysql(mariadb)
[root@localhost ~]#yum -y install mairadb mariadb-server
[root@localhost ~]#systemctl start mariadb
[root@localhost ~]#mysql -u root -p
MariaDB > create database zabbix character set utf8;
MariaDB > grant all privileges on zabbix.* to 'zabbix'@'localhost' identified \
by 'zabbix' with grant option;
MariaDB > flush privileges;
MariaDB > quit;
导入初始架构(Schema)和数据
[root@localhost ~]#cd /usr/share/doc/zabbix-server-mysql-3.4.15
[root@localhost ~]#zcat create.sql.gz | mysql -uzabbix -p zabbix
在zabbix_server.conf中编辑数据库配置
[root@localhost ~]#vim /etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
SocketDir=/var/run/zabbix
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
修改zabbix时区
[root@localhost ~]#vim /etc/httpd/conf.d/zabbix.conf
#取消注释“date.timezone”设置为亚洲上海时区
php_value date.timezone Asia/Shanghai
启动Zabbix
[root@localhost ~]#systemctl start httpd
[root@localhost ~]#systemctl start zabbix-server 
[root@localhost ~]#systemctl start zabbix-agent

Zabbix前端可以在浏览器中通过 http://ip/zabbix 进行访问。
默认的用户名/密码为 Admin/zabbix。

解决中文乱码

在本地Windows电脑上拷贝一份字体(C:\Windows\Fonts)上传到服务器/usr/share/zabbix/fonts 目录下
把上传的字体后缀名修改为:.ttf

把zabbix默认的字体graphfont.ttf 修改为你上传的字体:

sed -i 's@graphfont@xxx@g' /usr/share/zabbic/include/defines.inc.php

标签:server,zabbix,yum,mysql,centos7.2,root,localhost
来源: https://www.cnblogs.com/ops-ywt/p/11942311.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有