当前位置:网站首页>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步骤配置即可
边栏推荐
- MySQL夺命10问,你能坚持到第几问?
- Install MySQL tutorial under Linux
- Mac安装PHP开发环境
- MySQL performance optimization (hardware, system configuration, table structure, SQL statements)
- Day31 LeetCode
- The JDBC programming of the MySQL database
- PHP低代码开发引擎—表单设计
- Based on the face of the common expression recognition - model building, training and testing
- jOOQ是如何设计事务API(详细指南)
- Can't find the distributed lock of Redisson?
猜你喜欢
Linux下最新版MySQL 8.0的下载与安装(详细步骤)
ELK log analysis system
来了!东方甄选为龙江农产品直播带货
MySQL performance optimization (hardware, system configuration, table structure, SQL statements)
iPhone真是十三香?两代产品完全对比,或许上一代更值得买
mysql慢查询优化
【PyTorchVideo教程01】快速实现视频动作识别
Database Tuning - Database Tuning
Encapsulates a console file selector based on inquirer
推荐系统:冷启动问题【用户冷启动、物品冷启动、系统冷启动】
随机推荐
Weak Banks to data conversion ability?Matt software help solve bank dilemma
Recommendation system: evaluation index [offline evaluation index: RMSE (root mean square error), AUC, precision, recall, F1] [online evaluation: A/B test] [generally required response time <0.5s]
mysql慢查询优化
试写C语言三子棋
Linux下最新版MySQL 8.0的下载与安装(详细步骤)
Recommendation system-model: FNN model (FM+MLP=FNN)
How to build FTP server under win2003
MySQL eight-part text recitation version
055 c# print
Cesium loads offline maps and offline terrain
Based on the face of the common expression recognition - model building, training and testing
Mapped Statements collection does not contain value for的解决方法
Frog jumping steps (recursive and non-recursive) ------- Xiaolele walks the steps
推荐系统:冷启动问题【用户冷启动、物品冷启动、系统冷启动】
.eslintrc.js for musicApp
musicApp 的.eslintrc.js
Linux download and install mysql5.7 version tutorial the most complete and detailed explanation
After MySQL grouping, take the largest piece of data [optimal solution]
These services can't ali interview?Then don't go to, the basic notification, etc
使用MULTISET来比较数据集的实例介绍