前言
官方文档,我看了要付费的
https://help.aliyun.com/document_detail/313316.html?spm=a2c4g.217924.0.i2
grafana:8.3.5
插件名称:aliyun-cms-services
grafana安装:
https://blog.csdn.net/qq_44379042/article/details/121852310
离线安装aliyun-cms-services
下载aliyun cms services,并移到到grafana的插件文件夹下(离线安装插件都是这种方法)
cd /var/lib/grafana/plugins/
git clone https://github.com/aliyun/aliyun-cms-grafana.git
service grafana-server restart
二 通过aliyun-cms-services插件,监控多个阿里云账户下资源
1下载插件并进行权限配置
[root@grafana_server tmp]# wegt https://github.com/aliyun/aliyun-cms-grafana/releases/download/V2.1/aliyun_cms_grafana_datasource_v2.1.tar.gz
[root@grafana_server tmp]# tar xf aliyun_cms_grafana_datasource_v2.1.tar.gz
[root@grafana_server tmp]# ll aliyun_cms_grafana_datasource
total 4
drwxr-xr-x 7 502 games 4096 Nov 23 2021 dist
[root@grafana_server tmp]# cd aliyun_cms_grafana_datasource/dist/
[root@grafana_server dist]# ls
cms-datasource_linux_amd64 cms-datasource_windows_amd64.exe datasource.js img module.js partials query_ctrl.js README.md sha1.js.map signer.js.map util.js
cms-datasource_linux_arm64 css datasource.js.map json module.js.map plugin.json query_ctrl.js.map sha1.js signer.js test util.js.map
[root@grafana_server dist]# chmod +x cms-datasource*
2 安装插件
[root@grafana_server dist]# cd /var/lib/docker/volumes/grafana/_data/plugins/
[root@grafana_server plugins]# mkdir aliyun_cms_grafana_datasource
[root@grafana_server plugins]# ll
total 8
drwxr-xr-x 7 grafana root 4096 Mar 29 14:15 alexanderzobnin-zabbix-app
drwxr-xr-x 2 root root 4096 Jun 7 10:49 aliyun_cms_grafana_datasource[root@grafana_server plugins]# cd aliyun_cms_grafana_datasource/
[root@grafana_server aliyun_cms_grafana_datasource]# pwd
/var/lib/docker/volumes/grafana/_data/plugins/aliyun_cms_grafana_datasource
[root@grafana_server aliyun_cms_grafana_datasource]# cp -r /tmp/aliyun_cms_grafana_datasource/dist ./
[root@grafana_server aliyun_cms_grafana_datasource]# ll
total 4
drwxr-xr-x 7 root root 4096 Jun 7 10:50 dist
[root@grafana_server aliyun_cms_grafana_datasource]# cd ..
[root@grafana_server plugins]# chown -R grafana.root aliyun_cms_grafana_datasource#允许未签名插件运行
[root@grafana_server plugins]# vim /etc/grafana/grafana.ini
allow_loading_unsigned_plugins = aliyun_cms_grafana_datasource#重启grafana
[root@grafana_server~]# docker restart grafana
3登录grafana的web页面,安装 aliyun_cms_grafana_datasource
4 出于安全考虑,我将重新创建用户,并只能通过 OpenAPI 调用访问来访问
4.1 添加用户权限
权限 | 说明 |
---|---|
AliyunCloudMonitorFullAccess | 管理云监控(CloudMonitor)的权限 |
AliyunCloudMonitorReadOnlyAccess | 只读访问云监控(CloudMonitor)的权限 |
4.2 并重新配置本地grafana的aliyun-cms-services数据源信息
5 添加New dashboard folder 仪表盘文件夹
6 添加数据仪表盘
6.1 监控ECS的Cpu,VPC公网ip的流量
ECS的VPC公网ip的流量
ECS的Cpu
7 添加多个阿里云监控数据源
加就完了