Linux下Zabbix5.0 LTS + Grafana8.2.2图形可视化

Grafana是一款开源的可视化软件,可以搭配数据源实现一个数据的展示和分析;Grafana功能强大,有着丰富的插件,但Grafana默认没有zabbix作为数据源,需要手动给zabbix安装一个插件,本文将使用Grafana搭配Zabbix的数据源进行资源监控的可视化展示分析。

Grafana官方文档】【Grafana官方下载

ZabbixServer-01上部署

# 官方grafana-8.2.2-1.x86_64.rpm -- SHA256: 67a4ec2408ba97e53f98921a78867f94d434be36fbb36f6409f3db559b06974f 
# 下载安装指定版本grafana
[root@ZabbixServer-01 ~]# wget //dl.grafana.com/oss/release/grafana-8.2.2-1.x86_64.rpm
[root@ZabbixServer-01 ~]# sha256sum grafana-8.2.2-1.x86_64.rpm
67a4ec2408ba97e53f98921a78867f94d434be36fbb36f6409f3db559b06974f  grafana-8.2.2-1.x86_64.rpm
[root@ZabbixServer-01 ~]# yum localinstall -y grafana-8.2.2-1.x86_64.rpm

# 查看安装产生的文件
[root@ZabbixServer-01 ~]# rpm -ql grafana | less
/etc/grafana
/etc/init.d/grafana-server
/etc/sysconfig/grafana-server
/usr/lib/systemd/system/grafana-server.service
/usr/sbin/grafana-cli
/usr/sbin/grafana-server
/usr/share/grafana/VERSION
/usr/share/grafana/bin/grafana-cli
/usr/share/grafana/conf/defaults.ini
......

# 启动并设置开机自启动
[root@ZabbixServer-01 ~]# systemctl start grafana-server && systemctl enable grafana-server
[root@ZabbixServer-01 ~]# netstat -nuplt | grep grafana
tcp6       0      0 :::3000                 :::*                    LISTEN      1825/grafana-server
[root@ZabbixServer-01 ~]# ps -ef | grep grafana
grafana    1825      1  0 09:30 ?        00:00:00 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=rpm \
cfg:default.paths.logs=/var/log/grafana cfg:default.paths.data=/var/lib/grafana cfg:default.paths.plugins=/var/lib/grafana/plugins cfg:default.paths.provisioning=/etc/grafana/provisioning

# 查找zabbix插件并添加
[root@ZabbixServer-01 ~]# grafana-cli plugins list-remote | grep zabbix
id: alexanderzobnin-zabbix-app version: 4.2.4
[root@ZabbixServer-01 ~]# grafana-cli plugins install alexanderzobnin-zabbix-app
[root@ZabbixServer-01 ~]# echo 'allow_loading_unsigned_plugins = alexanderzobnin-zabbix-datasource' >> /etc/grafana/grafana.ini
[root@ZabbixServer-01 ~]# systemctl restart grafana-server
[root@ZabbixServer-01 ~]# hostname -I
172.16.70.37

 Grafana Web设置

# 访问
//172.16.70.37:3000/login

# 初始登录
用户:admin
密码:admin

# 登录后让你重新配置新的密码
zabbix

 

这里上传【官方模板

显示最终仪表盘。