雲監控對接Grafana


 再阿里雲添加AK賬號授權

 

注意:當AK創建只是用來編程訪問的話,要保存一下信息,不然找不到

 

 開始授權監控的權限。

雲監控檢查主機是否安裝插件添加應用分組

 

 

 當監控插件初始花以后,能看到進程監控,說明就可以了。

 在別的一台阿里雲安裝grafana

[root@iZbp143t3oxhfc3ar7jey0Z ~]# yum localinstall  grafana-5.0.3-1.x86_64.rpm
Loaded plugins: fastestmirror
Examining grafana-5.0.3-1.x86_64.rpm: grafana-5.0.3-1.x86_64
Marking grafana-5.0.3-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package grafana.x86_64 0:5.0.3-1 will be installed
--> Processing Dependency: fontconfig for package: grafana-5.0.3-1.x86_64
Loading mirror speeds from cached hostfile
 * webtatic: us-east.repo.webtatic.com
--> Processing Dependency: urw-fonts for package: grafana-5.0.3-1.x86_64
--> Running transaction check
---> Package fontconfig.x86_64 0:2.13.0-4.3.el7 will be installed
[root@iZbp143t3oxhfc3ar7jey0Z ~]# git clone https://github.com/aliyun/aliyun-cms-grafana.git
Cloning into 'aliyun-cms-grafana'...
remote: Enumerating objects: 48, done.
remote: Counting objects: 100% (48/48), done.
remote: Compressing objects: 100% (38/38), done.
remote: Total 132 (delta 19), reused 21 (delta 8), pack-reused 84
Receiving objects: 100% (132/132), 299.29 KiB | 11.00 KiB/s, done.
Resolving deltas: 100% (49/49), done.

 把插件放進去,並重啟

[root@iZbp143t3oxhfc3ar7jey0Z ~]# service grafana-server start
Starting grafana-server (via systemctl):                   [  OK  ]
[root@iZbp143t3oxhfc3ar7jey0Z ~]# pwd
/root
[root@iZbp143t3oxhfc3ar7jey0Z ~]# mv a
aaa.text            aliyun-cms-grafana/
[root@iZbp143t3oxhfc3ar7jey0Z ~]# mv aliyun-cms-grafana/ /var/lib/grafana/plugins/
[root@iZbp143t3oxhfc3ar7jey0Z ~]# cd /var/lib/grafana/plugins
[root@iZbp143t3oxhfc3ar7jey0Z plugins]# ll
total 4
drwxr-xr-x 6 root root 4096 Apr 11 22:44 aliyun-cms-grafana
[root@iZbp143t3oxhfc3ar7jey0Z plugins]# service grafana-server restart
Restarting grafana-server (via systemctl):                 [  OK  ]
[root@iZbp143t3oxhfc3ar7jey0Z plugins]# lsof -i:3000
COMMAND    PID    USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
grafana-s 2080 grafana    6u  IPv6 10914108      0t0  TCP *:hbci (LISTEN)
grafana-s 2080 grafana    9u  IPv6 10913566      0t0  TCP iZbp143t3oxhfc3ar7jey0Z:hbci->36.5.244.169:16883 (ESTABLISHED)
grafana-s 2080 grafana   10u  IPv6 10914166      0t0  TCP iZbp143t3oxhfc3ar7jey0Z:hbci->36.5.244.169:16884 (ESTABLISHED)
grafana-s 2080 grafana   12u  IPv6 10914168      0t0  TCP iZbp143t3oxhfc3ar7jey0Z:hbci->36.5.244.169:16890 (ESTABLISHED)
grafana-s 2080 grafana   14u  IPv6 10913568      0t0  TCP iZbp143t3oxhfc3ar7jey0Z:hbci->36.5.244.169:16889 (ESTABLISHED)

添加數據源

 添加和配置Dashboard。

單擊左上方的Dashboards,在彈出的列表中選Manage,進入Manage頁面。

Manage

單擊Dashboard,創建Dashboard。

您可以選擇創建一個 Folder后,再創建Dashboard,您也可以導入其他Dashboard。

配置Graph圖表。

  1. New Panel的Add下選擇Graph圖表。
  2. 單擊Pannel Title,在彈出的窗口中單擊Edit。
  3. Metrics配置中,選擇datasource為cms-grafana,配置參數Project、Metric、period、Y軸和X軸。
    Project、Metric、Period等參數詳情,請參見QueryMetricList
    參數 說明
    Group 雲賬戶所在雲監控的應用分組。
    Dimensions Project與Metric所在監控項最新監控數據的實例集合,若選Group,則為該Group下的實例。
    Y-column 可支持多選。
    X-column timestamp。
    Y-column describe 對Y-column的區分描述。
    說明
    • 如果您需要了解更多Graph信息,請單擊Graph
    • 所有參數均可按照QueryMetricList的要求手動輸入。
    • 所有已選擇或已輸入參數均可輸入null取消。
    • 如果對應場景下Dimensions的提示信息不全,則需要刷新或按照樣例手動輸入InstanceId的值即可。
    Metrics
    自定義監控的部分參數信息需要手動輸入,參數說明如下表所示。
    參數 說明
    Project acs_customMetric_+雲賬號ID。
    Metric 上報監控數據的metricName。
    Period 上報監控數據時的Period。
    Group 上報監控數據時的Metric對應的分組ID。
    Dimensions 上報監控數據時的Dimension,暫不支持下拉選擇,只支持輸入單個Dimension,若輸入多個,默認選第一個。
    說明 如果雲監控控制台的dimensions格式為 env: public, step: 5-ReadFromAlertOnline,則請用 &替換示例中的 ,后拼接輸入。
    Y-column 上報監控數據時的Average、Maximum、Minimum、Sum、SampleCount、P10、P20、P99等。
    X-column timestamp。
    自定義監控
  4. 配置Singlestat面板。
      1. New Panel的Add下選擇Singlestat。
      2. 單擊Pannel Title,在彈出的窗口中單擊Edit。
      3. 配置Metric相關參數。
        說明 如果您需了解更多 Singlestat信息,請單擊 Graph
        配置Singlestat面板


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM