catch stderr for mwexec

This commit is contained in:
Seth Mos 2008-12-17 08:41:14 +00:00
parent c48790ecd1
commit f83dee7006

View File

@ -2074,7 +2074,7 @@ endif;
rsort($databases);
foreach($databases as $database) {
log_error("Upgrading rrd database {$rrddbpath}{$database}");
mwexec("$rrdtool tune {$rrddbpath}{$database} -r roundtrip:delay");
mwexec("$rrdtool tune {$rrddbpath}{$database} -r roundtrip:delay 2>&1");
}
/* let apinger recreate required files */
setup_gateways_monitor();
@ -2085,14 +2085,14 @@ endif;
foreach($databases as $database) {
log_error("Upgrading rrd database {$rrddbpath}{$database}");
/* rename DS source */
mwexec("$rrdtool tune {$rrddbpath}{$database} -r in:inpass");
mwexec("$rrdtool tune {$rrddbpath}{$database} -r out:outpass");
mwexec("$rrdtool tune {$rrddbpath}{$database} -r in:inpass 2>&1");
mwexec("$rrdtool tune {$rrddbpath}{$database} -r out:outpass 2>&1");
/* dump contents to xml and move database out of the way */
mwexec("$rrdtool dump {$rrddbpath}{$database} > {$g['tmp_path']}/{$database}.xml");
mwexec("mv {$rrddbpath}{$database} {$g['tmp_path']}/$databases.backup");
mwexec("mv {$rrddbpath}{$database} {$g['tmp_path']}/$databases.backup 2>&1");
/* let enable_rrd_graphing recreate the database and restore the contents */
enable_rrd_graphing();
mwexec("$rrdtool restore {$g['tmp_path']}/{$database}.xml {$rrddbpath}{$database}");
mwexec("$rrdtool restore {$g['tmp_path']}/{$database}.xml {$rrddbpath}{$database} 2>&1");
}
/* build a list of packets databases */
@ -2101,14 +2101,14 @@ endif;
foreach($databases as $database) {
log_error("Upgrading rrd database {$rrddbpath}{$database}");
/* rename DS source */
mwexec("$rrdtool tune {$rrddbpath}{$database} -r in:inpass");
mwexec("$rrdtool tune {$rrddbpath}{$database} -r out:outpass");
mwexec("$rrdtool tune {$rrddbpath}{$database} -r in:inpass 2>&1");
mwexec("$rrdtool tune {$rrddbpath}{$database} -r out:outpass 2>&1");
/* dump contents to xml and move database out of the way */
mwexec("$rrdtool dump {$rrddbpath}{$database} > {$g['tmp_path']}/{$database}.xml");
mwexec("mv {$rrddbpath}{$database} {$g['tmp_path']}/$databases.backup");
mwexec("mv {$rrddbpath}{$database} {$g['tmp_path']}/$databases.backup 2>&1");
/* let enable_rrd_graphing recreate the database and restore the contents */
enable_rrd_graphing();
mwexec("$rrdtool restore {$g['tmp_path']}/{$database}.xml {$rrddbpath}{$database}");
mwexec("$rrdtool restore {$g['tmp_path']}/{$database}.xml {$rrddbpath}{$database} 2>&1");
}
$config['version'] = "5.5";
}