Linux下安装grafana并且添加influxdb监控的方法

topswim 2019-12-03

å®è£grafanaï¼å®ç½æä¾äºubuntuçå®è£åï¼ç´æ¥è¿è¡å®è£

wget https://dl.grafana.com/oss/release/grafana_6.5.1_amd64.deb 
dpkg -i grafana_6.5.1_amd64.deb 
update-rc.d grafana-server defaults 95 10
service grafana-server start

使ç¨influxdbçhttp apiæ·»å æ°æ®åæ¥è¯¢æ°æ®

æ·»å æ°æ®

while true;do curl -i -XPOST 'http://127.0.0.1:8086/write?db=sinamail' --data-binary "webface,ip=10.2.2.1,httpstatus=404 prototype=\"GET /favicon.ico HTTP/1.1\" `date +%s`000000000";done

æ¥è¯¢æ°æ®

curl -GET 'http://127.0.0.1:8086/query?pretty=true' --data-urlencode "db=sinamail" --data-urlencode "q=SELECT * FROM webface where httpstatus='404'"

æ·»å grafanaçinfluxdbæ°æ®æº

Linux下安装grafana并且添加influxdb监控的方法

Linux下安装grafana并且添加influxdb监控的方法

æ¥è¯¢è¡¨æ°æ®ç»å¶åºæ线å¾

Linux下安装grafana并且添加influxdb监控的方法

{
 "xhrStatus": "complete",
 "request": {
  "method": "GET",
  "url": "api/datasources/proxy/1/query",
  "params": {
   "db": "sinamail",
   "q": "SELECT count(\"prototype\") FROM \"webface\" WHERE (\"httpstatus\" = '404') AND time >= now() - 15m GROUP BY time(1m) fill(null)",
   "epoch": "ms"
  },
  "data": null,
  "precision": "ms"
 },
 "response": {
  "results": [
   {
    "statement_id": 0,
    "series": [
     {
      "name": "webface",
      "columns": [
       "time",
       "count"
      ],
      "values": [
       [
        1575211320000,
        0
       ],
       [
        1575211380000,
        0
       ],
       [
        1575211440000,
        0
       ],
       [
        1575211500000,
        0
       ],
       [
        1575211560000,
        1
       ],
       [
        1575211620000,
        0
       ],
       [
        1575211680000,
        4
       ],
       [
        1575211740000,
        8
       ],
       [
        1575211800000,
        0
       ],
       [
        1575211860000,
        0
       ],
       [
        1575211920000,
        41
       ],
       [
        1575211980000,
        8
       ],
       [
        1575212040000,
        0
       ],
       [
        1575212100000,
        0
       ],
       [
        1575212160000,
        0
       ],
       [
        1575212220000,
        0
       ]
      ]
     }
    ]
   }
  ]
 }
}

æ»ç»

以ä¸æè¿°æ¯å°ç¼ç»å¤§å®¶ä»ç»çLinuxä¸å®è£grafana并ä¸æ·»å influxdbçæ§çæ¹æ³ï¼å¸æ对大家ææ帮å©ï¼å¦æ大家æä»»ä½çé®è¯·ç»æçè¨ï¼å°ç¼ä¼åæ¶åå¤å¤§å®¶çãå¨æ­¤ä¹é常æ谢大家对èæ¬ä¹å®¶ç½ç«çæ¯æï¼
å¦æä½ è§å¾æ¬æ对你æ帮å©ï¼æ¬¢è¿è½¬è½½ï¼ç¦è¯·æ³¨æåºå¤ï¼è°¢è°¢ï¼

相关推荐