当前位置:网站首页>【监控】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已经启动
二、结语
- 搭建很简单,没啥好说的,主要是会看图形界面
边栏推荐
- 推荐收藏:跨云数据仓库(data warehouse)环境搭建,这货特别干!
- Why does infographic help your SEO
- A complete tutorial for getting started with redis: understanding and using APIs
- Question brushing guide public
- 【ODX Studio编辑PDX】-0.2-如何对比Compare两个PDX/ODX文件
- CTF竞赛题解之stm32逆向入门
- Examples of time (calculation) total tools: start time and end time of this year, etc
- After Microsoft disables the IE browser, open the IE browser to flash back the solution
- The caching feature of docker image and dockerfile
- Excel shortcut keys - always add
猜你喜欢
取得PMP证书需要多长时间?
Combien de temps faut - il pour obtenir un certificat PMP?
Why does infographic help your SEO
一次edu证书站的挖掘
A complete tutorial for getting started with redis: getting to know redis for the first time
cout/cerr/clog的区别
French scholars: the explicability of counter attack under optimal transmission theory
EditPlus--用法--快捷键/配置/背景色/字体大小
[graph theory] topological sorting
为什么信息图会帮助你的SEO
随机推荐
Excel 快捷键-随时补充
CTF競賽題解之stm32逆向入門
如何报考PMP项目管理认证考试?
【ODX Studio编辑PDX】-0.2-如何对比Compare两个PDX/ODX文件
Hong Kong Jewelry tycoon, 2.2 billion "bargain hunting" Giordano
UML diagram memory skills
SPH中的粒子初始排列问题(两张图解决)
debug和release的区别
位运算符讲解
MySQL数据库备份与恢复--mysqldump命令
P2181 diagonal and p1030 [noip2001 popularization group] arrange in order
Redis introduction complete tutorial: List explanation
Servlet+JDBC+MySQL简单web练习
[crawler] XPath for data extraction
ffmpeg快速剪辑
[ODX studio edit PDX] -0.3- how to delete / modify inherited elements in variant variants
ScriptableObject
The Chinese output of servlet server and client is garbled
Solution record of jamming when using CAD to move bricks in high configuration notebook
Application of machine learning in housing price prediction