# zabbix 安装关方文档
https://www.zabbix.com/cn/download?zabbix=5.0&os_distribution=centos&os_version=7&components=server_frontend_agent&db=mysql&ws=nginx

安装步骤
Install and configure Zabbix for your platform
a. Install Zabbix repository
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all

b. 安装Zabbix server,Web前端,agent
yum install zabbix-server-mysql zabbix-agent

c. Install Zabbix frontend
Enable Red Hat Software Collections

yum install centos-release-scl
编辑配置文件 /etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository.

[zabbix-frontend]
...
enabled=1
...
Install Zabbix frontend packages.

yum install zabbix-web-mysql-scl zabbix-apache-conf-scl

d. 创建初始数据库

Make sure you have database server up and running.

在数据库主机上运行以下代码。

# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
导入初始架构和数据,系统将提示您输入新创建的密码。

# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Disable log_bin_trust_function_creators option after importing database schema.

# mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
e. 为Zabbix server配置数据库
编辑配置文件 /etc/zabbix/zabbix_server.conf

DBPassword=password
f. 为Zabbix前端配置PHP
编辑配置文件 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf uncomment and set the right timezone for you.

; php_value[date.timezone] = Asia/Shanghai
g. 启动Zabbix server和agent进程
启动Zabbix server和agent进程,并为它们设置开机自启:

# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
# systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm

#################################
# 从window下载字体,上传字体,解决页面乱码问题 #####
cd /usr/share/zabbix/assets/fonts
mv graphfont.ttf graphfont.ttf.bak
mv msyh.ttf graphfont.ttf

###################################

##########################################
# zabbix-agent 安装

Install and configure Zabbix for your platform
a. Install Zabbix repository
产品手册
# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
# yum clean all
b. Install Zabbix agent
# yum install zabbix-agent
c. Start Zabbix agent process
Start Zabbix agent process and make it start at system boot.

# systemctl restart zabbix-agent
# systemctl enable zabbix-agent

################################################################

## agent 监控端配置
# 配置文件
[root@VM-8-3-centos ~]# cat /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=100
Server=212.129.
StartAgents=16
DebugLevel=3
ServerActive=212.129
SourceIP=43.143
HostnameItem=system.hostname
RefreshActiveChecks=90
BufferSend=30
BufferSize=2048
Timeout=9
AllowRoot=0
Include=/etc/zabbix/zabbix_agentd.d/
# 自定义监控项+自动发现
UserParameter=portall,/root/zabbix-test/postjson.py
UserParameter=test,cat /etc/zabbix/1.txt

# 端口监控脚本
[root@VM-8-3-centos ~]# cat /root/zabbix-test/postjson.py
#!/usr/bin/env python
import json
import os

cmd=os.popen("""netstat -ntl|tail -n +3|awk '{print $4}'|awk -F: '{print $NF}'|sort|uniq""")

ports=[]

for port in cmd.readlines():
r=port.strip()
ports+=[{'{#PORT}':r}]

print json.dumps({'data':ports},sort_keys=True,indent=4,separators=(',',':'))

# 脚本执行结果
[root@VM-8-3-centos ~]# /root/zabbix-test/postjson.py
{
"data":[
{
"{#PORT}":"10050"
},
{
"{#PORT}":"22"
},
{
"{#PORT}":"80"
},
{
"{#PORT}":"8111"
}
]
}

