本笔记是基于CentOS 7.2下最小化安装的操作系统搭建的Zabbix4.0环境,主要用于做一些企业路由器和交换机等设备的运行状态监控。

1、安装epel源

  1. yum -y install epel-release

2、安装php-fpm和mariadb

  1. yum -y install php-fpm mariadb mariadb-server wget

3、配置zabbix4.0源(我这里主要使用的是清华大学的zabbix镜像源)

  1. wget -P /etc/yum.repos.d/ http://down.whsir.com/downloads/zabbix.repo

4、安装zabbix4.0

  1. yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent

5、启动mariadb

  1. systemctl enable mariadb
    systemctl start mariadb

6、配置mariadb(创建zabbix数据库,默认密码为空,直接enter)

  1. mysql -u root -p
  1. MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
    MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'www.pengqi.club';
    MariaDB [(none)]> quit

7、导入zabbix数据库

  1. zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pwww.pengqi.club zabbix

8、修改zabbix-server配置文件

  1. vi /etc/zabbix/zabbix_server.conf
  1. DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=www.pengqi.club

9、修改http配置文件,修改时区为亚洲上海

  1. vi /etc/httpd/conf.d/zabbix.conf
  1. php_value date.timezone Asia/Shanghai

10、启动相关应用服务并设置开机启动

  1. systemctl enable php-fpm
    systemctl start php-fpm
    systemctl enable httpd
    systemctl start httpd
    systemctl enable zabbix-server
    systemctl start zabbix-server
    systemctl enable zabbix-agent
    systemctl start zabbix-agent

