After a fresh install of Cacti, I could not see any text in graphes generated by rrdtool. I've searched the forum a lot about this issue and tried every solution I found but none of them solved my problem.
Here is the system I was working with :
System : Ubuntu 6.04 LTS
PHP : 5.2.5 (installed manually)
RRDtool : 1.2.11 (dpkg install)
Cacti : 0.8.7b (installed manually)
Having noticed with Graph debug turned on that the command line options passed to rrdtool for graph-generation did not include a specific font path, I decided to try the command with font paths specified.
So I ran the command using these options :
Code: Select all
--font TITLE:12:/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf \
--font AXIS:8:/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf \
--font LEGEND:10:/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf \
--font UNIT:8:/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf \
Code: Select all
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
I figured that the system environment variable RRD_DEFAULT_FONT was not set in a way that the system I was working on understood.
Cacti uses this php function to set the environment variable :
Code: Select all
putenv("RRD_DEFAULT_FONT=" . read_config_option("path_rrdtool_default_font"));
So I decided to specify the path explicitly in the command line arguments passed to rrdtool during graph generation.
In lib/rrd.php, function rrdtool_set_font, I replaced
Code: Select all
/* do some simple checks */
if (!file_exists($font)) {
$font = "";
}
Code: Select all
$font = "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf";
Hope this helps anybody who has not found a different solution.
--
Emilien Arino