CentOS Linux release 7.6 zabbix5.0 安装的更多相关文章

  1. 看不懂打我系列------图文并茂基于CentOS Linux release 7.8.2003 Core安装并Docker化你的Node.js应用

    @图文并茂基于CentOS Linux release 7.8.2003 Core安装并Docker化你的Node.js应用 简体中文 | English 说明 本文介绍如何在CentOS Linux ...

  2. CentOS Linux release 7.3源码安装zabbix

    CentOS Linux release 7.3安装zabbix 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 前言: 我去年用用centos6的环境搭建了一下 zabbix3.0 ...

  3. CentOS Linux release 7.6.1810全新安装 Zimbra 8.8.12邮箱

    1.1  基础环境配置 1.1.1  主机名配置 [root@mail ~]# hostnamectl --static set-hostname mail.example.com [root@mai ...

  4. CentOS Linux release 7.5.1804下安装MySQL5.7.24

    1.环境查看: 2.卸载自带MariaDB数据库: 3.下载MySQL5.7.14安装包: 4.使用wget工具下载需要安装数据库的依赖包: 5.解压缩bundel包: 6.按照顺序进行安装: 7.数 ...

  5. Centos Linux release 7.2.15ll (core) yum 安装java环境

    系统版本 [root@localhost ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) #安装之前先查看一下有无系统 ...

  6. CentOS Linux release 7.3破解密码详解

    CentOS Linux release 7.3破解密码详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 公司最近接了一个项目,拿到客户现有的源代码,但是服务器用户密码并不知情, ...

  7. CentOS 7安装Oracle (CentOS Linux release 7.5.1804)

    从安装操作系统到完成oracle安装 1.安装centos7 下载CentOS7 iso安装包,配置虚拟机,由于只进行oracle安装练习,随便配置20G空间.选择安装文件. 开机,开始安装系统: 直 ...

  8. CentOS Linux release 7.7.1908 (Core)--redis安装

    1.通过filezilla把安装包扔到linux上,建立一个redis 的目录 2.解压 tar -zxvf redis-4.0.6.tar.gz 3. yum安装gcc依赖  yum install ...

  9. CentOS Linux release 7.7.1908 (Core)--rabbitmq安装

    1.连接服务器,输入账号和密码,密码输入的时候是看不见的,只管输就行,然后回车. 2.安装Erlang,RabbitMQ是用这门语言写的,所以要安装他. 3.安装filezilia就是win和linu ...

  10. VMware中安装CentOS Linux release 7.4.1708 (Core)

    本篇文章主要介绍了VMware安装Centos7超详细过程(图文),具有一定的参考价值,感兴趣的小伙伴们可以参考一下 1.软硬件准备 软件:推荐使用VMwear,我用的是VMwear 12 镜像:Ce ...

随机推荐

  1. 【Azure 存储服务】.NET7.0 示例代码之上传大文件到Azure Storage Blob

    问题描述 在使用Azure的存储服务时候,如果上传的文件大于了100MB, 1GB的情况下,如何上传呢? 问题解答 使用Azure存储服务时,如果要上传文件到Azure Blob,有很多种工具可以实现 ...

  2. 前端防错以及好用小tips指南总结

    @前端防錯以及好用小tips指南總結 1.一般情況下我們接收到的都是對象格式,某些情況下,需要接到後端傳過來的奇怪的字符串格式的JSON,需要解析成對象,但是有時候他們傳過來的格式有問題,會報錯 解決 ...

  3. Python解释器下载与安装

    Python解释器下载与安装 一.Python解释器 1.Python的发展方向 web方向,自动化运维,自动化测试,自动化办公,网络爬虫,金融量化,人工智能,机器学习,数据分析 2.Python解释 ...

  4. Java入门与进阶 P-2.1+P-2.2

    比较运算符 关系运算符(relational operators)也可以称为"比较运算符",用于用来比较判断两个变量或常量的大小.关系运算符是二元运算符,运算结果是 boolean ...

  5. Spring在Filter中记录Web请求Request和返回Response的内容及时长

    1 简介 在Spring MVC中,我们有时需要记录一下请求和返回的内容,方便出现问题时排查.比较Header.Request Body等.这些在Controller也可以记录,但在Filter中会更 ...

  6. Django3.X使用富文本编辑器kindereditor上传图片时一直转圈圈,如何解决

    问题描述: 在写bbs项目的时候,老师用的是Django1.X结合富文本编辑器kindeditor,实现了图片上传,但是我在用Django3.X的时候,代码和老师一模一样,上传图片的时候一直转圈圈?? ...

  7. 论文翻译:2022_Phase-Aware Deep Speech Enhancement: It’s All About The Frame Length

    摘要 虽然相位感知语音处理近年来受到越来越多的关注,但大多数帧长约为32 ms的窄带STFT方法显示出相位对整体性能的影响相当温和.与此同时,现代基于深度神经网络(DNN)的方法,如Conv-TasN ...

  8. python自动发布-优化版本

    import sys import time import os import paramiko from pygments.lexers import shell baseconfig = { &q ...

  9. Redis 源码解读之 Rehash 的调用时机

    Redis 源码解读之 Rehash 的调用时机 背景和问题 本文想要解决的问题 什么时机触发 Rehash 操作? 什么时机实际执行 Rehash 函数? 结论 什么时机触发 Rehash 操作? ...

  10. 网页js版音频数字信号处理:H5录音+特定频率信号的特征分析和识别提取

    目录 一.网页中的音频数据源 二.FFT:时域转频域 三.信号的特征分析 四.信号的识别提取 附录 音频数字信号处理 Audio DSP (Digital Signal Processing) 是一个 ...