From e26b065f3d496edd6845b58c5a3598793315876f Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Wed, 10 Feb 2010 22:54:26 +0100 Subject: [PATCH 1/1] make lazy really work... --- upsgraph.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/upsgraph.pl b/upsgraph.pl index cc98e64..04a4f8c 100755 --- a/upsgraph.pl +++ b/upsgraph.pl @@ -8,6 +8,7 @@ if ((@ARGV != 1) && (@ARGV != 2)) { use Net::SNMP; use IO::Socket::INET; use RRDs; +use File::Copy; use Data::Dumper; $UPSGRAPH::outdir = ""; @@ -331,7 +332,7 @@ while(1) { if (RRDs::error) { print "Error while graphing: " . RRDs::error . "\n"; } else { - rename("${outdir}/${hostname}.${var}.png.new", "${outdir}/${hostname}.${var}.png"); + copy("${outdir}/${hostname}.${var}.png.new", "${outdir}/${hostname}.${var}.png"); } print HTML "
\n"; @@ -360,7 +361,7 @@ while(1) { if (RRDs::error) { print "Error while graphing: " . RRDs::error . "\n"; } else { - rename("${outdir}/${hostname}.${var}.long.png.new", "${outdir}/${hostname}.${var}.long.png"); + copy("${outdir}/${hostname}.${var}.long.png.new", "${outdir}/${hostname}.${var}.long.png"); } print HTML2 "
"; @@ -372,7 +373,7 @@ while(1) { if (RRDs::error) { print "Error while graphing: " . RRDs::error . "\n"; } else { - rename("${outdir}/${hostname}.${var}.week.png.new", "${outdir}/${hostname}.${var}.week.png"); + copy("${outdir}/${hostname}.${var}.week.png.new", "${outdir}/${hostname}.${var}.week.png"); } print HTML2 "
"; @@ -384,7 +385,7 @@ while(1) { if (RRDs::error) { print "Error while graphing: " . RRDs::error . "\n"; } else { - rename("${outdir}/${hostname}.${var}.year.png.new", "${outdir}/${hostname}.${var}.year.png"); + copy("${outdir}/${hostname}.${var}.year.png.new", "${outdir}/${hostname}.${var}.year.png"); } print HTML2 "
"; -- 2.39.5