diff --git a/html/includes/graphs/smokeping/in.inc.php b/html/includes/graphs/smokeping/in.inc.php index 382bd7928..dda61c9dd 100644 --- a/html/includes/graphs/smokeping/in.inc.php +++ b/html/includes/graphs/smokeping/in.inc.php @@ -35,14 +35,14 @@ if ($src['hostname'] == $config['own_hostname']) { $filename = $filename_dir . $device['hostname'].'.rrd'; if (!file_exists($filename_dir.$device['hostname'].'.rrd')) { // Try with dots in hostname replaced by underscores - $filename = $filename_dir . str_replace(".", "_", $device['hostname']).'.rrd'; + $filename = $filename_dir . str_replace('.', '_', $device['hostname']).'.rrd'; } } else { $filename = $filename_dir . $device['hostname'] .'~'.$src['hostname'].'.rrd'; if (!file_exists($filename)) { // Try with dots in hostname replaced by underscores - $filename = $filename_dir . str_replace(".", "-", $device['hostname']) .'~'.$src['hostname'].'.rrd'; + $filename = $filename_dir . str_replace('.', '-', $device['hostname']) .'~'.$src['hostname'].'.rrd'; } } diff --git a/html/pages/device/latency.inc.php b/html/pages/device/latency.inc.php index d18382356..bc3f962e4 100644 --- a/html/pages/device/latency.inc.php +++ b/html/pages/device/latency.inc.php @@ -71,7 +71,7 @@ if ($vars['view'] == 'incoming') { } if (is_numeric($host['device_id'])) { echo ''; - echo('

'.generate_device_link($dest).'

'); + echo '

'.generate_device_link($dest).'

'; $graph_array['type'] = 'smokeping_in'; $graph_array['device'] = $device['device_id']; $graph_array['src'] = $host['device_id']; diff --git a/includes/common.php b/includes/common.php index 93d5afe67..58602d40a 100644 --- a/includes/common.php +++ b/includes/common.php @@ -701,21 +701,22 @@ function get_graph_subtypes($type) { function get_smokeping_files($device) { global $config; + $smokeping_files = array(); if (isset($config['smokeping']['dir'])) { - $smokeping_files = array(); $smokeping_dir = generate_smokeping_file($device); if ($handle = opendir($smokeping_dir)) { while (false !== ($file = readdir($handle))) { - if ($file != "." && $file != "..") { - if (eregi(".rrd", $file)) { - if (eregi("~", $file)) { - list($target,$slave) = explode("~", str_replace(".rrd", "", $file)); - $target = str_replace("_", ".", $target); + if ($file != '.' && $file != '..') { + if (eregi('.rrd', $file)) { + if (eregi('~', $file)) { + list($target,$slave) = explode('~', str_replace('.rrd', '', $file)); + $target = str_replace('_', '.', $target); $smokeping_files['in'][$target][$slave] = $file; $smokeping_files['out'][$slave][$target] = $file; - } else { - $target = str_replace(".rrd", "", $file); - $target = str_replace("_", ".", $target); + } + else { + $target = str_replace('.rrd', '', $file); + $target = str_replace('_', '.', $target); $smokeping_files['in'][$target][$config['own_hostname']] = $file; $smokeping_files['out'][$config['own_hostname']][$target] = $file; } @@ -731,7 +732,8 @@ function generate_smokeping_file($device,$file='') { global $config; if ($config['smokeping']['integration'] === true) { return $config['smokeping']['dir'] .'/'. $device['type'] .'/' . $file; - } else { + } + else { return $config['smokeping']['dir'] . '/' . $file; } } diff --git a/scripts/gen_smokeping.php b/scripts/gen_smokeping.php index ec10cab62..9421af137 100755 --- a/scripts/gen_smokeping.php +++ b/scripts/gen_smokeping.php @@ -22,14 +22,14 @@ title = Network Latency Grapher