X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/upsgraph/blobdiff_plain/0e74e3d8b878f134b1b4cd1f207c1765482a97e5..bcd0e31b0502cde60a8a8ab890ed7de361eaab43:/upsgraph.pl diff --git a/upsgraph.pl b/upsgraph.pl index 100c52b..06e66e3 100755 --- a/upsgraph.pl +++ b/upsgraph.pl @@ -58,6 +58,7 @@ sub fetch_snmp(@) { if (!$session) { print STDERR "session error: $error"; + return undef; } $session->translate(0); @@ -324,10 +325,10 @@ while(1) { } foreach my $var (@{$host->{'fields'}}) { - my @graphdef = ('-P', "--lazy", "-t", $hostname." - ".$vars->{$var}->{'name'}, "DEF:${var}=${rrdfile}.${var}:${var}:AVERAGE", "LINE1:${var}#FF0000"); + my @graphdef = ("--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'; + push @graphdef, 'GPRINT:cur:Current\\: %.2lf\\r'; my $mtime; $mtime=(stat("${outdir}/${hostname}.${var}.png.work"))[9];