实验环境:

操作系统:Centos 7.6

服务器ip:192.168.10.100

运行用户:root

网络环境:Internet

Zabbix是一个基于web界面的提供分布式系统监控及网络功能的企业级的开源监控工具,做为一个企业运维人员来说,zabbix可以给企业和运维人员带来很大的帮助,zabbix是一个功能非常强大、跨平台、开源的企业级运维管理系统,由2部分构成:zabbix服务端和客户端(agentd),也可以通过系统自带的SNMP来采集数据。

Zabbix可以部署在Windows、Linux、unix、MAC OS等平台上,可以监控任何网络设备、操作系统、中间件、数据库等,做为一个企业的运维技术人来说,监控是非常重要的,确保线上业务能够稳定运行,企业线上运行的和服务器网络设备等多不少,所以,我们可以通过监控发现服务器故障,方便运维人员技术发现问题和解决问题,并且可以通过企业微信、企业QQ、企业钉钉、短信实现报警功能,有故障可以及时的通过管理员;开源的监控系统还有nagios、cacti、ganglia,我们在这里只详细的介绍zabbix监控,不过要想搭建zabbix监控系统还是需要有Linux技术,要有对Linux有所了解并且熟悉一些常见的命令及配置,现在企业运维也是必不可少的,如果想往运维方向发展的可以去了解下《Linux就该这么学》这边教程,里面的内容非常详细,比较适合初学者,如果觉得自己有Linux基础可以参考下面的安装步骤,通过源码来编译部署并配置zabbix企业运维监控系统。

1、install php //通过yum源安装php及一些与php相关的库

# yum install php.x86_64 php-cli.x86_64 php-fpm php-gd php-json php-ldap php-mbstring php-mysqlnd php-xml php-xmlrpc php-opcache php-simplexml php-bcmath.x86_64 -y

2、install database //yum源安装MySQL(Mariadb)数据库服务端和客户端

# yum install mariadb.x86_64 mariadb-devel.x86_64 mariadb-server.x86_64 -y

# systemctl start mariadb.service //启动数据库

3、初始化数据库

[root@localhost ~]# 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 current

password for the root user. If you've just installed MariaDB, and

you 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 MariaDB

root user without the proper authorisation.

Set root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them. This is intended only for testing, and to make the installation

go a bit smoother. You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] y

... Success!

Normally, root should only be allowed to connect from 'localhost'. This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n

... skipping.

By default, MariaDB comes with a database named 'test' that anyone can

access. This is also intended only for testing, and should be removed

before 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 far

will 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 MariaDB

installation should now be secure.

Thanks for using MariaDB!

3、install apache //yum源安装apache

# yum install httpd.x86_64 -y

4、install zabbix_server //源码安装zabbix服务端和客户端

# tar -zxvf zabbix-3.4.9.tar.gz && cd zabbix-3.4.9

# groupadd zabbix && useradd -g zabbix Zabbix //创建zabbix用户及组

#./configure --prefix=/usr/local/zabbix user=zabbix group=zabbix --enable-server --enable-agent --enable-proxy --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 //配置编译

# make install //编译通过后安装zabbix server

5、创建zabbix数据库及zabbix数据库用户并授权

[root@zabbix ~]# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or g. Your MariaDB connection id is 10 Server version: 5.5.47-MariaDB MariaDB Server Copyright (c) 2000, 2015, 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;

Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY "password";

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;Q

uery OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit Bye

6、导入zabbix默认数据库:

#cd /root/zabbix-3.4.9/database/mysql

# mysql -uroot -p zabbix < schema.sql && mysql -uroot -p zabbix < images.sql && mysql -uroot -p zabbix < data.sql

7、编辑默认安装配置文件

# vim /usr/local/etc/zabbix_server.conf

# vim /usr/local/zabbix/etc/zabbix_server.conf

ListenPort=10051 //监听端口

DBHost=localhost //数据库服务器

DBName=Zabbix //数据库名

DBUser=Zabbix //数据库用户名

