diff --git a/html/graph.php b/html/graph.php index f3cf51fd9..537c5e999 100644 --- a/html/graph.php +++ b/html/graph.php @@ -58,8 +58,5 @@ $end = utime(); $run = ($end - $start); -if ($debug) { - echo '
Runtime '.$run.' secs'; - - echo ('
MySQL: Cell '.($db_stats['fetchcell'] + 0).'/'.round(($db_stats['fetchcell_sec'] + 0), 3).'s'.' Row '.($db_stats['fetchrow'] + 0).'/'.round(($db_stats['fetchrow_sec'] + 0), 3).'s'.' Rows '.($db_stats['fetchrows'] + 0).'/'.round(($db_stats['fetchrows_sec'] + 0), 3).'s'.' Column '.($db_stats['fetchcol'] + 0).'/'.round(($db_stats['fetchcol_sec'] + 0), 3).'s'); -} +d_echo('
Runtime '.$run.' secs'); +d_echo('
MySQL: Cell '.($db_stats['fetchcell'] + 0).'/'.round(($db_stats['fetchcell_sec'] + 0), 3).'s'.' Row '.($db_stats['fetchrow'] + 0).'/'.round(($db_stats['fetchrow_sec'] + 0), 3).'s'.' Rows '.($db_stats['fetchrows'] + 0).'/'.round(($db_stats['fetchrows_sec'] + 0), 3).'s'.' Column '.($db_stats['fetchcol'] + 0).'/'.round(($db_stats['fetchcol_sec'] + 0), 3).'s'); diff --git a/html/includes/graphs/graph.inc.php b/html/includes/graphs/graph.inc.php index 19e99c9b6..d7ed4cbc8 100644 --- a/html/includes/graphs/graph.inc.php +++ b/html/includes/graphs/graph.inc.php @@ -69,9 +69,7 @@ function graph_error($string) { if ($height > '99') { shell_exec($rrd_cmd); - if ($debug) { - echo '
'.$rrd_cmd.'
'; - } + d_echo('
'.$rrd_cmd.'
'); if (is_file($graphfile) && !$debug) { header('Content-type: image/png'); @@ -135,9 +133,7 @@ else { else { if ($rrd_options) { rrdtool_graph($graphfile, $rrd_options); - if ($debug) { - echo $rrd_cmd; - } + d_echo($rrd_cmd); if (is_file($graphfile)) { if (!$debug) { diff --git a/html/includes/graphs/macaccounting/auth.inc.php b/html/includes/graphs/macaccounting/auth.inc.php index 971874116..d6a2ccb5f 100644 --- a/html/includes/graphs/macaccounting/auth.inc.php +++ b/html/includes/graphs/macaccounting/auth.inc.php @@ -11,14 +11,10 @@ if (is_numeric($vars['id'])) { if (is_array($acc)) { if ($auth || port_permitted($acc['port_id'])) { - if ($debug) { - echo $config['rrd_dir'].'/'.$acc['hostname'].'/'.safename('cip-'.$acc['ifIndex'].'-'.$acc['mac'].'.rrd'); - } + d_echo($config['rrd_dir'].'/'.$acc['hostname'].'/'.safename('cip-'.$acc['ifIndex'].'-'.$acc['mac'].'.rrd')); if (is_file($config['rrd_dir'].'/'.$acc['hostname'].'/'.safename('cip-'.$acc['ifIndex'].'-'.$acc['mac'].'.rrd'))) { - if ($debug) { - echo 'exists'; - } + d_echo('exists'); $rrd_filename = $config['rrd_dir'].'/'.$acc['hostname'].'/'.safename('cip-'.$acc['ifIndex'].'-'.$acc['mac'].'.rrd'); $port = get_port_by_id($acc['port_id']); diff --git a/html/pages/device/health/mempool.inc.php b/html/pages/device/health/mempool.inc.php index 613aa1250..e2a6eaa51 100644 --- a/html/pages/device/health/mempool.inc.php +++ b/html/pages/device/health/mempool.inc.php @@ -18,9 +18,7 @@ foreach (dbFetchRows('SELECT * FROM `mempools` WHERE device_id = ?', array($devi if ($config['memcached']['enable'] === true) { $state = $memcache->get('mempool-'.$mempool['mempool_id'].'-state'); - if ($debug) { - print_r($state); - } + d_echo($state); if (is_array($state)) { $mempool = array_merge($mempool, $state); diff --git a/html/pages/device/overview/mempools.inc.php b/html/pages/device/overview/mempools.inc.php index 49884331d..01895ee7d 100644 --- a/html/pages/device/overview/mempools.inc.php +++ b/html/pages/device/overview/mempools.inc.php @@ -21,9 +21,7 @@ if (count($mempools)) { foreach ($mempools as $mempool) { if ($config['memcached']['enable'] === true) { $state = $memcache->get('mempool-'.$mempool['mempool_id'].'-state'); - if ($debug) { - print_r($state); - } + d_echo($state); if (is_array($state)) { $mempool = array_merge($mempool, $state); diff --git a/html/pages/device/port.inc.php b/html/pages/device/port.inc.php index 80bdbff91..bd9c38acd 100644 --- a/html/pages/device/port.inc.php +++ b/html/pages/device/port.inc.php @@ -8,9 +8,7 @@ $port = dbFetchRow('SELECT * FROM `ports` WHERE `port_id` = ?', array($vars['por if ($config['memcached']['enable'] === true) { $state = $memcache->get('port-'.$port['port_id'].'-state'); - if ($debug) { - print_r($state); - } + d_echo($state); if (is_array($state)) { $port = array_merge($port, $state); diff --git a/html/pages/device/ports.inc.php b/html/pages/device/ports.inc.php index dc941e246..11a5978ff 100644 --- a/html/pages/device/ports.inc.php +++ b/html/pages/device/ports.inc.php @@ -138,9 +138,7 @@ else { foreach ($ports as $port) { if ($config['memcached']['enable'] === true) { $state = $memcache->get('port-'.$port['port_id'].'-state'); - if ($debug) { - print_r($state); - } + d_echo($state); if (is_array($state)) { $port = array_merge($port, $state); diff --git a/html/pages/health/sensors.inc.php b/html/pages/health/sensors.inc.php index a51ba6e71..7ed65f926 100644 --- a/html/pages/health/sensors.inc.php +++ b/html/pages/health/sensors.inc.php @@ -24,9 +24,7 @@ echo ' foreach (dbFetchRows($sql, $param) as $sensor) { if ($config['memcached']['enable'] === true) { $sensor['sensor_current'] = $memcache->get('sensor-'.$sensor['sensor_id'].'-value'); - if ($debug) { - echo 'Memcached['.'sensor-'.$sensor['sensor_id'].'-value'.'='.$sensor['sensor_current'].']'; - } + d_echo('Memcached['.'sensor-'.$sensor['sensor_id'].'-value'.'='.$sensor['sensor_current'].']'); } if (empty($sensor['sensor_current'])) {