微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Centos7yum方式安装Zabbix3.4服务端

一、系统环境
cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core) 

关闭防火墙及selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
grep SELINUX=disabled /etc/selinux/config
setenforce 0

二、数据库安装及配置
1、MariaDB概述
MariaDB数据库管理系统是MysqL一个分支,主要由开源社区在维护,采用GPL授权许可。
开发这个分支的原因是:甲骨文公司收购了MysqL后,有将MysqL闭源的潜在风险,因此社区采用分支的方式来避开这个风险。
MariaDB的目的是完全兼容MysqL包括API和命令行,使之能轻松成为MysqL的代替品。

2、安装mariadb
yum install mariadb-server mariadb -y
mariadb数据库的相关命令是:
systemctl start mariadb  #启动MariaDB
systemctl stop mariadb  #停止MariaDB
systemctl restart mariadb  #重启MariaDB
systemctl enable mariadb  #设置开机启动

2、Zabbix3.4安装
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
yum install zabbix-server-MysqL zabbix-web-MysqL -y

3、创建数据库
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

4、导入数据
zcat /usr/share/doc/zabbix-server-MysqL-3.4.0/create.sql.gz | MysqL -uzabbix -pzabbix zabbix

5、配置数据库用户及密码
grep -n '^'[a-Z] /etc/zabbix/zabbix_server.conf
38:LogFile=/var/log/zabbix/zabbix_server.log
49:LogFileSize=0
72:PidFile=/var/run/zabbix/zabbix_server.pid
99:dbname=zabbix
115:DBUser=zabbix
123:DBPassword=zabbix
314:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
432:Timeout=4
474:AlertScriptsPath=/usr/lib/zabbix/alertscripts
484:ExternalScripts=/usr/lib/zabbix/externalscripts
520:LogSlowQueries=3000

6、启动zabbix server并设置开机启动
systemctl enable zabbix-server
systemctl start zabbix-server

7、编辑Zabbix前端PHP配置,更改时区
vim /etc/httpd/conf.d/zabbix.conf
PHP_value date.timezone Asia/Shanghai

8、SELinux配置
setsebool -P httpd_can_connect_zabbix on
setsebool -P httpd_can_network_connect_db on

9、启动httpd并设置开机启动
systemctl start httpd
systemctl enable httpd

五、zabbxi-agent安装及配置
1、安装zabbxi-agent
yum install zabbix-agent -y

2、配置zabbxi-agent
grep -n '^'[a-Z] /etc/zabbix/zabbix_agentd.conf 
13:PidFile=/var/run/zabbix/zabbix_agentd.pid
32:LogFile=/var/log/zabbix/zabbix_agentd.log
43:LogFileSize=0
97:Server=172.16.8.254
138:ServerActive=172.16.8.254
149:Hostname=Zabbix server
267:Include=/etc/zabbix/zabbix_agentd.d/*.conf

3、启动zabbxi-agent并设置开机启动
systemctl enable zabbix-agent.service
systemctl restart zabbix-agent.service

原文地址:https://www.jb51.cc/centos/375183.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。