当前位置:网站首页>zabbix监控系统部署
zabbix监控系统部署
2022-07-04 07:37:00 【拥抱云原生】
zabbix程序组件
zabbix组件有:
- Zabbix_server,服务端守护进程.
- Zabbix_agentd,agent守护进程
- zabbix_proxy,代理服务器
- zabbix_database,存储系统,mysql,pgsql
- Zabbix_web,web GUI图形化界面
- Zabbix_get,命令行工具,测试向agent发起数据采集请求.
- Zabbix_sender,命令行工具,测试向server发送数据
- Zabbix_java_gateway,java网关
zabbix服务端部署
zabbix5.0版本对php版本的要求,最低是7.2.0版本;对php扩展组件版本也有要求,详细可查看官方文档
https://www.zabbix.com/documentation/5.0/zh/start
准备好一台Linux服务器,设置好IP地址,yum源等
1.设置主机名
[[email protected] ~]# hostnamectl set-hostname server
[[email protected] ~]# hostname
server
2.关闭防火墙,selinux
[[email protected] ~]# systemctl stop firewalld && systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[[email protected] ~]# setenforce 0
[[email protected] ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
3.zabbix-server内存尽量更大点,4G为好(以下2G)
[[email protected] ~]# free -m
total used free shared buff/cache available
Mem: 1980 120 1446 9 414 1661
Swap: 2047 0 2047
4.获取zabbix下载源
rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
5.更换zabbix.repo源为阿里的
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
6.清空yum源缓存,生成新的缓存
yum clean all
yum makecache
7.安装zabbix server和agent
yum install -y zabbix-server-mysql zabbix-agent
8.安装Software Collections,便于后续安装高版本的php,默认yum安装php版本为5.4过低;SCL(Software Collections)可以在同一个操作系统上安装和使用多个版本的软件,而不会影响整个系统的安装包;软件包会安装在/opt/rh目录下;/etc/opt/rh/软件包所有配置文件都存储在目录中的相应的目录中
[[email protected] ~]# yum install -y centos-release-scl
9.在zabbix.repo源开启zabbix-front前端源
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/frontend
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
10.安装zabbix前端环境,且是安装在scl环境下
[[email protected] ~]# yum install -y zabbix-web-mysql-scl zabbix-apache-conf-scl
11.安装azbbix所需的数据库,mariadb/mysql
[[email protected] ~]# yum install mariadb-server -y
12.配置数据库开机启动
[[email protected] ~]# systemctl enable --now mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
13.初始化数据库并设置root密码
[[email protected] ~]# mysql_secure_installation
14.添加数据库用户以及zabbix所需的数据库信息
[[email protected] ~]# mysql -uroot -pqhj666
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> create user [email protected] identified by 'qhj666';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all on zabbix.* to [email protected];
Query OK, 0 rows affected (0.00 sec)
15.使用zabbix-mysql命令,导入数据库信息(这里-p后面指定的是zabbix数据库)
[[email protected] ~]# zcat /usr/share/doc/zabbix-server-mysql-5.0.11/create.sql.gz | mysql -uzabbix -p zabbix
Enter password:
16.修改zabbix server配置文件,修改数据库的密码
[[email protected] ~]# grep "^DBP" /etc/zabbix/zabbix_server.conf
DBPassword=qhj666
17.修改zabbix的php配置文件
[[email protected] ~]# tail -1 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai
18.启动zabbix相关服务
[[email protected] ~]# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
[[email protected] ~]# systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
19.浏览器测试访问zabbix(默认账号Admin,密码zabbix)
192.168.10.50/zabbix
部署完成后
使用浏览器访问:http://192.168.10.50/zabbix
默认密码:Admin/zabbix
边栏推荐
- MySQL中的文本处理函数整理,收藏速查
- Unity opens the explorer from the inspector interface, selects and records the file path
- Activiti常見操作數據錶關系
- 促进OKR落地的工作总结该如何写?
- Jianmu continuous integration platform v2.2.2 release
- Zephyr 学习笔记1,threads
- When JDBC connects to es query, is there a God who meets the following situation?
- Preliminary study on temporal database incluxdb 2.2
- [Flink] temporal semantics and watermark
- How to send mail with Jianmu Ci
猜你喜欢

Oracle-存储过程与函数

L2-013 red alarm (C language) and relevant knowledge of parallel search

tornado项目之路由装饰器

Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction

BUUCTF(3)

window上用.bat文件启动项目

提升复杂场景三维重建精度 | 基于PaddleSeg分割无人机遥感影像

【森城市】GIS数据漫谈(一)

节点基础~节点操作

Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
随机推荐
[Flink] temporal semantics and watermark
Book list | as the technical support Party of the Winter Olympics, Alibaba cloud's technology is written in these books!
tornado之目录
Zephyr 學習筆記2,Scheduling
When JDBC connects to es query, is there a God who meets the following situation?
Improve the accuracy of 3D reconstruction of complex scenes | segmentation of UAV Remote Sensing Images Based on paddleseg
Preliminary study on temporal database incluxdb 2.2
L1-025 positive integer a+b (15 points)
Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
Rhcsa the next day
手写简易版flexible.js以及源码分析
How to write a summary of the work to promote the implementation of OKR?
[untitled] notice on holding "2022 traditional fermented food and modern brewing technology"
The idea of implementing charts chart view in all swiftui versions (1.0-4.0) was born
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
神经网络入门(下)
促进OKR落地的工作总结该如何写?
输入年份、月份,确定天数
Two years ago, the United States was reluctant to sell chips, but now there are mountains of chips begging China for help
Distributed transaction management DTM: the little helper behind "buy buy buy"