mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
colourize sql/rrd debugging yellow/green
git-svn-id: http://www.observium.org/svn/observer/trunk@3224 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -24,7 +24,11 @@ Usage
|
||||
function dbQuery($sql, $parameters = array()) {
|
||||
global $fullSql, $debug;
|
||||
$fullSql = dbMakeQuery($sql, $parameters);
|
||||
if($debug) { echo("\nSQL[".$fullSql."] "); }
|
||||
if($debug) {
|
||||
print Console_Color::convert("\nSQL[%y".$fullSql."%n] ");
|
||||
#echo("\nSQL[".$fullSql."] ");
|
||||
}
|
||||
|
||||
/*
|
||||
if($this->logFile)
|
||||
$time_start = microtime(true);
|
||||
|
@@ -155,7 +155,7 @@ function rrdtool($command, $filename, $options)
|
||||
|
||||
if ($config['norrd'])
|
||||
{
|
||||
print Console_Color::convert("%g RRD Disabled %n", false);
|
||||
print Console_Color::convert("[%rRRD Disabled%n]");
|
||||
} else {
|
||||
fwrite($rrd_pipes[0], $cmd."\n");
|
||||
}
|
||||
@@ -163,10 +163,7 @@ function rrdtool($command, $filename, $options)
|
||||
{
|
||||
echo stream_get_contents($rrd_pipes[1]);
|
||||
echo stream_get_contents($rrd_pipes[2]);
|
||||
|
||||
echo("<p>");
|
||||
echo("\n".$cmd."\n");
|
||||
echo("</p>");
|
||||
print Console_Color::convert("RRD[%g".$cmd."%n] ");
|
||||
} else {
|
||||
$tmp = stream_get_contents($rrd_pipes[1]).stream_get_contents($rrd_pipes[2]);
|
||||
}
|
||||
@@ -186,15 +183,13 @@ function rrdtool_create($filename, $options)
|
||||
|
||||
if ($config['norrd'])
|
||||
{
|
||||
print Console_Color::convert("%g RRD Disabled %n", false);
|
||||
print Console_Color::convert("[%gRRD Disabled%n] ", false);
|
||||
} else {
|
||||
$command = $config['rrdtool'] . " create $filename $options";
|
||||
}
|
||||
if ($debug) { echo($command."\n"); }
|
||||
if ($debug) { print Console_Color::convert("RRD[%g".$command."%n] "); }
|
||||
|
||||
return shell_exec($command);
|
||||
|
||||
# return rrdtool("create", $filename, $options);
|
||||
}
|
||||
|
||||
function rrdtool_update($filename, $options)
|
||||
|
Reference in New Issue
Block a user