← Back to team overview

graphite-dev team mailing list archive

Re: [Question #286769]: list all metrics which crossed threshold values

 

Question #286769 on Graphite changed:
https://answers.launchpad.net/graphite/+question/286769

Jason Dixon posted a new comment:
The maximumAbove() function should get you want you want.

http://graphite.readthedocs.org/en/0.9.15/functions.html#graphite.render.functions.maximumAbove

For example, I have 3 hosts reporting cpu metrics to Graphite. Pulling
the last hour of data I see all 3 series:

$ curl -s -k
"https://graphite/render/?from=-1hours&target=collectd.*.cpu-0.cpu-
user&format=json" | json_pp | grep target

      "target" : "collectd.graphite-web-0.cpu-0.cpu-user"
      "target" : "collectd.synthesize-0.cpu-0.cpu-user"
      "target" : "collectd.synthesize-1.cpu-0.cpu-user"

Now I want to isolate any hosts with a cpu-user value exceeding 4.0, so
I use maximumAbove().

$ curl -s -k
"https://104.236.122.198/render/?from=-1hours&target=maximumAbove(collectd.*.cpu-0
.cpu-user,4)&format=json" | json_pp | grep target

      "target" : "collectd.graphite-web-0.cpu-0.cpu-user"

I don't know anything about your "check-graphite-data.rb" command, but
the following examples should get you going in the right direction.

Jason

-- 
You received this question notification because your team graphite-dev
is an answer contact for Graphite.