summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2008-12-20 23:47:12 +0000
committerSeth Mos <seth.mos@xs4all.nl>2008-12-20 23:47:12 +0000
commitadc986ed5e5bb1de0e478dc1e3abf4f493ca1c3f (patch)
tree64a55e40cc313f2c4e270674cd34e141cfe65cfc
parent0087b9f2bb9bebf6c717475922b39dd471ab74f8 (diff)
downloadpfsense-adc986ed5e5bb1de0e478dc1e3abf4f493ca1c3f.zip
pfsense-adc986ed5e5bb1de0e478dc1e3abf4f493ca1c3f.tar.gz
Add logging
-rw-r--r--etc/inc/rrd.inc9
1 files changed, 4 insertions, 5 deletions
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc
index 3e1001e..7e0862b 100644
--- a/etc/inc/rrd.inc
+++ b/etc/inc/rrd.inc
@@ -39,7 +39,7 @@ function dump_rrd_to_xml($rrddatabase, $xmldumpfile) {
exec("$rrdtool dump {$rrddatabase} {$xmldumpfile} 2>&1", $dumpout, $dumpret);
if ($dumpret <> 0) {
$dumpout = implode(" ", $dumpout);
- echo "RRD dump failed exited with $dumpret, the error is: $dumpout\n";
+ log_error("RRD dump failed exited with $dumpret, the error is: $dumpout");
}
return($dumpret);
}
@@ -51,7 +51,7 @@ function create_new_rrd($rrdcreatecmd) {
exec("$rrdcreatecmd 2>&1", $rrdcreateoutput, $rrdcreatereturn);
if ($rrdcreatereturn <> 0) {
$rrdcreateoutput = implode(" ", $rrdcreateoutput);
- echo "RRD create failed exited with $rrdcreatereturn, the error is: $rrdcreateoutput\n";
+ log_error("RRD create failed exited with $rrdcreatereturn, the error is: $rrdcreateoutput");
}
return $rrdcreatereturn;
}
@@ -61,9 +61,7 @@ function migrate_rrd_format($rrdoldxml, $rrdnewxml) {
$numdsold = count($rrdoldxml['ds']);
$numrranew = count($rrdnewxml['rra']);
$numdsnew = count($rrdnewxml['ds']);
- echo "\nStart merging databases\n\n";
- echo "old rrd had $numdsold ds values and $numrraold rra databases \n";
- echo "new rrd has $numdsnew ds values and $numrranew rra databases \n";
+ log_error("Import RRD has $numdsold DS values and $numrraold RRA databases, new format RRD has $numdsnew DS values and $numrranew RRA databases");
/* add data sources not found in the old array from the new array */
$i = 0;
@@ -119,6 +117,7 @@ function migrate_rrd_format($rrdoldxml, $rrdnewxml) {
$numrranew = count($rrdoldxml['rra']);
$numdsnew = count($rrdoldxml['ds']);
+ log_error("The new RRD now has $numdsnew DS values and $numrranew RRA databases");
return $rrdoldxml;
}
OpenPOWER on IntegriCloud