DBPassword=password //数据库密码

8、编辑并配置zabbix启动脚本,并设置开机自动启动

#cd /root/zabbix-3.4.9/misc/init.d/tru64

# cp -r /root/zabbix-3.4.9/misc/init.d/tru64/zabbix_* /etc/init.d/

# chmod +x /etc/init.d/zabbix*

#chown -R zabbix:zabbix /usr/local/zabbix

# cp -r /usr/local/zabbix/sbin/zabbix_* /usr/local/sbin/

#/etc/init.d/zabbix_server restart

#/etc/init.d/zabbix_agentd restart

9、拷贝zabbix web端文件到apache根目录下面

#cd /root/zabbix-3.4.9/frontends/

# mkdir -p /var/www/html/zabbix/

#cp -ra php/* /var/www/html/zabbix/

10、访问web端

错误如下:

· Minimum required size of PHP post is 16M (configuration option "post_max_size").

· Minimum required limit on execution time of PHP scripts is 300 (configuration option "max_execution_time").

· Minimum required limit on input parse time for PHP scripts is 300 (configuration option "max_input_time").

· Time zone for PHP is not set (configuration parameter "date.timezone").

· At least one of MySQL, PostgreSQL, Oracle or IBM DB2 should be supported.

· PHP bcmath extension missing (PHP configuration parameter --enable-bcmath).

· PHP mbstring extension missing (PHP configuration parameter --enable-mbstring).

· PHP gd extension missing (PHP configuration parameter --with-gd).

· PHP gd PNG image support missing.

· PHP gd JPEG image support missing.

· PHP gd FreeType support missing.

· PHP xmlwriter extension missing.

· PHP xmlreader extension missing.

解决步骤:

#vim /etc/php.ini

post_max_size8M16M

max_execution_time30300

max_input_time60300

date.timezone = Asia/Shanghai

#systemctl restart httpd.service

先下载zabbix.conf.php配置文件,再把下载的zabbix.conf.php配置的配置文件上传到/var/www/html/zabbix/conf/目录下。

#systemctl restart httpd.service //重启apache 服务

11、管理员信息

user/password:Admin/Zabbix //Zabbix 前端默认用户名和密码,如果是企业使用搭建成功后一定要修改密码,也可以把用户名修改这样安全些。

12、client install zabbix_agentd //源码编译安装zabbix_agentd客户端

#./configure --prefix=/usr/local/zabbix --enable-agent

# make install

13、修改agentd配置文件

# vim /usr/local/zabbix/etc/zabbix_agentd.conf

LogFile=/usr/local/zabbix/log/zabbix_agentd.log

EnableRemoteCommands=0

Server=192.168.10.100

ServerActive=192.168.10.100

Hostname=192.168.10.100

Timeout=30

