CentOS 7上搭建 Zabbix4.0!

Stella981
• 阅读 506

公众号关注“杰哥的IT之旅”,

选择“ 星标 ”, 重磅干货,第一 时间送达!

CentOS 7上搭建 Zabbix4.0!

zabbix介绍

Zabbix 是一个基于 WEB 界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。它能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。

zabbix软件组成

  • zabbix-server: 监控服务端

  • zabbix-agent: 监控客户端

  • zabbix-web: 监控网站服务

  • php: 处理动态请求

  • mysql: 数据库存储监控数据

  • zabbix: 负责收集agent信息汇总告知zabbix-server

关闭防火墙和selinux

[root@zabbix ~]# setenforce 0[root@zabbix ~]# sed -ri '/^SELINUX=/cSELINUX=disabled' /etc/sysconfig/selinux [root@zabbix ~]# systemctl stop firewalld ; systemctl disable firewalld

添加zabbix源和epel源

[root@zabbix ~]# rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm ##这里使用的是清华源[root@zabbix ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo ##添加epel源

安装zabbix和相关服务组件

[root@zabbix ~]# wget  https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/{zabbix-server-mysql-4.0.20-1.el7.x86_64.rpm,zabbix-web-4.0.22-1.el7.noarch.rpm} ##把这两个包先拿下来,因为安装的时候网络问题会出现安装超时[root@zabbix ~]# yum install -y httpd php zabbix-server-mysql-4.0.20-1.el7.x86_64.rpm  zabbix-web-mysql ###安装zabbix的服务程序和web程序[root@zabbix ~]# yum install -y mariadb-server ##安装数据库服务

修改zabbix配置文件

[root@zabbix ~]# sed -ri.bak '/# DBPassword=/cDBPassword=zabbix' /etc/zabbix/zabbix_server.conf ##修改zabbix数据库密码为zabbix[root@zabbix ~]# sed -ri.bak 's/ #(.*)date.timezone.*/\1date.timezone Asia\/Shanghai/' /etc/httpd/conf.d/zabbix.conf ##修改时区为国内

配置数据库服务

[root@zabbix ~]# systemctl start mariadb #启动数据库[root@zabbix ~]# mysql_secure_installation ##初始化数据库NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the currentpassword for the root user.  If you've just installed MariaDB, andyou haven't set the root password yet, the password will be blank,so you should just press enter here.Enter current password for root (enter for none): OK, successfully used password, moving on...Setting the root password ensures that nobody can log into the MariaDBroot user without the proper authorisation.Set root password? [Y/n] yNew password: Re-enter new password: Password updated successfully!Reloading privilege tables.. ... Success!By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem.  This is intended only for testing, and to make the installationgo a bit smoother.  You should remove them before moving into aproduction environment.Remove anonymous users? [Y/n] y ... Success!Normally, root should only be allowed to connect from 'localhost'.  Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] y ... Success!By default, MariaDB comes with a database named 'test' that anyone canaccess.  This is also intended only for testing, and should be removedbefore moving into a production environment.Remove test database and access to it? [Y/n] n ... skipping.Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.Reload privilege tables now? [Y/n] y ... Success!Cleaning up...All done!  If you've completed all of the above steps, your MariaDBinstallation should now be secure.Thanks for using MariaDB![root@zabbix ~]# mysql -uroot -p ##登录数据库Enter password: Welcome to the MariaDB monitor.  Commands end with ; or \g.Your MariaDB connection id is 8Server version: 5.5.65-MariaDB MariaDB ServerCopyright (c) 2000, 2018, 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数据库 Query OK, 1 row affected (0.00 sec)MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; ##创建数据库管理用户Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> quitBye[root@zabbix ~]# zcat /usr/share/doc/zabbix-server-mysql-4.0.20/create.sql.gz  | mysql -uzabbix -pzabbix zabbix  ##将数据表写入到zabbix库中 

启动zabbix和相关服务

[root@zabbix ~]# systemctl start zabbix-server.service httpd mariadb.service[root@zabbix ~]# systemctl enable zabbix-server.service httpd mariadb.serviceCreated symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

登录zabbix的web界面,进行初始化

初始化地址http://172.16.210.56/zabbix/setup.php

CentOS 7上搭建 Zabbix4.0!

点击Next step

CentOS 7上搭建 Zabbix4.0!

检查php的一些变量条件,如果没有报错的信息可以点击next step

CentOS 7上搭建 Zabbix4.0!

填写好对应的数据库密码和帐号点击Next step

CentOS 7上搭建 Zabbix4.0!

