Centos 9.0 + zabbix 6.2.3 +grafana6.7

一、执行rpm安装包

 rpm -Uvh https://repo.zabbix.com/zabbix/6.2/rhel/9/x86_64/zabbix-release-6.2-3.el9.noarch.rpm

二、删除已缓存的数据

dnf clean all

三、安装zabbix组件

dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

 

 

 四、安装mysql

dnf -y install mysql-server

 

 

 五、初始化MYSQL控制台

mysqld --initialize --console

 

 

 六、授权./var/libo/mysql给mysql用户组

chown -R mysql:mysql /var/lib/mysql

七、 启动mysql服务

systemctl start mysqld

八、查看mysql的临时密码

cat /var/log/mysql/mysqld.log | grep localhost

mysql -uroot -p
(FX+SaaP41Oj          #输入临时密码
alter user 'root'@'localhost' identified by 'Zabbix@123';                        #设置mysql的root登录密码Zabbix@123
create database zabbix character set utf8mb4 collate utf8mb4_bin; #在mysql创建数据库中创建一个帐号为zabbix的帐号
create user zabbix@localhost identified by 'Zabbix@123'; #设置mysql的zabbix的帐号密码为Zabbbix@123
grant all privileges on zabbix.* to zabbix@localhost; #授权
quit;

九、导入数据架构


zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix
Enter password: #输入密码
注意:如果导入失败,则需要查询 find / -name server.sq 的文件在那个目录?然后再重新导入

 

 十、修改zabbix配置文件,将数据zabbix库的密码输入配置文件中

cd  /etc/zabbix/
vim zabbix_server.conf

 

 

 十一、

systemctl restart zabbix-server zabbix-agent2 httpd php-fpm      #重启一下zabbix等服务
systemctl enable zabbix-server zabbix-agent2 httpd php-fpm
systemctl restart mysqld.service                                 #重启一下数据库服务器

 

 

 

 

 十二、设置语言为中文

dnf install langpacks-zh_CN.noarch

  

十三、安装grafana6.7版本,打开官网:https://grafana.com/grafana/download/6.7.6?pg=graf&plcmt=deploy-box-1&edition=oss

yum install -y https://dl.grafana.com/oss/release/grafana-6.7.6-1.x86_64.rpm
systemctl start grafana-server.service
systemctl enable grafana-server.service

 

 

 

 

 

 

 

 

 十四、安装zabbix等插件,输入grafana地址http://172.21.32.128:3000

输入:https://grafana.com/grafana/plugins/?utm_source=grafana_add_ds&search=zabbix

grafana-cli plugins install alexanderzobnin-zabbix-app

 

 

 

 

 

 

 

 

 

接口配置说明

zabbix基于Apache部署,接口地址格式为http://zabbix-server-ip/zabbix/api_jsonrpc.php
zabbix基于nginx部署, 接口地址格式为http://zabbix-server-ip:8080/api_jsonrpc.php

 

 

 

 

 

 

 

 十五、安装其它的插件

饼图插件:grafana-cli plugins install grafana-piechart-panel
时钟插件:grafana-cli plugins install grafana-clock-panel

软件及插件下载 https://download.csdn.net/download/weixin_40343238/88225780  

 

 

 

  

 

 

 

 

  

  

  

 

  

  

 

posted @ 2022-10-14 17:23  聆听城市喧哗  阅读(50)  评论(0编辑  收藏  举报