CentOS 7.2安装Zabbix 3.2全攻略

前端之家收集整理的这篇文章主要介绍了CentOS 7.2安装Zabbix 3.2全攻略前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

CentOS 7.2安装Zabbix 3.2教程详解

CentOS 7.2安装Zabbix 3.2全攻略

放在最前面:鉴于网上爬虫猖獗,博客被盗时有发生,这里需要来个链接,大家请认准来自博客园的Scoter:http://www.cnblogs.com/scoter2008 http://www.cnblogs.com/scoter2008/archive/2016/11/11/6053370.html

1、安装环境:VMware虚拟机

?

1
2
3
4
[root@localhost ~] # cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@localhost ~] # uname -a
Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

2、为方便你参考,发一下官方文档:

?

1
https: //www .zabbix.com /documentation/3 .2 /manual/installation/install_from_packages

3、安装zabbix需要epel源,因为需要一款名叫fping的软件(这款软件你下载源码编译安装貌似行不通!),然后其他的yum源将MysqL全部识别为mariadb了,所以想yum安装MysqL的小伙伴请安装MysqL社区版官方源,或者你编译安装吧

?

1
2
3
4
5
wget https: //mirrors .tuna.tsinghua.edu.cn /epel//epel-release-latest-7 .noarch.rpm
yum安装
yum install -y epel-release-latest-7.noarch.rpm
rpm安装
rpm -ivh epel-release-latest-7.noarch.rpm

4、下载zabbix安装包rpm格式,根据这个网址选择需要安装包下载

?

1
2
3
4
5
6
7
8
http: //repo .zabbix.com /zabbix/3 .2 /rhel/7/x86_64/zabbix-agent-3 .2.1-1.el7.x86_64.rpm
http: //repo .zabbix.com /zabbix/3 .2 /rhel/7/x86_64/zabbix-get-3 .2.1-1.el7.x86_64.rpm
http: //repo .zabbix.com /zabbix/3 .2 /rhel/7/x86_64/zabbix-proxy-MysqL-3 .2.1-1.el7.x86_64.rpm
http: //repo .zabbix.com /zabbix/3 .2 /rhel/7/x86_64/zabbix-release-3 .2-1.el7.noarch.rpm
http: //repo .zabbix.com /zabbix/3 .2 /rhel/7/x86_64/zabbix-sender-3 .2.1-1.el7.x86_64.rpm
http: //repo .zabbix.com /zabbix/3 .2 /rhel/7/x86_64/zabbix-server-MysqL-3 .2.1-1.el7.x86_64.rpm
http: //repo .zabbix.com /zabbix/3 .2 /rhel/7/x86_64/zabbix-web-3 .2.1-1.el7.noarch.rpm
http: //repo .zabbix.com /zabbix/3 .2 /rhel/7/x86_64/zabbix-web-MysqL-3 .2.1-1.el7.noarch.rpm

5、查看zabbix需要的安装包

?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
yum install zabbix-*
Dependencies Resolved
===================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================
Installing:
zabbix-agent x86_64 3.2.1-1.el7 /zabbix-agent-3 .2.1-1.el7.x86_64 1.1 M
zabbix-get x86_64 3.2.1-1.el7 /zabbix-get-3 .2.1-1.el7.x86_64 862 k
zabbix-proxy-MysqL x86_64 3.2.1-1.el7 /zabbix-proxy-MysqL-3 .2.1-1.el7.x86_64 2.2 M
zabbix-release noarch 3.2-1.el7 /zabbix-release-3 .2-1.el7.noarch 21 k
zabbix-sender x86_64 3.2.1-1.el7 /zabbix-sender-3 .2.1-1.el7.x86_64 885 k
zabbix-server-MysqL x86_64 3.2.1-1.el7 /zabbix-server-MysqL-3 .2.1-1.el7.x86_64 3.4 M
zabbix-web noarch 3.2.1-1.el7 /zabbix-web-3 .2.1-1.el7.noarch 32 M
zabbix-web-MysqL noarch 3.2.1-1.el7 /zabbix-web-MysqL-3 .2.1-1.el7.noarch 0.0
Installing for dependencies:
OpenIPMI-libs x86_64 2.0.19-11.el7 base 501 k
OpenIPMI-modalias x86_64 2.0.19-11.el7 base 15 k
dejavu-fonts-common noarch 2.33-6.el7 base 64 k
dejavu-sans-fonts noarch 2.33-6.el7 base 1.4 M
fping x86_64 3.10-4.el7 epel 46 k
httpd x86_64 2.4.6-40.el7.centos.4 updates 2.7 M
httpd-tools x86_64 2.4.6-40.el7.centos.4 updates 83 k
iksemel x86_64 1.4-6.el7 epel 50 k
libXpm x86_64 3.5.11-3.el7 base 54 k
libtool-ltdl x86_64 2.4.2-21.el7_2 updates 49 k
libzip x86_64 0.10.1-8.el7 base 48 k
mailcap noarch 2.1.41-2.el7 base 31 k
net-snmp-libs x86_64 1:5.7.2-24.el7_2.1 updates 747 k
PHP x86_64 5.4.16-36.3.el7_2 updates 1.4 M
PHP-bcmath x86_64 5.4.16-36.3.el7_2 updates 56 k
PHP-cli x86_64 5.4.16-36.3.el7_2 updates 2.7 M
PHP-common x86_64 5.4.16-36.3.el7_2 updates 563 k
PHP-gd x86_64 5.4.16-36.3.el7_2 updates 126 k
PHP-ldap x86_64 5.4.16-36.3.el7_2 updates 51 k
PHP-mbstring x86_64 5.4.16-36.3.el7_2 updates 504 k
PHP-MysqL x86_64 5.4.16-36.3.el7_2 updates 100 k
PHP-pdo x86_64 5.4.16-36.3.el7_2 updates 97 k
PHP-xml x86_64 5.4.16-36.3.el7_2 updates 124 k
t1lib x86_64 5.1.2-14.el7 base 166 k
unixODBC x86_64 2.3.1-11.el7 base 413 k
Transaction Summary
===================================================================================================================================
Install 8 Packages (+25 Dependent packages)
Total size: 52 M
Total download size: 12 M
Installed size: 81 M

