Make mono font chosable in config, remove hardcoded names from functions.

git-svn-id: http://www.observium.org/svn/observer/trunk@29 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2007-04-03 19:19:09 +00:00
parent 639bea8df4
commit 2f50bbd4b4
4 changed files with 50 additions and 50 deletions

View File

@@ -376,8 +376,8 @@ function trafgraph ($rrd, $graph, $from, $to, $width, $height)
"LINE1:d95thout#aa0000:" );
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -417,8 +417,8 @@ function pktsgraph ($rrd, $graph, $from, $to, $width, $height) {
"GPRINT:out:LAST:%6.2lf%spps",
"GPRINT:out:AVERAGE:%6.2lf%spps",
"GPRINT:out:MAX:%6.2lf%spps\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -461,8 +461,8 @@ function errorgraph ($rrd, $graph, $from, $to, $width, $height)
"GPRINT:out:AVERAGE:%6.2lf%spps",
"GPRINT:out:MAX:%6.2lf%spps\\n",
);
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -502,8 +502,8 @@ function nucastgraph ($rrd, $graph, $from, $to, $width, $height)
"GPRINT:out:LAST:%6.2lf%spps",
"GPRINT:out:AVERAGE:%6.2lf%spps",
"GPRINT:out:MAX:%6.2lf%spps\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -542,8 +542,8 @@ function cpugraph ($rrd, $graph , $from, $to, $width, $height)
"GPRINT:5m:MIN:Min\:%6.2lf",
"GPRINT:5m:MAX:Max\:%6.2lf\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -579,8 +579,8 @@ function tempgraph ($rrd, $graph, $from, $to, $width, $height, $title, $vertical
"GPRINT:out:MIN:Min\:%6.2lf",
"GPRINT:out:MAX:Max\:%6.2lf\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -610,8 +610,8 @@ function uptimegraph ($rrd, $graph , $from, $to, $width, $height, $title, $verti
"GPRINT:cuptime:LAST:Cur\:%6.2lf",
"GPRINT:cuptime:AVERAGE:Avg\: %6.2lf",
"GPRINT:cuptime:MAX:Max\:%6.2lf\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -651,8 +651,8 @@ function memgraph ($rrd, $graph , $from, $to, $width, $height, $title, $vertical
LINE1.5:MEMTOTAL#cc0000:";
if($width <= "300") {$opts .= "\
--font LEGEND:7:$installdir/DejaVuSansMono.ttf \
--font AXIS:6:$installdir/DejaVuSansMono.ttf \
--font LEGEND:7:$mono_font \
--font AXIS:6:$mono_font \
--font-render-mode normal";}
@@ -702,7 +702,7 @@ function ip_graph ($rrd, $graph, $from, $to, $width, $height) {
"GPRINT:ipOutNoRoutes:AVERAGE: %6.2lf%s",
"GPRINT:ipOutNoRoutes:MAX: %6.2lf%s\\n"
);
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf", "--font", "AXIS:6:$installdir/DejaVuSansMono.ttf", "--font-render-mode", "normal");}
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font", "--font", "AXIS:6:$mono_font", "--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
$ret = rrd_graph("$imgfile", $opts, count($opts));
if( !is_array($ret) ) {
@@ -759,7 +759,7 @@ function icmp_graph ($rrd, $graph, $from, $to, $width, $height) {
"GPRINT:icmpOutEchoReps:AVERAGE: %6.2lf%s",
"GPRINT:icmpOutEchoReps:MAX: %6.2lf%s\\n"
);
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf", "--font", "AXIS:6:$installdir/DejaVuSansMono.ttf", "--font-render-mode", "normal");}
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font", "--font", "AXIS:6:$mono_font", "--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
$ret = rrd_graph("$imgfile", $opts, count($opts));
if( !is_array($ret) ) {
@@ -811,7 +811,7 @@ function tcp_graph ($rrd, $graph, $from, $to, $width, $height) {
"GPRINT:tcpRetransSegs:AVERAGE: %6.2lf%s",
"GPRINT:tcpRetransSegs:MAX: %6.2lf%s\\n",
);
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf", "--font", "AXIS:6:$installdir/DejaVuSansMono.ttf", "--font-render-mode", "normal");}
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font", "--font", "AXIS:6:$mono_font", "--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
$ret = rrd_graph("$imgfile", $opts, count($opts));
if( !is_array($ret) ) {
@@ -848,7 +848,7 @@ function udp_graph ($rrd, $graph, $from, $to, $width, $height) {
"GPRINT:udpNoPorts:AVERAGE: %6.2lf%s",
"GPRINT:udpNoPorts:MAX: %6.2lf%s\\n",
);
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf", "--font", "AXIS:6:$installdir/DejaVuSansMono.ttf", "--font-render-mode", "normal");}
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font", "--font", "AXIS:6:$mono_font", "--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
$ret = rrd_graph("$imgfile", $opts, count($opts));
if( !is_array($ret) ) {

View File

@@ -26,8 +26,8 @@ function temp_graph ($device, $graph, $from, $to, $width, $height, $title, $vert
$optsa[] = "GPRINT:temp$fs[temp_id]:MAX:%3.0lf<EFBFBD>C\l";
$iter++;
}
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
$ret = rrd_graph("$imgfile", $opts, count($opts));

View File

@@ -18,8 +18,8 @@ function cpugraphHP ($rrd, $graph , $from, $to, $width, $height)
"GPRINT:load:MIN:Min\:%3.2lf",
"GPRINT:load:MAX:Max\:%3.2lf\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -53,8 +53,8 @@ function memgraphHP ($rrd, $graph , $from, $to, $width, $height, $title, $vertic
LINE1.5:TOTAL#cc0000:";
if($width <= "300") {$opts .= "\
--font LEGEND:7:$installdir/DejaVuSansMono.ttf \
--font AXIS:6:$installdir/DejaVuSansMono.ttf \
--font LEGEND:7:$mono_font \
--font AXIS:6:$mono_font \
--font-render-mode normal";}

View File

@@ -61,8 +61,8 @@ function mailerrorgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title,
'GPRINT:rspam:AVERAGE:avg\: %5.2lf/min',
'GPRINT:rmspam:MAX:max\: %3.0lf/min\l');
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -120,8 +120,8 @@ function mailsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $ver
"GPRINT:rrecv:AVERAGE:Avg\: %4.2lf/min",
"GPRINT:rmrecv:MAX:Max\: %3.0lf/min\l");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -205,8 +205,8 @@ function memgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $verti
"LINE1:totalreal#050505:total",
"GPRINT:totalreal:AVERAGE: %7.2lf %s");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -257,8 +257,8 @@ function loadgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vert
"GPRINT:c:AVERAGE: %7.2lf",
"GPRINT:c:MAX: %7.2lf\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -297,8 +297,8 @@ function usersgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $ver
"GPRINT:users:AVERAGE:%6.2lf",
"GPRINT:users:MIN:%6.2lf",
"GPRINT:users:MAX:%6.2lf\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -335,8 +335,8 @@ function procsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $ver
"GPRINT:procs:AVERAGE:%6.2lf",
"GPRINT:procs:MIN:%6.2lf",
"GPRINT:procs:MAX:%6.2lf\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -393,8 +393,8 @@ function cpugraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $verti
"GPRINT:idle_perc:AVERAGE: Avg\:%3.0lf%%",
"GPRINT:idle_perc:MAX: Max\:%3.0lf%%\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -459,8 +459,8 @@ function couriergraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $v
'GPRINT:vimapd_ssl_login:AVERAGE:tot\: %5.0lf',
'GPRINT:rimapd_ssl_login:AVERAGE:avg\: %4.0lf/min',
'GPRINT:rmimapd_ssl_login:MAX:max\: %4.0lf/min\l');
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -491,8 +491,8 @@ function apachehitsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title,
"GPRINT:hits:LAST: %6.2lf/sec",
"GPRINT:hits:AVERAGE:%6.2lf/sec",
"GPRINT:hits:MAX:%6.2lf/sec\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -539,8 +539,8 @@ function unixfsgraph ($device, $graph, $from, $to, $width, $height, $title, $ver
$optsa[] = "GPRINT:$fs[storage_id]p:LAST:%3.0lf%%\l";
$iter++;
}
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
$ret = rrd_graph("$imgfile", $opts, count($opts));
@@ -569,8 +569,8 @@ function apachebitsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title,
"GPRINT:bits:AVERAGE:%6.2lf%sbps",
"GPRINT:bits:MAX:%6.2lf%sbps\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);
@@ -607,8 +607,8 @@ function tempgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vert
"GPRINT:sys:MIN:Min\:%6.2lf",
"GPRINT:sys:MAX:Max\:%6.2lf\\n");
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",
"--font", "AXIS:6:$mono_font",
"--font-render-mode", "normal");}
$opts = array_merge($optsa, $optsb);