一、在线安装
如果不指定安装位置,则默认安装位置为/var/lib/grafana/plugins 插件安装完成之后需要重启grafana
命令在上一篇讲到过
//查看相关帮助
[root@localhost ~]# grafana-cli plugins --help
//从列举中的插件过滤zabbix插件
[root@localhost ~]# grafana-cli plugins list-remote |grep zabbix
id: alexanderzobnin-zabbix-app version: 3.12.4
//依据id安装插件
[root@localhost ~]# grafana-cli plugins install alexanderzobnin-zabbix-app
installing alexanderzobnin-zabbix-app @ 3.12.4
from: https://grafana.com/api/plugins/alexanderzobnin-zabbix-app/versions/3.12.4/download
into: /var/lib/grafana/plugins
✔ Installed alexanderzobnin-zabbix-app successfully
Restart grafana after installing plugins . <service grafana-server restar
二、离线安装
访问https://grafana.com/grafana/plugins/all-plugins/
- 搜索需要的插件,选好与grafana版本匹配的版本。
2. 点击installtion然后下拉选择与服务器匹配的安装包
![](https://i-blog.csdnimg.cn/direct/b78d08d7dba34fcea5ffd23284181b69.png)
3. 下载好后上传到服务器解压并移动到插件目录
# 解压
[root@localhost ~]# unzip alexanderzobnin-zabbix-app-5.0.0.gpx_zabbix-datasource_linux_amd64.zip
# 移动到plugins 文件夹中
[root@localhost ~]# mv alexanderzobnin-zabbix-app /var/lib/grafana/plugins
# 重启grafana-server使生效。
[root@localhost ~]# systemctl restart grafana-server
三、配置zabbix数据源
先要enable才能看的到,一次点击 管理 - 插件 - zabbix
在 连接 - 数据 - 添加数据源 - 选择zabbix
![](https://i-blog.csdnimg.cn/direct/40026c881ac14dc9bca18988a10a240c.png)
![](https://i-blog.csdnimg.cn/direct/f741ec33ba4d4b6c888446250377f18e.png)
url写zabbix的api接口
http://192.168.199.123:80/api_jsonrpc.php
![](https://i-blog.csdnimg.cn/direct/206df3cfd56d4bca9e870743d3b0c21d.png)
这边只填写登录zabbix的账号密码即可(一般都是给一个只读用户就好)
下拉到最后保存测试(绿色装填为成功)
![](https://i-blog.csdnimg.cn/direct/692442bde4dc48e59dd4cac91700df1c.png)