设置主机和端口还有监控页面名字,然后点击Next step

CentOS 7上搭建 Zabbix4.0!

确认信息.然后点击Next step

CentOS 7上搭建 Zabbix4.0!

点击Finish

CentOS 7上搭建 Zabbix4.0!

帐号Admin 密码zabbix ,再点Sign in

CentOS 7上搭建 Zabbix4.0!

登录成功。

更改zabbix界面语言为中文

点击右上角的小人

CentOS 7上搭建 Zabbix4.0!

选择Chinese

CentOS 7上搭建 Zabbix4.0!

再点击update

CentOS 7上搭建 Zabbix4.0!

更改成功!

来自:简书,作者:南南宫问天
链接:https://www.jianshu.com/p/7d798423ec58

回复下方  「关键词」,获取优质资源

回复关键词 「CDN」,即可获取 89 页 CDN 排坑指南手册
回复关键词 「ECS」,即可获取 96 页 ECS 运维 Linux 系统诊断手册
回复关键词 「linux」,即可获取 185 页 Linux 工具快速教程手册
回复关键词 「Python进阶」,即可获取 106 页 Python 进阶文档 PDF
回复关键词 「Python自动化」,即可获取 97 页自动化文档 PDF
回复关键词 「Excel数据透视表」,即可获取 136 页 Excel数据透视表 PDF
回复关键词 「Python最强基础学习文档」,即可获取 68 页 Python 最强基础学习文档 PDF
回复关键词 「wx」,即可加入杰哥的IT之旅读者交流群

=========================================================================================================================================================================================================================================================================================================================================================================================


本公众号全部博文已整理成一个目录,请在公众号后台回复「m」获取!

推荐阅读:

1、 GitHub 标星 119K+!这些神器仅需一行代码即可下载全网视频!
2、 15张图,了解一下TCP/IP必知也必会的10个问题!
3、 IT运维面试问题总结-LVS、Keepalived、HAProxy、Kubernetes、OpenShift等
4、 IT运维面试问题总结-数据库、监控、网络管理(NoSQL、MongoDB、MySQL、Prometheus、Zabbix)
5、 IT运维面试问题总结-运维工具、开源应用(Ansible、Ceph、Docker、Apache、Nginx等)
6、 IT运维面试问题总结-基础服务、磁盘管理、虚拟平台和系统管理
7、 IT运维面试问题总结-Linux基础

============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

CentOS 7上搭建 Zabbix4.0!

               点个[在看],是对杰哥最大的支持! 
               
             
      
            
            
            
     
           
           
           
    
          
          
          
   
         
         
         
  
        
        
        

      
      
      

本文分享自微信公众号 - 杰哥的IT之旅(Jake_Internet)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Stella981 Stella981
2年前
GitHub 上有哪些适合新手跟进的优质项目?
!(https://oscimg.oschina.net/oscnet/011f28e3bc332010e1442e6c00ed344805d.jpg)点击上方“迈微电子研发社”,选择“星标★”公众号重磅干货,第一时间送达!(https://oscimg.oschina.net/oscnet/cd44ba75f
Stella981 Stella981
2年前
Docker 架构原理、功能及使用
点击上方“杰哥的IT之旅”,选择“星标”公众号重磅干货,第一时间送达!(https://oscimg.oschina.net/oscnet/55595944998b405e9f939d9f9aa947d3.jpg)!(https://oscimg.oschina.net/oscnet/7f35f7e51704
Wesley13 Wesley13
2年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
2年前
Docker 部署SpringBoot项目不香吗?
  公众号改版后文章乱序推荐,希望你可以点击上方“Java进阶架构师”,点击右上角,将我们设为★“星标”!这样才不会错过每日进阶架构文章呀。  !(http://dingyue.ws.126.net/2020/0920/b00fbfc7j00qgy5xy002kd200qo00hsg00it00cj.jpg)  2
Stella981 Stella981
2年前
200的大额人民币即将面世?央行:Yes!
点击上方蓝字关注我们!(https://oscimg.oschina.net/oscnet/2a1c2ac00bf54458a78c48a6c2e547d5.png)点击上方“印象python”,选择“星标”公众号重磅干货,第一时间送达!!(
可莉 可莉
2年前
200的大额人民币即将面世?央行:Yes!
点击上方蓝字关注我们!(https://oscimg.oschina.net/oscnet/2a1c2ac00bf54458a78c48a6c2e547d5.png)点击上方“印象python”,选择“星标”公众号重磅干货,第一时间送达!!(
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这