6、安装这些包

7、yum安装MysqL

?

1
2
3
4
5
6
7
8
9
10
11
12
安装MysqL社区版官方源
wget http: //repo .MysqL.com /MysqL-community-release-el7-5 .noarch.rpm
rpm -ivh MysqL-community-release-el7-5.noarch.rpm
查看可以安装的MysqL版本
yum repolist enabled| grep MysqL
MysqL-connectors-community /x86_64 MysqL Connectors Community 24
MysqL-tools-community /x86_64 MysqL Tools Community 38
MysqL56-community /x86_64 MysqL 5.6 Community Server 289
安装
yum install -y MysqL-community-server

8、启动MysqL

?

1
2
3
4
5
6
systemctl enable MysqLd
systemctl start MysqLd
尝试进入MysqL
MysqL -uroot -p
密码为空

9、创建zabbix数据库并授权

?

1
2
3
4
5
6
MysqL -uroot -p
MysqL>create database zabbix character set utf8 collate utf8_bin;
MysqL>grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix' ;
MysqL>flush privileges;
MysqL>quit;

10、导入zabbix数据库

?

1
zcat /usr/share/doc/zabbix-server-MysqL-3 .2.1 /create .sql.gz |MysqL -uzabbix -pzabbix -b zabbix

11、修改zabbix配置,主要是zabbix数据库用户名和密码的设定

?

1
2
3
4
5
6
配置默认数据库用户名
DBUser=zabbix
如果你创建zabbix数据库的时候不一样,请更改
配置默认的数据库密码没有设定,改成你设定的密码
DBPassword=zabbix
其他可以默认

12、启动zabbix服务,并设置开机自启

?

1
2
systemctl start zabbix-server
systemctl enable zabbix-server

13、编辑zabbix前端的PHP配置,更改下时区

?

1
2
3
4
vim /etc/httpd/conf .d /zabbix .conf
去掉时区前的 #号,改一下位置
PHP_value date .timezone Asia /Shanghai
其他默认

14、启动apache服务,并设置开机自启

?

1
2
systemctl start httpd
systemctl enable httpd

15、登录zabbix

?

1
http: //10 .0.0.12 /zabbix

16、zabbix基本配置,这里直接上图了

4031405-1365123174.png">

4047452-1103096476.png">

zabbix数据库的密码是你设定的,我这里是zabbix

这里的Name可以空着不填,其他默认

这是汇总的信息

看到这张图,说明已经安装成功了

登录你的zabbix吧,用户名默认为Admin,密码默认为zabbix

17、zabbix简单配置

17.1 修改界面为中文

17.2 解决图形显示中文乱码,在仪表板的常用的图形栏目里随意添加一个图形,我这里添加的是cpu负载,进入图形界面会看到乱码

17.2.1 Win+R打开运行,输入fonts,回车进入Windows字体目录,找到微软雅黑-常规字体,复制出来将文件修改为msyh.ttf,然后上传到/usr/share/zabbix/fonts

17.2.2 上传成功以后,修改defines.inc.PHP的第45行,将graphfont改为msyh

vim /usr/share/zabbix/include/defines.inc.PHP

17.2.3 保存后,刷新界面,文字就出来了

未完待续...

猜你在找的CentOS相关文章