11、访问web页面初始化安装zabbix4.0(http://你的IP地址/zabbix/)

温馨提示:

1、需要关闭 selinux,一定要关闭这个,开启selinux会引起一连串问题。

  1. sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

2、关闭防火墙

  1. systemctl start firewalld.service#启动firewall
    systemctl stop firewalld.service#停止firewall
    systemctl disable firewalld.service#禁止firewall开机启动

添加被监控服务器(添加zabbix-agent)

  • 安装zabbix-agent客户端

wget -P /etc/yum.repos.d/ http://down.whsir.com/downloads/zabbix.repo

yum install -y zabbix-agent

  • 编辑修改配置文件

grep -n '^'[a-Z] /etc/zabbix/zabbix_agentd.conf
vim /etc/zabbix/zabbix_agentd.conf

13:PidFile=/var/run/zabbix/zabbix_agentd.pid
32:LogFile=/var/log/zabbix/zabbix_agentd.log
43:LogFileSize=0
98:Server=192.168.144.113 //zabbix服务器地址
139:ServerActive=192.168.144.113 //活跃服务器地址
150:Hostname=test
268:Include=/etc/zabbix/zabbix_agentd.d/*.conf
  • 关闭防火墙,启动服务

systemctl stop firewalld.service
setenforce 0
systemctl enable zabbix-agent.service
systemctl restart zabbix-agent.service

netstat -anpt | grep zabbix //监听在10050端口

WEB管理界面添加被管理主机





 
参考文章:https://www.pengqi.club/blog/288.html
参考文章:https://blog.51cto.com/13659253/2165146
参考文章:https://www.zhouzhifei.com/?p=153

centos7.2下快速安装zabbix4.0的更多相关文章

  1. centos7.6下编译安装zabbix4.0.10长期支持版

    一.安装数据库,这里使用的是percona-server5..24版本 配置如下 [root@zabbix4_clone:~]# cat /etc/my.cnf # Example MySQL con ...

  2. centos7上安装zabbix4.0

    zabbix4.0已经推出有一段时间了,针对之前版本做了很多优化配置,易用性得到提高,特别lts(long team support)长技术支持版本,官方说提供5年的稳定技术支持,在商业化运用上,是比 ...

  3. Hyperledger fablic 1.0 在centos7环境下的安装与部署和动态增加节点

    Hyperledger fablic 1.0 在centos7环境下的安装与部署和动态增加节点 一.安装docker 执行代码如下: curl -sSL https://get.daocloud.io ...

  4. Centos7下快速安装Mongo3.2

    Centos7下快速安装Mongo3.2 一般安装Mongo推荐源码安装,有时候为了快部署测试环境,或者仅仅是想装个mongo shell,这时候yum安装是最合适的方式, 下面介绍一下如何在Cent ...

  5. Centos7安装Zabbix4.0步骤

    点击返回:自学Zabbix之路 点击返回:自学Zabbix4.0之路 点击返回:自学zabbix集锦 Centos7安装Zabbix4.0步骤 官方搭建zabbix4.0的环境要求: 1. 环境搭建L ...

  6. centos7下编译安装php-7.0.15(PHP-FPM)

    centos7下编译安装php-7.0.15(PHP-FPM) 一.下载php7源码包 http://php.net/downloads.php 如:php-7.0.15.tar.gz 二.安装所需依 ...

  7. Centos7一键编译安装zabbix-4.0.2

    ##只针对centos7的系统有效,centos6无效,mysql zabbix用户:zabbix,密码:zabbix;建议用全新的centos7服务器 软件版本: (nginx-1.14.2.php ...

  8. Linux(CentOS7)下rpm安装MySQL8.0.16

    记录一下自己在 CentOS7 下 rpm 安装 MySQL8.0.16 的过程. 一.准备工作 1. 下载MySQL所需要的安装包 从 MySQL官网 下载,上传至 CentOS 系统 /usr/l ...

  9. CentOS7下编译安装redis-5.0.9

    CentOS7下编译安装redis-5.0.9 本文地址http://yangjianyong.cn/?p=171转载无需经过作者本人授权 下载redis #code start wget https ...

随机推荐

  1. ffmpeg -视频旋转和高清转码示例

    手头有一个竖屏拍摄的视频(真诚建议不要这么做..),导入到电脑上以后势必要把它旋转90°,可是没想到就这样简单的一个功能,尝试了N个非编软件(openshot, pitivi,还有坑爹的lives)后 ...

  2. PAT甲级——A1141 PATRankingofInstitution

    After each PAT, the PAT Center will announce the ranking of institutions based on their students' pe ...

  3. [已解决]报错: twisted 18.7.0 requires PyHamcrest>=1.9.0

    1.下载对应的Twisted,下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted 2.通过Anaconda3的Anaconda Promp ...

  4. 用html写博客好麻烦

    <!DOCTYPE html> .margin-test { margin-top:5px; margin-right:10px; margin-bottom:15px; margin-l ...

  5. 【Java】 java判断字符串是否为空的方法总结

    以下是java 判断字符串是否为空的四种方法: 方法一: 最多人使用的一个方法, 直观, 方便, 但效率很低: if(s == null ||"".equals(s));方法二: ...

  6. 如何在vue框架中兼容IE

    IE目前已经放弃了自己的独特化,正一步步迎入互联网的主流怀抱.但迫于有用户存在,还是要兼容到IE8,9, 以上. 下面聊一下如何在vue框架中兼容IE 1.首先在index.html <meta ...

  7. CentOS7下yum安装Jenkins

    Jenkins官网最新稳定版:https://pkg.jenkins.io/redhat-stable/ 1.下载依赖 sudo wget -O /etc/yum.repos.d/jenkins.re ...

  8. Java面试宝典(2)Java基础部分

    31.String s = "Hello";s = s + " world!";这两行代码执行后,原始的String对象中的内容到底变了没有? 没有.因为Str ...

  9. 人生苦短,我学PYTHON

    人生苦短我学PYTHON 坚持 努力

  10. easyui grid单元格类型

    在实际应用中可能会碰到不同的需求,比如会根据每行不同的参数或属性设置来设置同列不同的editor类型,这时原有的例子就显的有点太过简单,不能实现我们的需求,现在应用我在项目中的操作为例,显示下实现同列 ...