是否可以从控制台查询Whisper(Graphite DB)的数据



我已经配置Graphite来监控我的应用程序度量。我配置了Zabbix来监控我的服务器CPU和其他指标。现在我想把一些关键的Graphite指标传递给Zabbix,为它们添加触发器。

所以我想做一些类似的事情

$ whisper get prefix1.prefix2.metricName
> 155

有可能吗?

附言:我知道Graphite-API项目,我不想安装额外的应用程序。

您可以使用耳语安装包中提供的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。

好!我自己发现了:http://graphite.readthedocs.io/en/latest/render_api.html?highlight=rawJson(我可以使用curl并返回csv或json)。

答案在石墨中的自定义查询中找到

另请参阅:https://github.com/graphite-project/graphite-web/blob/master/docs/render_api.rst

最新更新