print "Error while graphing: " . RRDs::error . "\n";
} else {
my $newmtime=(stat("${outdir}/${hostname}.${var}.png.work"))[9];
- if ($newmtime != $mtime) {
+ if ((!defined($mtime)) || ($newmtime != $mtime)) {
copy("${outdir}/${hostname}.${var}.png.work", "${outdir}/${hostname}.${var}.png.new");
rename("${outdir}/${hostname}.${var}.png.new", "${outdir}/${hostname}.${var}.png");
}
print "Error while graphing: " . RRDs::error . "\n";
} else {
my $newmtime=(stat("${outdir}/${hostname}.${var}.long.png.work"))[9];
- if ($newmtime != $mtime) {
+ if ((!defined($mtime)) || ($newmtime != $mtime)) {
copy("${outdir}/${hostname}.${var}.long.png.work", "${outdir}/${hostname}.${var}.long.png.new");
rename("${outdir}/${hostname}.${var}.long.png.new", "${outdir}/${hostname}.${var}.long.png");
}
print "Error while graphing: " . RRDs::error . "\n";
} else {
my $newmtime=(stat("${outdir}/${hostname}.${var}.week.png.work"))[9];
- if ($newmtime != $mtime) {
+ if ((!defined($mtime)) || ($newmtime != $mtime)) {
copy("${outdir}/${hostname}.${var}.week.png.work", "${outdir}/${hostname}.${var}.week.png.new");
rename("${outdir}/${hostname}.${var}.week.png.new", "${outdir}/${hostname}.${var}.week.png");
}
print "Error while graphing: " . RRDs::error . "\n";
} else {
my $newmtime=(stat("${outdir}/${hostname}.${var}.year.png.work"))[9];
- if ($newmtime != $mtime) {
+ if ((!defined($mtime)) || ($newmtime != $mtime)) {
copy("${outdir}/${hostname}.${var}.year.png.work", "${outdir}/${hostname}.${var}.year.png.new");
rename("${outdir}/${hostname}.${var}.year.png.new", "${outdir}/${hostname}.${var}.year.png");
}