ShortLegend

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
bocasman
Posts: 24
Joined: Mon Aug 19, 2002 8:27 am
Location: Panama
Contact:

ShortLegend

Post by bocasman »

Hi,

I was wondering if it is possible to set some type of ShortLegend as you do on mrtg, like say, if I'm plotting Temperature set a ShortLegend ºC, then the units string used for Max, Average and Current should be something like:
Current: 25ºC Average: 15ºC Maximun: 41ºC
Regards,
BM
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Good question.

I always thought it could be done using the '--unit' option in rrdtool. Therefore I implimented this option in cacti as well. Of course, I cannot get the values to show up on the graph like the documentation says they should.

Does anyone else know how to even do this in rrdtool?

-Ian
bocasman
Posts: 24
Joined: Mon Aug 19, 2002 8:27 am
Location: Panama
Contact:

Post by bocasman »

Hi,

Any one, have an idea for this?
Regards,
BM
bocasman
Posts: 24
Joined: Mon Aug 19, 2002 8:27 am
Location: Panama
Contact:

Post by bocasman »

Hi Ian,

After some research I think I have a solution for the ShortLegend issue.

The solution could be to add a field, that could be call ShortLegend or something like that for the GPRINT, and whatever we put in there should appears beside the %s, as it ºC is on this sample code.

Code: Select all

/usr/local/rrdtool/bin/rrdtool graph - \
--imgformat=PNG \
--start="-86400" \
--title="Core Router Temperature" \
--base=1000 \
--height=150 \
--width=500 \
--alt-autoscale \
--vertical-label="celcius degrees (ºC)" \
DEF:a="/usr/local/apache/htdocs/test/cacti/rra/core_temp_inlet.rrd":core_temp_inlet:AVERAGE \
DEF:b="/usr/local/apache/htdocs/test/cacti/rra/core_temp_outlet.rrd":core_temp_outlet:AVERAGE \
AREA:b#007283:"Outlet Temp" \
GPRINT:b:LAST:"Current\:%8.2lf %sºC" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %sºC" \
GPRINT:b:MAX:"Maximun\:%8.2lf %sºC\n" \
AREA:a#00CF00:"Inlet Temp" \
GPRINT:a:LAST:" Current\:%8.2lf %sºC" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %sºC" \
GPRINT:a:MAX:"Maximun\:%8.2lf %sºC\n" 
Here is the generated image:
Image
Regards,
BM
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest