安装grafana,官网提供了ubuntu的安装包,直接进行安装
wget /d/file/titlepic/grafana_6.5.1_amd64.deb
dpkg -i grafana_6.5.1_amd64.deb
update-rc.d grafana-rver defaults 95 10
rvice grafana-rver 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=lect * from webface where httpstatus=’404′”
添加grafana的influxdb数据源
查询表数据绘制出折线图
{ "xhrstatus": "complete", "request": { "method": "get", "url": "api/datasources/proxy/1/query", "params": { "db": "sinamail", "q": "lect count(\"prototype\") from \"webface\" 农村最新致富项目where (\"httpstatus\" = '404') and time >= now() - 15m group by time(1m) fill(null)", "epoch": "ms" }, "data": null, "precision": "ms" }, "respon": { "results": [ { "statement_id": 0, "ries": [ { "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, sb是什么意思 0 ] ] } ] } ] }}
本文发布于:2023-04-07 22:48:42,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/44c801585e565e89a5e18c4a95563a30.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:[Linux] 安装grafana并且添加influxdb监控.doc
本文 PDF 下载地址:[Linux] 安装grafana并且添加influxdb监控.pdf
留言与评论(共有 0 条评论) |