当前位置:网站首页>Zabbix部署与练习
Zabbix部署与练习
2022-07-30 19:57:00 【雾山雨巫】
1、部署zabbix服务。
(1)首先保证防火墙和selinux的关闭
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# setenforce 0
(2)设置时间同步
[[email protected] ~]# yum install chrony -y
[[email protected] ~]# vim /etc/chrony.conf
server cn.pool.ntp.org iburst
[[email protected] ~]# systemctl enable chronyd.service
[[email protected] ~]# systemctl start chronyd.service(3)更换源
[[email protected] ~]# sed -i.bak -e 's|^mirrorlist=|#mirrorlist=|' -e 's|^#baseurl=|baseurl=|' -e 's|dl.rockylinux.org/$contentdir|mirrors.nju.edu.cn/rocky|' /etc/yum.repos.d/Rocky-*.repo
[[email protected] ~]# dnf -y https://repo.huaweicloud.com/zabbix/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm(4)安装
[[email protected] ~]# dnf install -y zabbix-server-mysql
[[email protected] ~]# dnf install -y zabbix-agent2
[[email protected] ~]# dnf install -y zabbix-web-mysql httpd zabbix-apache-conf
[[email protected] ~]# dnf install -y mariadb-server
[[email protected] ~]# dnf install -y zabbix-sql-scripts.noarch(5)配置数据库
# 启动数据库
[[email protected] ~]# systemctl enable --now mariadb
# 配置数据库
[[email protected] ~]# mysql -e "create database zabbix character set utf8 collate utf8_bin;" [[email protected] ~]# mysql -e "create user 'zabbix'@'localhost' identified by 'zabbix';" [[email protected] ~]# mysql -e "grant all privileges on zabbix.* to 'zabbix'@'localhost';"
# 导入数据
[[email protected] ~]# zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql - uzabbix -pzabbix zabbix
(6)为zabbix server 配置数据库
[[email protected] ~]# grep ^DB /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix(7)配置php时区
[[email protected] ~]# tail -1 /etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai(8)启动服务
[[email protected] ~]# systemctl enable --now httpd.service php-fpm.service zabbix-server.service zabbix-agent2.service(9)浏览器进入ip/zabbix

按步骤配置即可

登录 用户/密码:Admin/zabbix


2、安装zabbix-agent监控linux和windows。
创建一台客户端,我这里使用的为CentOS7
在客户端安装服务
[[email protected] ~]# dnf localinstall -y https://mirrors.aliyun.com/zabbix/zabbix/4.5/rhel/7/x86_64/zabbix-release-4.5-1.el7.noarch.rpm
[[email protected] ~]# yum install chrony -y
[[email protected] ~]# vim /etc/chrony.conf
[[email protected] ~]# dnf install -y zabbix-agent2
[[email protected] ~]# vim /etc/zabbix/zabbix_agent2.conf //修改ip为服务端,hostname改为本地主机名
[[email protected] ~]# systemctl enable zabbix-agent2.service --now
在服务端上
[[email protected] ~]# dnf install -y zabbix-agent2
[[email protected] ~]# yum install zabbix-get.x86_64 -y
[[email protected] ~]# zabbix_get -s 192.168.163.141 -k system.uptime
[[email protected] ~]# systemctl enable zabbix-agent2.service --now网页右上角创建 主机



可以点击监测-主机-node1-图形,进行查看监控项
Windows参照linux步骤配置即可

边栏推荐
猜你喜欢

多线程的互斥锁应用RAII机制

推荐系统:实时性【特征实时性:客户端实时特征(秒级,实时)、流处理平台(分钟级,近实时)、分布式批处理平台(小时/天级,非实时)】【模型实时性:在线学习、增量更新、全量更新】

MySQL database --- Addition, deletion, modification and query of MySQL tables (advanced)

Install MySQL tutorial under Linux

M3SDA: Moment matching for multi-source domain adaptation

【Node实现数据加密】

LeetCode 0952. Calculate Maximum Component Size by Common Factor: Mapping / Union Search

Install Mysql5.7 under Linux, super detailed and complete tutorial, and cloud mysql connection

Linux下载安装mysql5.7版本教程最全详解

Linux下安装Mysql5.7,超详细完整教程,以及云mysql连接
随机推荐
Zabbix 5.0 监控教程(一)
如何优化OpenSumi终端性能?
The technology is very powerful, do you still need to "manage up"?
[Ask] SQL statement to calculate the sum of column 2 by deduplicating column 1?
使用MULTISET来比较数据集的实例介绍
After watching "Second Uncle", I was even more internalized
Download Win11 how to change the default path?Download Win11 change the default path method
青蛙跳台阶(递归和非递归)-------小乐乐走台阶
TensorFlow2: Overview
MySQL八股文背诵版
LeetCode 0952.按公因数计算最大组件大小:建图 / 并查集
coming!Dongfang Selection brings goods to the live broadcast of Longjiang agricultural products
Weak Banks to data conversion ability?Matt software help solve bank dilemma
FFmpeg —— 将mp4转为gif输出(附源码)
刷题记录----字符串
TensorFlow2:概述
推荐系统:评估指标【离线评估指标:RMSE(均方根误差)、AUC、准确率、召回率、F1】【在线评估:A/B测试】【一般要求响应时间<0.5s】
Cesium loads offline maps and offline terrain
Mapped Statements collection does not contain value for的解决方法
基于人脸的常见表情识别(1)——深度学习基础知识