Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Recording Monitoring Thresholds

ripienaar edited this page Dec 19, 2011 · 4 revisions

Drawing critical and warning lines is almost identical to Drawing Horizontal Lines, the critical and warning helpers will create these lines with predictable names and also record the thresholds so the Ruby API can access them.

We also include a Nagios compatible check script that can be run against graphs to provide monitoring of your graphed data see Monitoring Graph Thresholds

    title          "Threshold Lines"
    width          400
    height         250
    ymin           -130
    ymax           130
    hide_legend    true

    warning :value =>  [50, -50], :color => "orange"
    critical :value => [100, -100], :color => "red"

thresholds.png

Sometimes the thresholds are far away from the actual data you are graphing so displaying them will obscure the true values in the graph, you can hide them - but still record them in the object so they are accessible from the Ruby API as below

    warning :value =>  [50, -50], :hide => true
    critical :value => [100, -100], :hide => true

From the Ruby API you can access these values:

graphite = GraphiteGraph.new("thresholds.graph")
puts graphite.critical_threshold
puts graphite.warning_threshold
Clone this wiki locally