1.grafana安装
Download Grafana | Grafana Labs
sudo yum install -y https://dl.grafana.com/oss/release/grafana-11.1.4-1.x86_64.rpm
2.zabbix插件安装
Grafana 默认并没有 zabbix 数据源的支持,只有安装了zabbix插件,才可以在grafana中添加zabbix的数据源,使用zabbix的监控数据绘出图形
[root@120 opt]# grafana-cli plugins list-remote |grep zabbix
id: alexanderzobnin-zabbix-app version: 4.5.2[root@120 opt]# grafana-cli plugins install alexanderzobnin-zabbix-app
INFO [08-20|22:13:36] Starting Grafana logger=settings version= commit= branch= compiled=1970-01-01T08:00:00+08:00
INFO [08-20|22:13:36] Config loaded from logger=settings file=/usr/share/grafana/conf/defaults.ini
INFO [08-20|22:13:36] Config loaded from logger=settings file=/etc/grafana/grafana.ini
INFO [08-20|22:13:36] Config overridden from command line logger=settings arg="default.paths.data=/var/lib/grafana"
INFO [08-20|22:13:36] Config overridden from command line logger=settings arg="default.paths.logs=/var/log/grafana"
INFO [08-20|22:13:36] Config overridden from command line logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
INFO [08-20|22:13:36] Config overridden from command line logger=settings arg="default.paths.provisioning=/etc/grafana/provisioning"
INFO [08-20|22:13:36] Target logger=settings target=[all]
INFO [08-20|22:13:36] Path Home logger=settings path=/usr/share/grafana
INFO [08-20|22:13:36] Path Data logger=settings path=/var/lib/grafana
INFO [08-20|22:13:36] Path Logs logger=settings path=/var/log/grafana
INFO [08-20|22:13:36] Path Plugins logger=settings path=/var/lib/grafana/plugins
INFO [08-20|22:13:36] Path Provisioning logger=settings path=/etc/grafana/provisioning
INFO [08-20|22:13:36] App mode production logger=settings
✔ Downloaded and extracted alexanderzobnin-zabbix-app v4.5.2 zip successfully to /var/lib/grafana/plugins/alexanderzobnin-zabbix-appPlease restart Grafana after installing or removing plugins. Refer to Grafana documentation for instructions if necessary.[root@120 opt]#
重启grafana
[root@120 opt]# systemctl enable grafana-server --now
Created symlink from /etc/systemd/system/multi-user.target.wants/grafana-server.service to /usr/lib/systemd/system/grafana-server.service.
[root@120 opt]# netstat -natp |grep grafana
tcp6 0 0 :::3000 :::* LISTEN 5620/grafana
[root@120 opt]#
3.访问grafana-server的web
ip+3000 用户名:admin 密码:admin
首次登录需要重置密码
设置中文
4.开启zabbix的插件
5.添加zabbix数据源
6.添加dashboard
寻找模版:https://grafana.com/grafana/dashboards
注:zabbix 本身监控效果就很好了。 工作中没有特殊要求,不用将 zabbix 和 grafana 相结合。