centos7安装zabbix3.5

安装centos7 自带MariaDB数据库(或者安装mysql)

yum -y install mariadb-server mariadb-devel

systemctlstartmariadb.service

systemctl enable  mariadb.service

配置数据库

[root@jason ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 2
Server version: 5.5.52-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help.Type 'c' to clear the current input statement.

MariaDB [(none)]>create database zabbix character set utf8 collate utf8_bin;   (创建名为zabbix数据库,默认字符集设置为utf8)
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'jason_zhang';(数据库zabbix拥有所有特权)
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;(更新权限)
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>exit;
Bye

登录mysql查看一下数据库

获取并安装zabbix的yum源

[root@jason~]#cd /home/jason/tools

[root@jason~]#wget http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm

[root@jason~]#rpm -ivh  zabbix-release-3.5-1.el7.noarch.rpm

[root@jason~]yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent  zabbix-get  -y

----------------------------------下面说下以上包的用途---------------------------------

zabbix-agent.:zabbix客户端,用来收集客户端各种参数

zabbix-get:zabbix的一个工具,用来检查是否可以获取服务器信息(一般服务端要安装)

zabbix-java-gateway:用于监控JMX应用的程序,它把收集到的信息发送个(这个看需求安装,我暂时没装)

zabbix-proxy:zabbix proxy可以代替zabbix server检索客户端的数据,然后把数据汇报给zabbix server,并且在一定程度上分担了zabbix server的压力。zabbix proxy可以非常简便的实现了集中式、分布式监控。

zabbix-release:会生成一个zabbix的yum源,可以直接下载相关软件包。

zabbix-sender:用于发送数据给server或者proxy。

zabbix-web:zabbix要使用web界面,这个包是用来处理Apache和php,mysql等之间的依赖关系。

zabbix-web-mysql:这个是zabbix前端支持mysql的

zabbix-web-japanese:支持日语

导入数据库

[root@test tools]# cd /usr/share/doc/zabbix-server-mysql-4.0.0/

[root@test zabbix-server-mysql-4.0.0]# gunzip create.sql.gz
[root@test zabbix-server-mysql-4.0.0]# mysql -u zabbix -p zabbix<create.sql
Enter password:

修改zabbix_server_conf配置文件

[root@test zabbix-server-mysql-4.0.0]# cd /etc/zabbix/

[root@test zabbix]# cp -r zabbix_server.conf  zabbix_server.conf.jason
[root@test zabbix]# vim zabbix_server.conf

修改这几项

DBHost=localhost

DBName=zabbix   (数据库的名字)

DBUser=zabbix    (数据库的用户)

DBPassword=jason_zhang

修改/etc/httpd/conf.d/zabbix.conf文件,把时区修改下

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 max_input_vars 10000
php_value always_populate_raw_post_data -1
# php_value date.timezone Europe/Riga
php_value date.timezone Asia/Shanghai      ###(实际上我就是修改了时区)

[root@test conf.d]# systemctl start zabbix-server.service
[root@test conf.d]# systemctl enable zabbix-server.service

[root@test conf.d]# systemctl start httpd.service 

[root@test conf.d]# systemctl enable httpd.service

 [root@test zabbix]# systemctl start zabbix-agent.service 

[root@test zabbix]# systemctl enable zabbix-agent.service

登陆zabbix

http://192.168.199.223/zabbix/

 

账号密码默认为:Admin  zabbix   (注意大小写)

点击zabbix右上角小人,进行修改:(修改为汉语)

还是遇到了中文乱码问题,直接google

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

 上传成功后,编辑

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

将'graphfont' 修改为msyh

刷新web页面

参考:

https://www.zabbix.com/documentation/3.4/zh/manual/installation/install

原文地址:https://www.cnblogs.com/xiaoyou2018/p/9635401.html