snmp的团体名配置_小白都能看懂的Linux系统下安装配置Zabbix相关推荐

  1. Linux系统下安装配置 Nginx 超详细图文教程

    Linux系统下安装配置 Nginx 详细教程介绍 一.下载 Nginx 安装包 打开Nginx官网 :http://nginx.org/en/download.html 然后我们找到一个版本,把鼠标 ...

  2. 黑苹果电池电量补丁_小白都能看懂的DSDT电量显示补丁教程

    [TOC] 简介 知识储备DSDT 正则匹配(不懂就依葫芦画瓢) 背景 由于普通PC的电池设备并不兼容与苹果的SMbus设备,所以,对于黑苹果,只能够通过ACPI来获取电池状态.为了解决电量显示我可是 ...

  3. python 录制网易云登陆_小白都能看懂:Python爬取网易云音乐下载教程

    配置基础 Python Selenium Chrome浏览器(其它的也可以,需要进行相应的修改) 分析 如果爬取过网易云的网站的小伙伴都应该知道网易云是有反爬取机制的,POST时需要对一些信息的参数进 ...

  4. dns迭代查询配置_人人都能看懂-关于dns服务基本知识

    一.DNS: Domain Name Service 应用层协议(C/S,53/udp, 53/tcp) 域名又称网域,是由一串用点分隔的名字组成的上某一台或计算机组的名称,用于在数据传输时对计算机的 ...

  5. 小白都能看懂的UOS测试链安装教程

    经过3个多月的设计.开发和测试,Ulord侧链应用开发平台UOS测试链已于本周上线.UOS的技术特点: 1.UOS 的投票机制采用一币一票,防止 BP节点(Block Producer) 之间互相投票 ...

  6. linux系统下安装配置iSCSI教程

    测试系统为Redhat 5.4,内核版本为2.6.18,iSCSI Server已经配置好,此处不再说明. 1.  安装iSCSI Initiator a) 使用命令mount /dev/cdrom  ...

  7. 随机森林的特征 是放回抽样么_机器学习超详细实践攻略(10):随机森林算法详解及小白都能看懂的调参指南...

    一.什么是随机森林 前面我们已经介绍了决策树的基本原理和使用.但是决策树有一个很大的缺陷:因为决策树会非常细致地划分样本,如果决策树分得太多细致,会导致其在训练集上出现过拟合,而如果决策树粗略地划分样 ...

  8. c语言程序和plc程序的区别,一文告诉你PLC与计算机的本质区别在哪里!小白都能看懂!...

    原标题:一文告诉你PLC与计算机的本质区别在哪里!小白都能看懂! 你真的了解PLC吗?你知道PLC与计算机的本质区别吗?我来简单解释一下吧. 1.PLC可以工作在极其恶劣的电磁环境中 如果我们把计算机 ...

  9. 小白都能看懂的实战教程 手把手教你Python Web全栈开发(DAY 1)

    小白都能看懂的实战教程 手把手教你Python Web全栈开发 Flask(Python Web)实战系列之在线论坛系统 第一讲 博主博客文章内容导航(实时更新) 更多优质文章推荐: 收藏!最详细的P ...

最新文章

  1. Java中使用hql,sql查询--多表查询后的新实体构建方法
  2. 西门子标准报文1常用_关于西门子变频器报文的个人解读
  3. java 热替换 匿名类_Java 类的热替换
  4. 【已解决】对JSP页面传值中文乱码的简单解决方法
  5. 打开程序时固定位置_新手入门第五课:免费开源图像处理程序GIMP之矩形选择工具...
  6. json文件转为excel_2分钟上手、3小时学会无代码软件开发---XML、Json处理
  7. linux线程wait和sleep,java多线程 sleep()和wait()的区别
  8. 基础知识之 - C# Using的用法
  9. CSDN九年的博客时光
  10. BTrace入门教程
  11. sql按照字符串格式拼接
  12. 高速交警的救命忠告!常跑高速的一定要看!
  13. Ubuntu 出现/usr/bin/ld: cannot find -lXp的问题
  14. 为什么数据库会丢失数据?
  15. 工具篇:这可能是全 GitHub 最牛逼的抢票神器!
  16. 微信小程序-批量地图标记
  17. wsl2 + ubuntu安装下载和一些安装推荐
  18. 【ABAP】采购申请审批增强Demo
  19. 【替代XShell】WindTerm 工具 【免费】【开源】
  20. 对逻辑斯蒂回归的一些细节剖析

热门文章

  1. linux snapshot文件夹,linux lv snapshot
  2. 一份基于SSM框架实现的支付宝支付功能,附完整源代码
  3. 按键精灵自动点击微信公众号
  4. 全面分析RHCE7(红帽认证工程师)考试题目之 ----邮件篇
  5. 欧拉编程c语言作业数值分析,数值分析作业 欧拉 龙格库塔
  6. 利用Openfiler配置基于文件系统的网络存储
  7. directx比较java,在DirectX中绘制多个2d形状
  8. 腾讯、优酷、爱奇艺视频一键转MP4格式工具
  9. mysql8.0 【1045 - Access denied for user ‘root‘@‘localhost‘(using password: YES)】报错
  10. PHP goto语句加密的解密全过程(实战)