pkgsrc/sysutils/munin-server/patches/patch-ae
he b1c2748f67 Import a package for the server end of the Munin monitoring system.
This version has a patch so that it works properly with RRDtool of
version 1.2 or newer.
2006-06-08 19:16:24 +00:00

89 lines
4.4 KiB
Text

$NetBSD: patch-ae,v 1.1.1.1 2006/06/08 19:16:24 he Exp $
--- server/munin-graph.in.orig 2005-01-08 23:34:38.000000000 +0100
+++ server/munin-graph.in
@@ -490,6 +490,9 @@ sub get_header {
push @$result,"--width", &munin_get ($config, "graph_width", "400", $domain, $host, $service);
push @$result,"--imgformat", "PNG";
push @$result,"--lazy" if ($force_lazy);
+ push @$result,"--font", "LEGEND:" . &munin_get ($config, "legend_fontsize", "7", $domain, $host, $service) . ":";
+ push @$result,"--font", "AXIS:" . &munin_get ($config, "axis_fontsize", "7", $domain, $host, $service) . ":";
+# push @$result,"--font-render-mode", "mono";
push (@$result, "--units-exponent", "0")
if (! &should_scale ($node, $service));
@@ -848,10 +851,10 @@ sub process_node {
elsif ($global_headers == 1)
{
push (@rrd, "COMMENT:" . (" " x $max_field_len));
- push (@rrd, "COMMENT: Cur:");
- push (@rrd, "COMMENT:Min:");
- push (@rrd, "COMMENT:Avg:");
- push (@rrd, "COMMENT:Max: \\j");
+ push (@rrd, "COMMENT: Cur\\:");
+ push (@rrd, "COMMENT:Min\\:");
+ push (@rrd, "COMMENT:Avg\\:");
+ push (@rrd, "COMMENT:Max\\: \\j");
$global_headers++;
}
@@ -924,13 +927,13 @@ sub process_node {
}
else
{
- push (@rrd, "COMMENT: Cur:") unless $global_headers;
+ push (@rrd, "COMMENT: Cur\\:") unless $global_headers;
push (@rrd, "GPRINT:c$rrdname:LAST:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, "yes")?"%s":"") . "");
- push (@rrd, "COMMENT: Min:") unless $global_headers;
+ push (@rrd, "COMMENT: Min\\:") unless $global_headers;
push (@rrd, "GPRINT:i$rrdname:MIN:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "");
- push (@rrd, "COMMENT: Avg:") unless $global_headers;
+ push (@rrd, "COMMENT: Avg\\:") unless $global_headers;
push (@rrd, "GPRINT:g$rrdname:AVERAGE:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "");
- push (@rrd, "COMMENT: Max:") unless $global_headers;
+ push (@rrd, "COMMENT: Max\\:") unless $global_headers;
push (@rrd, "GPRINT:a$rrdname:MAX:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "\\j");
push (@{$total_pos{'min'}}, "i$rrdname");
push (@{$total_pos{'avg'}}, "g$rrdname");
@@ -991,13 +994,13 @@ sub process_node {
push (@rrd, "CDEF:dpostotal=ipostotal,UN,ipostotal,UNKN,IF");
push (@rrd, "LINE1:dpostotal#000000:" . $node->{client}->{$service}->{graph_total} . (" " x ($max_field_len - length ($node->{client}->{$service}->{graph_total}) + 1)));
- push (@rrd, "COMMENT: Cur:") unless $global_headers;
+ push (@rrd, "COMMENT: Cur\\:") unless $global_headers;
push (@rrd, "GPRINT:gpostotal:LAST:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "");
- push (@rrd, "COMMENT: Min:") unless $global_headers;
+ push (@rrd, "COMMENT: Min\\:") unless $global_headers;
push (@rrd, "GPRINT:ipostotal:MIN:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "");
- push (@rrd, "COMMENT: Avg:") unless $global_headers;
+ push (@rrd, "COMMENT: Avg\\:") unless $global_headers;
push (@rrd, "GPRINT:gpostotal:AVERAGE:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "");
- push (@rrd, "COMMENT: Max:") unless $global_headers;
+ push (@rrd, "COMMENT: Max\\:") unless $global_headers;
push (@rrd, "GPRINT:apostotal:MAX:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "\\j");
}
@@ -1010,7 +1013,10 @@ sub process_node {
push @complete, @{&get_header ($node, $config, $domain, $name, $service, $time)};
push @complete, @rrd;
- push (@complete, "COMMENT:Last update: " . localtime($lastupdate) . "\\r");
+ my($ts);
+ $ts = localtime($lastupdate);
+ $ts =~ s/:/\\:/g;
+ push (@complete, "COMMENT:Last update\\: " . $ts . "\\r");
if (time - 300 < $lastupdate)
{
@@ -1040,7 +1046,10 @@ sub process_node {
push @rrd_sum, "--end",(int($lastupdate/$resolutions{$time}))*$resolutions{$time};
}
push @rrd_sum, @rrd;
- push (@rrd_sum, "COMMENT:Last update: " . localtime($lastupdate) . "\\r");
+ my($ts2);
+ $ts2 = localtime($lastupdate);
+ $ts2 =~ s/:/\\:/g;
+ push (@rrd_sum, "COMMENT:Last update\\: " . $ts2 . "\\r");
my $labelled = 0;
my @defined = ();