当前位置:网站首页>【监控】zabbix
【监控】zabbix
2022-07-04 23:12:00 【雪碧不要气】
前言
本博客内容仅为记录博主思路,仅供参考,一切以自己实践结果为准。
一、搭建
1.1 直接上步骤
#zabbix服务端
systemctl disable --now firewalld
setenforce 0
hostnamectl set-hostname zbx-server
su
rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
cd /etc/yum.repos.d
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' zabbix.repo
yum clean all && yum makecache
yum install -y zabbix-server-mysql zabbix-agent
yum install -y centos-release-scl
vim zabbix.repo
11行:enable=1
yum install -y zabbix-web-mysql-scl zabbix-apache-conf-scl
#安装mariadb数据库并设置开机自启
yum install -y mariadb-server mariadb
systemctl enable --now mariadb
#配置数据库密码
mysql_secure_installation
回车
y
设置数据库密码
确认密码
一路回车到最后
#进入数据库为zabbix授权
mysql -u root -pabc123
CREATE DATABASE zabbix character set utf8 collate utf8_bin;
GRANT all ON zabbix.* TO 'zabbix'@'%' IDENTIFIED BY 'zabbix';
flush privileges;
#查询数据库sql文件的位置,是个.gz结尾的压缩包
rpm -ql zabbix-server-mysql
#我的版本号是下面这个
/usr/share/doc/zabbix-server-mysql-5.0.24/create.sql.gz
#用zcat查询压缩包内容,并传参给数据库进行导入
zcat //usr/share/doc/zabbix-server-mysql-5.0.24/create.sql.gz | mysql -uroot -pabc123 zabbix
vim /etc/zabbix/zabbix_server.conf
124行:DBPassword=zabbix
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai
systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
浏览器访问:192.168.13.10/zabbix
只需要设置数据库的密码 zabbix
登陆账号:Admin 密码:zabbix
页面配置:
左下方:user settings
选项:language -> Chinese -> update(语言修改为中文)
#当客户端配置完毕后,可执行以下命令验证客户端时候启动成功,查询客户端名称
yum install -y zabbix-get
zabbix_get -s '192.168.13.20' -p 10050 -k 'agent.ping'
zabbix_get -s '192.168.13.20' -p 10050 -k 'system.hostname'
#zabbix客户端配置
systemctl disable --now firewalld
setenforce 0
hostnamectl set-hostname zbx-agent01
su
yum install -y ntpdate
ntpdate -u ntp.aliyun.com
cp -p /etc/localtime{
,.bak}
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
cd /etc/yum.repos.d
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
yum install -y zabbix-agent2
vim /etc/zabbix/zabbix_agent2.conf
80行:Server=192.168.13.10
120行:ServerActive=192.168.13.10
131行:Hostname=zbx-agent01
systemctl start zabbix-agent2
systemctl enable zabbix-agent2
netstat -natp | grep zabbix
进入服务端web界面进行配置
配置->主机->创建主机
主机:
主机名称:zbx-agent01
可见的名称:zbx-agent01-192.168.80.30
群组:Linux servers
客户端:192.168.80.30
模板:
Link new templates:Template OS Linux by Zabbix agent
#随意切换下左侧的选项,再切换回来,zbx已经启动
二、结语
- 搭建很简单,没啥好说的,主要是会看图形界面
边栏推荐
猜你喜欢
CTF竞赛题解之stm32逆向入门
QT personal learning summary
CTF競賽題解之stm32逆向入門
壁仞科技研究院前沿技术文章精选
How long does it take to obtain a PMP certificate?
uniapp 除了数字,其他输入无效
Redis:Redis的事务
How to apply for PMP project management certification examination?
The initial trial is the cross device model upgrade version of Ruijie switch (taking rg-s2952g-e as an example)
Excel shortcut keys - always add
随机推荐
P2181 对角线和P1030 [NOIP2001 普及组] 求先序排列
Redis getting started complete tutorial: Key Management
UML diagram memory skills
Font design symbol combination multifunctional wechat applet source code
【爬虫】数据提取之JSONpath
PICT 生成正交测试用例教程
【ODX Studio编辑PDX】-0.2-如何对比Compare两个PDX/ODX文件
Explanation of bitwise operators
How to choose a securities company? Is it safe to open an account on your mobile phone
【js】-【动态规划】-笔记
Paddleocr tutorial
Galera cluster of MariaDB - dual active and dual active installation settings
刷题指南-public
Combien de temps faut - il pour obtenir un certificat PMP?
Basic knowledge of database
ECCV 2022 | Tencent Youtu proposed disco: the effect of saving small models in self supervised learning
高通WLAN框架学习(30)-- 支持双STA的组件
Redis introduction complete tutorial: detailed explanation of ordered collection
C language to quickly solve the reverse linked list
A complete tutorial for getting started with redis: getting to know redis for the first time