X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/upsgraph/blobdiff_plain/f004592ac75253abcb2e32548ddb995f10ff9cf2..0e74e3d8b878f134b1b4cd1f207c1765482a97e5:/upsgraph.pl?ds=inline
diff --git a/upsgraph.pl b/upsgraph.pl
index 1fbb452..100c52b 100755
--- a/upsgraph.pl
+++ b/upsgraph.pl
@@ -324,7 +324,10 @@ while(1) {
 		}
 
 		foreach my $var (@{$host->{'fields'}}) {
-			my @graphdef = ("--lazy", "-t", $hostname." - ".$vars->{$var}->{'name'}, "DEF:${var}=${rrdfile}.${var}:${var}:AVERAGE", "LINE1:${var}#FF0000");
+			my @graphdef = ('-P', "--lazy", "-t", $hostname." - ".$vars->{$var}->{'name'}, "DEF:${var}=${rrdfile}.${var}:${var}:AVERAGE", "LINE1:${var}#FF0000");
+
+			push @graphdef, "VDEF:cur=${var},LAST";
+			push @graphdef, 'GPRINT:cur:Current\\: %.2lf\\r';
 
 			my $mtime;
 			$mtime=(stat("${outdir}/${hostname}.${var}.png.work"))[9];
@@ -333,6 +336,9 @@ while(1) {
 				RRDs::graph("${outdir}/${hostname}.${var}.png.work",
 						"-w", "720", @graphdef);
 
+			pop @graphdef;
+			pop @graphdef;
+
 			if (RRDs::error) {
 				print "Error while graphing: " . RRDs::error . "\n";
 			} else {
@@ -346,10 +352,9 @@ while(1) {
 			print HTML "
\n";
 
 			open (HTML2, ">${outdir}/${hostname}.${var}.html.new");
-			print HTML2 "