5 Jun 2009 16:25
PATCH: Proper labeling of multi-target graphs
Norman Elton <normelton <at> gmail.com>
2009-06-05 14:25:53 GMT
2009-06-05 14:25:53 GMT
Multitarget graphs normally label each line using the datasource name,
ignoring any display_name. This meant that individual graphs used the
"friendly" name, while multitarget graphs were somewhat cryptic. We
assigned this to one of our ace undergraduate programming students,
who whipped up a patch to fix the problem. I'll attach below. Once
applied, multitarget graphs will use the display_name.
Enjoy!
Norman Elton
College of William & Mary
========
diff -Naur ./cricket-1.0.5/grapher.cgi ./cricket-1.0.5.work/grapher.cgi
--- cricket-1.0.5/grapher.cgi 2004-02-06 11:27:34.000000000 -0500
+++ cricket-1.0.5.work/grapher.cgi 2009-06-05 09:42:36.000000000 -0400
<at> <at> -941,7 +941,11 <at> <at>
if ($rrd && $rrd->loadHeader()) {
if (($isMTargets) && (!$isMTargetsOps)) {
- print "Values at last update for $tname:<br>";
+ if(exists($targRef->{'display-name'})) {
+ print "Values at last update for
$targRef->{'display-name'}:<br>";
+ } else {
+ print "Values at last update for $tname:<br>";
+ }
} elsif (!$printOnce) {
print "Values at last update:<br>";
(Continue reading)
RSS Feed