前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Zabbix(2)-Zabbix安装

Zabbix(2)-Zabbix安装

作者头像
mikelLam
发布2022-10-31 14:55:10
6830
发布2022-10-31 14:55:10
举报
文章被收录于专栏:Kubernetes 与 Devops 干货分享

部署规划

服务器系统: CentOS Linux release 7.8.2003 (Core)

主机类型

IP地址

zabbix-server

192.168.100.26

zabbix-agent

192.168.100.26

zabbix-mysql

192.168.100.26

zabbix 安装

https://www.zabbix.com/documentation/5.0/zh/manual #产品手册

Zabbix-server 安装配置

下载安装:https://www.zabbix.com/download?zabbix=5.0&os_distribution=centos&os_version=7&db=mysql&ws=nginx

https://tc.ctq6.cn/tc/20220630073243.png
https://tc.ctq6.cn/tc/20220630073243.png
zabbix-serber 安装
  • Install Zabbix repository
代码语言:shell
复制
yum install -y wget
wget https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm --no-check-certificate
rpm -Uvh zabbix-release-5.0-1.el7.noarch.rpm
yum clean all
  • Install Zabbix server and agent
代码语言:text
复制
yum install zabbix-server-mysql zabbix-agent
  • Install Zabbix frontend
代码语言:text
复制
yum install centos-release-scl -y
  • Install Zabbix frontend packages
代码语言:text
复制
sed -i 's@enabled=1@enabled=1@g' /etc/yum.repo.d/zabbix.repo
yum install zabbix-web-mysql-scl zabbix-nginx-conf-scl -y
  • Install mysql
代码语言:shell
复制
wget http://repo.mysql.com/mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
yum install mysql-server mysql -y
systemctl start mysqld
# 修改密码,配置远程访问
password=`grep 'temporary password' /var/log/mysqld.log|awk '{print $NF}'`;mysql -uroot -p${password}
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.38

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'lok@dWcv%anCCp57kMJv';
Query OK, 0 rows affected (0.00 sec)

mysql> update mysql.user set Host='%' where User='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
  • Create initial database
代码语言:shell
复制
# 创建数据库
mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

mysql> create user zabbix@localhost identified by 'SPj2a@#@1^@yEd9EN3S5';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> quit
Bye
# 导入数据
gzip -dv /usr/share/doc/zabbix-server-mysql*/create.sql.gz
mysql -uzabbix -p zabbix;
source /usr/share/doc/zabbix-server-mysql*/create.sql
# Edit file /etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
SocketDir=/var/run/zabbix
DBHost=172.20.32.104
DBName=zabbix
DBUser=zabbix
DBPassword=123456
DBPort=3306
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
FpingLocation=/usr/bin/fping
Fping6Location=/usr/bin/fping6
LogSlowQueries=3000

Configure PHP for Zabbix frontend

Edit file /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf, uncomment and set ‘listen’ and ‘server_name’ directives.

代码语言:text
复制
# listen 7000;
# server_name zabbix.ctq6.cn;

Edit file /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf, add nginx to listen.acl_users directive.

代码语言:text
复制
listen.acl_users = apache,nginx

Then uncomment and set the right timezone for you.

代码语言:text
复制
php_value[date.timezone] = Asia/ShangHai

Start Zabbix server and agent processes

代码语言:shell
复制
systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm
web界面安装

访问:http://192.168.100.209:7000/setup.php

1、默认安装界面

https://tc.ctq6.cn/tc/20220715063720.png
https://tc.ctq6.cn/tc/20220715063720.png

2、配置mysql账号密码

https://tc.ctq6.cn/tc/20220715064048.png
https://tc.ctq6.cn/tc/20220715064048.png

3、zabbix 服务器信息

https://tc.ctq6.cn/tc/20220715064728.png
https://tc.ctq6.cn/tc/20220715064728.png

4、概要信息,确认

https://tc.ctq6.cn/tc/20220715064835.png
https://tc.ctq6.cn/tc/20220715064835.png

5、完成安装界面

https://tc.ctq6.cn/tc/20220715064904.png
https://tc.ctq6.cn/tc/20220715064904.png

6、登陆界面,默认账号密码Admin/zabbix

https://tc.ctq6.cn/tc/20220715065007.png
https://tc.ctq6.cn/tc/20220715065007.png

7、安装完成后,显示server runnning

https://tc.ctq6.cn/tc/20220715073158.png
https://tc.ctq6.cn/tc/20220715073158.png
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-06-30,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 部署规划
  • zabbix 安装
    • Zabbix-server 安装配置
      • zabbix-serber 安装
      • web界面安装
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档