15

I have configured Graphite to monitor my application metrics. And I configured Zabbix to monitor my servers CPU and other metrics. Now I want to pass some critical Graphite metrics to Zabbix to add triggers for them.

So I want to do something like

$ whisper get prefix1.prefix2.metricName
> 155

Is it possible?

P.S. I know about Graphite-API project, I don't want to install extra app.

4

2 回答 2

10

You can use the whisper-fetch program which is provided in the whisper installation package. Use it like this:

whisper-fetch /path/to/dot.wsp

Or to get e.g. data from the last 5 minutes:

whisper-fetch --from=$(date +%s -d "-5 min") /path/to/dot.wsp

Defaults will result in output like this:

1482318960  21.187000
1482319020  None
1482319080  21.187000
1482319140  None
1482319200  21.187000

You can change it to json using the --json option.

于 2016-12-21T11:22:28.423 回答
8

OK! I found it myself: http://graphite.readthedocs.io/en/latest/render_api.html?highlight=rawJson (I can use curl and return csv or json).

Answer was found here custom querying in graphite

Also see: https://github.com/graphite-project/graphite-web/blob/master/docs/render_api.rst

于 2014-09-05T13:52:27.323 回答