use Net::SNMP;
use IO::Socket::INET;
use RRDs;
+use File::Copy;
use Data::Dumper;
$UPSGRAPH::outdir = "";
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 "<a href=\"${hostname}.${var}.html\"><img src=\"${hostname}.${var}.png\" width=\"${width}\" height=\"${height}\" border=\"0\"></a><br>\n";
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 "<img src=\"${hostname}.${var}.long.png\" width=\"${width}\" height=\"${height}\"><br>";
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 "<img src=\"${hostname}.${var}.week.png\" width=\"${width}\" height=\"${height}\"><br>";
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 "<img src=\"${hostname}.${var}.year.png\" width=\"${width}\" height=\"${height}\"><br>";