log_error if rrdtool restore calls fail

This commit is contained in:
Darren Embry 2012-05-17 15:22:29 -04:00
parent 0887774669
commit 5d51f00ec7

View File

@ -69,7 +69,13 @@ function restore_rrd() {
if (file_exists("{$rrd_file}")) {
unlink($rrd_file);
}
exec("$rrdtool restore -f '{$xml_file}' '{$rrd_file}'");
$output = array();
$status = null;
exec("$rrdtool restore -f '{$xml_file}' '{$rrd_file}'", $output, $status);
if ($status) {
log_error("rrdtool restore -f '{$xml_file}' '{$rrd_file}' failed returning {$status}.");
continue;
}
unlink($xml_file);
}
return true;