Skip to content

Drawing Horizontal Lines

ripienaar edited this page Dec 17, 2011 · 4 revisions

You can draw simple horizontal lines on a graph, lines can have any color, caption or value. They can also optionally be dashed:

title          "Horizontal Lines"
width          400
height         250
ymin           0
ymax           125

line :caption => "Critical", :value => 100, :color => "red"
line :caption => "Warning",  :value =>  50, :color => "orange", :dashed => true

lines.png

If you are adding Critical and Warning thresholds specifically as above there are special helpers for this that will create them with predictable names.

These predictable names will be used by a future Nagios check that can provide automatic monitoring of graphs.

warning :data => [700, -700], :color => "orange"
critical :data => [800, -800], :color => "red"

If you do not specify the colors they will default as above. The lines will have names like crit_0, crit_1 etc.

While you can specify as many data items as you wish only really 1 or 2 makes sense, if you want to specify just 1 you can just do :data => 700

Clone this wiki locally