我已经配置了Graphite来监控我的应用程序指标。我还配置了Zabbix来监视我的服务器、CPU和其他指标。现在,我想将一些关键的Graphite指标传递给Zabbix,以便为它们添加触发器。
所以我想做一些类似的事情
$ whisper get prefix1.prefix2.metricName
> 155有可能吗?
附言:我知道Graphite-API项目,我不想安装额外的应用程序。
发布于 2014-09-05 21:52:27
好的!我自己找到的:http://graphite.readthedocs.io/en/latest/render_api.html?highlight=rawJson (我可以使用curl并返回csv或json)。
答案在这里找到custom querying in graphite
另请参阅:https://github.com/graphite-project/graphite-web/blob/master/docs/render_api.rst
发布于 2016-12-21 19:22:28
您可以使用whisper安装包中提供的whisper-fetch程序。像这样使用它:
whisper-fetch /path/to/dot.wsp或者获取最近5分钟的数据:
whisper-fetch --from=$(date +%s -d "-5 min") /path/to/dot.wsp默认设置将产生如下输出:
1482318960 21.187000
1482319020 None
1482319080 21.187000
1482319140 None
1482319200 21.187000您可以使用--json选项将其更改为json。
https://stackoverflow.com/questions/25651902
复制相似问题