当前位置:网站首页>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 error resolution - error 1261 (01000): row 1 doesn't contain data for all columns
- win10微软拼音输入法输入文字时候下方不出现中文提示
- 2022-021rts: from the second half of the year
- Types of references in BibTex
- Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
- The cloud native programming challenge ended, and Alibaba cloud launched the first white paper on application liveliness technology in the field of cloud native
- A real penetration test
- Routing decorator of tornado project
- Zephyr 学习笔记1,threads
- 线性代数1.1
猜你喜欢
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
Chain ide -- the infrastructure of the metauniverse
I was pressed for the draft, so let's talk about how long links can be as efficient as short links in the development of mobile terminals
Zephyr study notes 2, scheduling
手写简易版flexible.js以及源码分析
This monitoring system can monitor the turnover intention and fishing all, and the product page has 404 after the dispute appears
Unity 从Inspector界面打开资源管理器选择并记录文件路径
Tri des fonctions de traitement de texte dans MySQL, recherche rapide préférée
Zephyr Learning note 2, Scheduling
[C language] open the door of C
随机推荐
University stage summary
JVM中堆概念
How to send mail with Jianmu Ci
Flask 常用组件
输入年份、月份,确定天数
Pangu open source: multi support and promotion, the wave of chip industry
Guoguo took you to write a linked list, and the primary school students said it was good after reading it
Electronic Association C language level 1 35, bank interest
两年前美国芯片扭捏着不卖芯片,如今芯片堆积如山祈求中国帮忙
Summary of MySQL common judgment functions!! Have you used it
Book list | as the technical support Party of the Winter Olympics, Alibaba cloud's technology is written in these books!
电子协会 C语言 1级 34 、分段函数
There is no Chinese prompt below when inputting text in win10 Microsoft Pinyin input method
With excellent strength, wangchain technology, together with IBM and Huawei, has entered the annual contribution list of "super ledger"!
Amd RX 7000 Series graphics card product line exposure: two generations of core and process mix and match
BUUCTF(4)
Oceanbase is the leader in the magic quadrant of China's database in 2021
Docker install MySQL
[C language] open the door of C
论文学习——基于极值点特征的时间序列相似性查询方法