The columns in the legend area of graphs don't line up.
It looks like the spaces or tabs aren't working correctly.
I've set the font paths in cacti to a mono spaced TTF font but it doesn't help and from what I've read rrdtool uses pango and fontlib to get a suitable font anyway.
Any ideas of how to get the columns to line up underneath each other?
Thanks
Legend column alignment (cacti 0.8.7d + rrdtool 1.3.5)
Moderators: Developers, Moderators
I found the problem:
Cacti 0.8.7d doesn't handle the rrdtool 1.3.5 fonts correctly.
I ran rrdtool by hand and had to change the following :
Original :
/usr/local/bin/rrdtool graph test.png \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Saix_1024 (AAPC) - Traffic - 196.25.110.238 (Serial0)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
--slope-mode \
--font TITLE:10:/usr/share/fonts/TTF/DejaVuSansMono-Bold.ttf \
--font AXIS:6:/usr/share/fonts/TTF/DejaVuSansMono-Bold.ttf \
--font LEGEND:8:/usr/share/fonts/TTF/DejaVuSansMono-Bold.ttf \
--font UNIT:6:/usr/share/fonts/TTF/DejaVuSansMono-Bold.ttf \
DEF:a="/serv/cacti/rra/apc_saix_traffic_in_413.rrd":traffic_in:AVERAGE \
DEF:b="/serv/cacti/rra/apc_saix_traffic_in_413.rrd":traffic_out:AVERAGE \
AREA:a#00CF00FF:"Inbound" \
GPRINTLAST:" Current\:%8.2lf %s" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s\n" \
LINE1:b#002A97FF:"Outbound" \
GPRINTLAST:"Current\:%8.2lf %s" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s"
Fixed:
/usr/local/bin/rrdtool graph test.png \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Saix_1024 (AAPC) - Traffic - 196.25.110.238 (Serial0)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
--slope-mode \
--font TITLE:10:DejaVuSansMono \
--font AXIS:6:DejaVuSansMono \
--font LEGEND:8:DejaVuSansMono \
--font UNIT:6:DejaVuSansMono \
DEF:a="/serv/cacti/rra/apc_saix_traffic_in_413.rrd":traffic_in:AVERAGE \
DEF:b="/serv/cacti/rra/apc_saix_traffic_in_413.rrd":traffic_out:AVERAGE \
AREA:a#00CF00FF:"Inbound" \
GPRINTLAST:" Current\:%8.2lf %s" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s" \
LINE1:b#002A97FF:"Outbound" \
GPRINTLAST:"Current\:%8.2lf %s" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s"
Fix 1: By specifying the font name and not the font path rrdtool can load the font via pango.
Fix 2: By removing the \n from the legend string formating the columns now line up.
Now I just have to figure out how to modify all the templates and/or existing graphs.
Cacti 0.8.7d doesn't handle the rrdtool 1.3.5 fonts correctly.
I ran rrdtool by hand and had to change the following :
Original :
/usr/local/bin/rrdtool graph test.png \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Saix_1024 (AAPC) - Traffic - 196.25.110.238 (Serial0)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
--slope-mode \
--font TITLE:10:/usr/share/fonts/TTF/DejaVuSansMono-Bold.ttf \
--font AXIS:6:/usr/share/fonts/TTF/DejaVuSansMono-Bold.ttf \
--font LEGEND:8:/usr/share/fonts/TTF/DejaVuSansMono-Bold.ttf \
--font UNIT:6:/usr/share/fonts/TTF/DejaVuSansMono-Bold.ttf \
DEF:a="/serv/cacti/rra/apc_saix_traffic_in_413.rrd":traffic_in:AVERAGE \
DEF:b="/serv/cacti/rra/apc_saix_traffic_in_413.rrd":traffic_out:AVERAGE \
AREA:a#00CF00FF:"Inbound" \
GPRINTLAST:" Current\:%8.2lf %s" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s\n" \
LINE1:b#002A97FF:"Outbound" \
GPRINTLAST:"Current\:%8.2lf %s" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s"
Fixed:
/usr/local/bin/rrdtool graph test.png \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Saix_1024 (AAPC) - Traffic - 196.25.110.238 (Serial0)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
--slope-mode \
--font TITLE:10:DejaVuSansMono \
--font AXIS:6:DejaVuSansMono \
--font LEGEND:8:DejaVuSansMono \
--font UNIT:6:DejaVuSansMono \
DEF:a="/serv/cacti/rra/apc_saix_traffic_in_413.rrd":traffic_in:AVERAGE \
DEF:b="/serv/cacti/rra/apc_saix_traffic_in_413.rrd":traffic_out:AVERAGE \
AREA:a#00CF00FF:"Inbound" \
GPRINTLAST:" Current\:%8.2lf %s" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s" \
LINE1:b#002A97FF:"Outbound" \
GPRINTLAST:"Current\:%8.2lf %s" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s"
Fix 1: By specifying the font name and not the font path rrdtool can load the font via pango.
Fix 2: By removing the \n from the legend string formating the columns now line up.
Now I just have to figure out how to modify all the templates and/or existing graphs.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
At least a bug report is required: http://www.cacti.net/bugs.php
All settings are required, e.g. font path settings in cacti
Reinhard
All settings are required, e.g. font path settings in cacti
Reinhard
-
- Posts: 5
- Joined: Fri May 08, 2009 1:20 pm
Temporary solution (little bit evil):
- Set "DejaVuSansMono" as legend font file in cacti settings.
- Create an empty file named "DejaVuSansMono" in cacti/site directory.
- Attachments
-
- This workaround in action.
- vm-admin-2009-05-08-20-35-50.png (75.57 KiB) Viewed 5250 times
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
According to http://www.mail-archive.com/rrd-announc ... 00118.html this should have been fixed since rrdtool 1.3.5 as a rrdtool bug
Unfortunately, I can't verify yet.
Reinhard
Unfortunately, I can't verify yet.
Reinhard
Who is online
Users browsing this forum: No registered users and 2 guests