diff --git a/INSTALL b/INSTALL
index 843be6064..8b8c7dc29 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,24 +1,24 @@
-Please see http://www.observium.org for up to date installation instructions.
-
-Please also contact us through the mailing list or on IRC if you run into any issues.
-
--------
-
-Some notes about how to set up your systems, which have not found their way
-onto the wiki just yet:
-
-Customer port parsing
-=====================
-
-Set your port description to:
-
-Cust: CustomerName {CircuitDesc} (OptionalNotes) [Speed]
-
-Transit/peering/core port parsing
-=================================
-
-Set your port description to:
-
-Transit: whateveryoulike
-Peering: whateveryoulike
-Core: whateveryoulike
+Please see http://www.observium.org for up to date installation instructions.
+
+Please also contact us through the mailing list or on IRC if you run into any issues.
+
+-------
+
+Some notes about how to set up your systems, which have not found their way
+onto the wiki just yet:
+
+Customer port parsing
+=====================
+
+Set your port description to:
+
+Cust: CustomerName {CircuitDesc} (OptionalNotes) [Speed]
+
+Transit/peering/core port parsing
+=================================
+
+Set your port description to:
+
+Transit: whateveryoulike
+Peering: whateveryoulike
+Core: whateveryoulike
diff --git a/config.php.default b/config.php.default
index dd99430fb..cf7bf1abd 100755
--- a/config.php.default
+++ b/config.php.default
@@ -9,14 +9,14 @@ $config['db_pass'] = "PASSWORD";
$config['db_name'] = "observium";
### Locations
-$config['install_dir'] = "/opt/observium";
-$config['html_dir'] = $config['install_dir'] . "/html";
-$config['rrd_dir'] = $config['install_dir'] . "/rrd";
+$config['install_dir'] = "/opt/observium";
+$config['html_dir'] = $config['install_dir'] . "/html";
+$config['rrd_dir'] = $config['install_dir'] . "/rrd";
$config['log_file'] = $config['install_dir'] . "/observium.log";
### Thie should *only* be set if you want to *force* a particular hostname/port
### It will prevent the web interface being usable form any other hostname
-#$config['base_url'] = "http://observium.company.com";
+#$config['base_url'] = "http://observium.company.com";
### Enable the below to use rrdcached. be sure rrd_dir is within the rrdcached dir
### and that your web server has permission to talk to rrdcached.
diff --git a/html/billing-graph.php b/html/billing-graph.php
index 12b6776d8..5e9c25fef 100755
--- a/html/billing-graph.php
+++ b/html/billing-graph.php
@@ -105,7 +105,7 @@ foreach (dbFetch("SELECT *, UNIX_TIMESTAMP(timestamp) AS formatted_date FROM bil
$tot_data[$i] = $out_data[$i] + $in_data[$i];
$tot_data_inv[$i] = $tot_data[$i] * -1;
- if($tot_data[$i] > $max_value) { $max_value = $tot_data[$i]; }
+ if ($tot_data[$i] > $max_value) { $max_value = $tot_data[$i]; }
$ticks[$i] = $timestamp;
$per_data[$i] = $rate_95th / $div;
diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php
index 3b781c394..045712786 100644
--- a/html/includes/functions.inc.php
+++ b/html/includes/functions.inc.php
@@ -5,7 +5,7 @@ function rrdtool_graph($graph_file, $options)
global $config, $debug;
- if($debug) { echo("$options"); }
+ if ($debug) { echo("$options"); }
$command = $config['rrdtool'] . " -";
@@ -39,10 +39,10 @@ function rrdtool_graph($graph_file, $options)
// proc_close in order to avoid a deadlock
$return_value = proc_close($process);
- if($debug)
+ if ($debug)
{
echo("
");
- if($debug) { echo("graph $graph_file $options"); }
+ if ($debug) { echo("graph $graph_file $options"); }
echo("
");
echo "command returned $return_value\n";
echo("
");
@@ -66,7 +66,7 @@ function generate_url($vars, $new_vars = array())
foreach($vars as $var => $value)
{
- if($value != "")
+ if ($value != "")
{
$url .= $var ."=".$value."/";
}
@@ -187,6 +187,7 @@ function overlib_link($url, $text, $contents, $class)
function generate_graph_popup($graph_array)
{
global $config;
+
## Take $graph_array and print day,week,month,year graps in overlib, hovered over graph
$graph = generate_graph_tag($graph_array);
@@ -270,6 +271,7 @@ function port_permitted($interface_id, $device_id = NULL)
function application_permitted($app_id, $device_id = NULL)
{
global $permissions;
+
if (is_numeric($app_id))
{
if (!$device_id) { $device_id = device_by_id_cache ($app_id); }
@@ -345,7 +347,7 @@ STATE;
function print_percentage_bar($width, $height, $percent, $left_text, $left_colour, $left_background, $right_text, $right_colour, $right_background)
{
- if($percent > "100") { $size_percent = "100"; } else { $size_percent = $percent; }
+ if ($percent > "100") { $size_percent = "100"; } else { $size_percent = $percent; }
$output = '
@@ -379,7 +381,7 @@ function generate_port_link($args, $text = NULL, $type = NULL)
$graph_array['legend'] = "yes";
$graph_array['height'] = "100";
$graph_array['width'] = "340";
- $graph_array['to'] = $config['time']['now'];
+ $graph_array['to'] = $config['time']['now'];
$graph_array['from'] = $config['time']['day'];
$graph_array['id'] = $args['interface_id'];
$content .= generate_graph_tag($graph_array);
diff --git a/html/includes/graphs/device/collectd.inc.php b/html/includes/graphs/device/collectd.inc.php
index f1b55d5a6..294ac0e72 100755
--- a/html/includes/graphs/device/collectd.inc.php
+++ b/html/includes/graphs/device/collectd.inc.php
@@ -27,7 +27,7 @@ function makeTextBlock($text, $fontfile, $fontsize, $width) {
$currentLine = 0;
foreach ($words as $word) {
$lineSize = imagettfbbox($fontsize, 0, $fontfile, $lines[$currentLine] . ' ' . $word);
- if($lineSize[2] - $lineSize[0] < $width) {
+ if ($lineSize[2] - $lineSize[0] < $width) {
$lines[$currentLine] .= ' ' . $word;
} else {
$currentLine++;
@@ -47,6 +47,7 @@ function makeTextBlock($text, $fontfile, $fontsize, $width) {
*/
function error($code, $code_msg, $title, $msg) {
global $config;
+
header(sprintf("HTTP/1.0 %d %s", $code, $code_msg));
header("Pragma: no-cache");
header("Expires: Mon, 01 Jan 2008 00:00:00 CET");
@@ -197,9 +198,9 @@ if (isset($MetaGraphDefs[$type])) {
if(isset($rrd_cmd))
{
- if($config['rrdcached']) { $rrd_cmd .= " --daemon ".$config['rrdcached'] . " "; }
- if($_GET['from']) { $from = mres($_GET['from']); }
- if($_GET['to']) { $to = mres($_GET['to']); }
+ if ($config['rrdcached']) { $rrd_cmd .= " --daemon ".$config['rrdcached'] . " "; }
+ if ($_GET['from']) { $from = mres($_GET['from']); }
+ if ($_GET['to']) { $to = mres($_GET['to']); }
$rrd_cmd .= " -s " . $from . " -e " . $to;
}
diff --git a/html/includes/graphs/device/netstat_icmp.inc.php b/html/includes/graphs/device/netstat_icmp.inc.php
index 3ea622ab5..83b4980b0 100644
--- a/html/includes/graphs/device/netstat_icmp.inc.php
+++ b/html/includes/graphs/device/netstat_icmp.inc.php
@@ -23,7 +23,7 @@ foreach($stats as $stat => $colour)
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = str_replace("icmp", "", $stat);
$rrd_list[$i]['rra'] = $stat;
- if(strpos($stat, "Out") !== FALSE)
+ if (strpos($stat, "Out") !== FALSE)
{
$rrd_list[$i]['invert'] = TRUE;
}
diff --git a/html/includes/graphs/device/netstat_icmp_info.inc.php b/html/includes/graphs/device/netstat_icmp_info.inc.php
index 38be4fbbb..1bf7b7dd6 100644
--- a/html/includes/graphs/device/netstat_icmp_info.inc.php
+++ b/html/includes/graphs/device/netstat_icmp_info.inc.php
@@ -23,7 +23,7 @@ foreach($stats as $stat => $array)
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = str_replace("icmp", "", $stat);
$rrd_list[$i]['rra'] = $stat;
- if(strpos($stat, "Out") !== FALSE)
+ if (strpos($stat, "Out") !== FALSE)
{
$rrd_list[$i]['invert'] = TRUE;
}
diff --git a/html/includes/graphs/device/netstat_ip.inc.php b/html/includes/graphs/device/netstat_ip.inc.php
index b3fcf0a6b..4ffa6ac96 100644
--- a/html/includes/graphs/device/netstat_ip.inc.php
+++ b/html/includes/graphs/device/netstat_ip.inc.php
@@ -20,7 +20,7 @@ foreach($stats as $stat => $array)
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = str_replace("ip", "", $stat);
$rrd_list[$i]['rra'] = $stat;
- if(strpos($stat, "Out") !== FALSE)
+ if (strpos($stat, "Out") !== FALSE)
{
$rrd_list[$i]['invert'] = TRUE;
}
diff --git a/html/includes/graphs/device/netstat_snmp.inc.php b/html/includes/graphs/device/netstat_snmp.inc.php
index 9c70ecf07..34e82b595 100644
--- a/html/includes/graphs/device/netstat_snmp.inc.php
+++ b/html/includes/graphs/device/netstat_snmp.inc.php
@@ -20,7 +20,7 @@ foreach($stats as $stat)
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = str_replace("snmp", "", $stat);
$rrd_list[$i]['rra'] = $stat;
- if(strpos($stat, "Out") !== FALSE)
+ if (strpos($stat, "Out") !== FALSE)
{
$rrd_list[$i]['invert'] = TRUE;
}
diff --git a/html/includes/graphs/device/netstat_snmp_pkt.inc.php b/html/includes/graphs/device/netstat_snmp_pkt.inc.php
index 46d084790..035059108 100644
--- a/html/includes/graphs/device/netstat_snmp_pkt.inc.php
+++ b/html/includes/graphs/device/netstat_snmp_pkt.inc.php
@@ -15,7 +15,7 @@ foreach($stats as $stat)
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = str_replace("snmp", "", $stat);
$rrd_list[$i]['rra'] = $stat;
- if(strpos($stat, "Out") !== FALSE)
+ if (strpos($stat, "Out") !== FALSE)
{
$rrd_list[$i]['invert'] = TRUE;
}
diff --git a/html/includes/graphs/device/netstat_tcp.inc.php b/html/includes/graphs/device/netstat_tcp.inc.php
index 7ef50e642..2c977115b 100644
--- a/html/includes/graphs/device/netstat_tcp.inc.php
+++ b/html/includes/graphs/device/netstat_tcp.inc.php
@@ -14,7 +14,7 @@ foreach($stats as $stat)
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = str_replace("tcp", "", $stat);
$rrd_list[$i]['rra'] = $stat;
- if(strpos($stat, "Out") !== FALSE || strpos($stat, "Retrans") !== FALSE || strpos($stat, "Attempt") !== FALSE)
+ if (strpos($stat, "Out") !== FALSE || strpos($stat, "Retrans") !== FALSE || strpos($stat, "Attempt") !== FALSE)
{
$rrd_list[$i]['invert'] = TRUE;
}
diff --git a/html/includes/graphs/device/netstat_udp.inc.php b/html/includes/graphs/device/netstat_udp.inc.php
index 016e110e2..caa723fe5 100644
--- a/html/includes/graphs/device/netstat_udp.inc.php
+++ b/html/includes/graphs/device/netstat_udp.inc.php
@@ -14,7 +14,7 @@ foreach($stats as $stat)
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = str_replace("udp", "", $stat);
$rrd_list[$i]['rra'] = $stat;
- if(strpos($stat, "Out") !== FALSE || strpos($stat, "Retrans") !== FALSE || strpos($stat, "Attempt") !== FALSE)
+ if (strpos($stat, "Out") !== FALSE || strpos($stat, "Retrans") !== FALSE || strpos($stat, "Attempt") !== FALSE)
{
$rrd_list[$i]['invert'] = TRUE;
}
diff --git a/html/includes/graphs/generic_bits.inc.php b/html/includes/graphs/generic_bits.inc.php
index 8e3daa94f..40586bed1 100644
--- a/html/includes/graphs/generic_bits.inc.php
+++ b/html/includes/graphs/generic_bits.inc.php
@@ -38,8 +38,8 @@ $rrd_options .= " CDEF:inbits=inoctets,8,*";
$rrd_options .= " CDEF:inbits_max=inoctets_max,8,*";
if ($config['rrdgraph_real_95th']) {
- $rrd_options .= " CDEF:highbits=inoctets,outoctets,MAX,8,*";
- $rrd_options .= " VDEF:95thhigh=highbits,95,PERCENT";
+ $rrd_options .= " CDEF:highbits=inoctets,outoctets,MAX,8,*";
+ $rrd_options .= " VDEF:95thhigh=highbits,95,PERCENT";
}
$rrd_options .= " VDEF:totin=inoctets,TOTAL";
@@ -67,8 +67,8 @@ $rrd_options .= " GPRINT:outbits_max:MAX:%6.2lf%s";
$rrd_options .= " GPRINT:95thout:%6.2lf%s\\\\n";
if ($config['rrdgraph_real_95th']) {
- $rrd_options .= " HRULE:95thhigh#FF0000:\"Highest\"";
- $rrd_options .= " GPRINT:95thhigh:\"%30.2lf%s\\n\"";
+ $rrd_options .= " HRULE:95thhigh#FF0000:\"Highest\"";
+ $rrd_options .= " GPRINT:95thhigh:\"%30.2lf%s\\n\"";
}
$rrd_options .= " GPRINT:tot:'Total %6.2lf%s'";
diff --git a/html/includes/graphs/generic_multi_line.inc.php b/html/includes/graphs/generic_multi_line.inc.php
index 464e9d46d..37886d499 100644
--- a/html/includes/graphs/generic_multi_line.inc.php
+++ b/html/includes/graphs/generic_multi_line.inc.php
@@ -27,7 +27,7 @@ foreach ($rrd_list as $rrd)
$rrd_options .= " DEF:".$id."=$filename:$rra:AVERAGE";
- if(!$basicrrd)
+ if (!$basicrrd)
{
$rrd_options .= " DEF:".$id."min=$filename:$rra:MIN";
$rrd_options .= " DEF:".$id."max=$filename:$rra:MAX";
@@ -45,7 +45,7 @@ foreach ($rrd_list as $rrd)
}
- if(!$basicrrd)
+ if (!$basicrrd)
{
$rrd_optionsb .= " GPRINT:".$id.":LAST:%5.2lf%s GPRINT:".$id."min:MIN:%5.2lf%s";
$rrd_optionsb .= " GPRINT:".$id."max:MAX:%5.2lf%s GPRINT:".$id.":AVERAGE:'%5.2lf%s\\n'";
diff --git a/html/includes/graphs/generic_multi_simplex_seperated.inc.php b/html/includes/graphs/generic_multi_simplex_seperated.inc.php
index 08fef77ec..4e252a2d1 100644
--- a/html/includes/graphs/generic_multi_simplex_seperated.inc.php
+++ b/html/includes/graphs/generic_multi_simplex_seperated.inc.php
@@ -48,7 +48,7 @@ foreach ($rrd_list as $i => $rrd)
}
## Are our text values related to te multiplier/divisor or not?
- if(isset($text_orig) && $text_orig)
+ if (isset($text_orig) && $text_orig)
{
$t_defname = $rrd['rra'];
} else {
diff --git a/html/includes/graphs/macaccounting/auth.inc.php b/html/includes/graphs/macaccounting/auth.inc.php
index 50f892587..d1a6cc759 100644
--- a/html/includes/graphs/macaccounting/auth.inc.php
+++ b/html/includes/graphs/macaccounting/auth.inc.php
@@ -5,7 +5,7 @@ if (is_numeric($id))
$acc = dbFetchRow("SELECT * FROM `mac_accounting` AS M, `ports` AS I, `devices` AS D WHERE M.ma_id = ? AND I.interface_id = M.interface_id AND I.device_id = D.device_id", array($id));
- if($debug) {
+ if ($debug) {
echo("
");
print_r($acc);
echo("");
@@ -14,13 +14,13 @@ if (is_numeric($id))
if (is_array($acc))
{
- if($auth || port_permitted($acc['interface_id']))
+ if ($auth || port_permitted($acc['interface_id']))
{
- if($debug) { echo($config['rrd_dir'] . "/" . $acc['hostname'] . "/" . safename("cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd")); }
+ if ($debug) { 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 (is_file($config['rrd_dir'] . "/" . $acc['hostname'] . "/" . safename("cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd")))
{
- if($debug) { echo("exists"); }
+ if ($debug) { echo("exists"); }
$rrd_filename = $config['rrd_dir'] . "/" . $acc['hostname'] . "/" . safename("cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd");
$port = get_port_by_id($acc['interface_id']);
$device = device_by_id_cache($port['device_id']);
diff --git a/html/includes/header.inc.php b/html/includes/header.inc.php
index e4545a58e..05f35aabd 100644
--- a/html/includes/header.inc.php
+++ b/html/includes/header.inc.php
@@ -48,7 +48,7 @@ if (isset($_SESSION['authenticated']) && $_SESSION['authenticated'])
-
+
diff --git a/html/includes/hostbox-basic.inc.php b/html/includes/hostbox-basic.inc.php
index c21dc3ca4..11be6edbc 100644
--- a/html/includes/hostbox-basic.inc.php
+++ b/html/includes/hostbox-basic.inc.php
@@ -30,7 +30,7 @@ $device['os_text'] = $config['os'][$device['os']]['text'];
echo('
| ' . generate_device_link($device) . ' | '
- );
+ );
echo(' ' . $device['hardware'] . ' ' . $device['features'] . ' | ');
echo(' ' . $device['os_text'] . ' ' . $device['version'] . ' | ');
diff --git a/html/includes/hostbox.inc.php b/html/includes/hostbox.inc.php
index d08b9b2fc..43597c875 100644
--- a/html/includes/hostbox.inc.php
+++ b/html/includes/hostbox.inc.php
@@ -36,7 +36,7 @@ echo('
' . $image . '
' . generate_device_link($device) . '
' . $device['sysName'] . ' | '
- );
+ );
echo ('');
if ($port_count) { echo(' '.$port_count); }
diff --git a/html/includes/javascript-interfacepicker.inc.php b/html/includes/javascript-interfacepicker.inc.php
index d3011b02a..61116f594 100644
--- a/html/includes/javascript-interfacepicker.inc.php
+++ b/html/includes/javascript-interfacepicker.inc.php
@@ -7,12 +7,12 @@ function getInterfaceList(sel)
{
var deviceId = sel.options[sel.selectedIndex].value;
document.getElementById('interface_id').options.length = 0; // Empty city select box
- if (deviceId.length>0){
+ if (deviceId.length>0) {
var index = ajax.length;
ajax[index] = new sack();
ajax[index].requestFile = '/ajax_listports.php?device_id='+deviceId; // Specifying which file to get
- ajax[index].onCompletion = function(){ createInterfaces(index) }; // Specify function that will be executed after file has been found
+ ajax[index].onCompletion = function() { createInterfaces(index) }; // Specify function that will be executed after file has been found
ajax[index].runAJAX(); // Execute AJAX function
}
}
diff --git a/html/includes/print-interface.inc.php b/html/includes/print-interface.inc.php
index 3f28947c3..99374eaaf 100644
--- a/html/includes/print-interface.inc.php
+++ b/html/includes/print-interface.inc.php
@@ -223,7 +223,7 @@ if ($port['pagpGroupIfIndex'] && $port['pagpGroupIfIndex'] != $port['ifIndex'])
foreach(dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_low` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $higher_if)
{
- if($higher_if['interface_id_high'])
+ if ($higher_if['interface_id_high'])
{
$this_port = get_port_by_index_cache($device['device_id'], $higher_if['interface_id_high']);
echo("$br " . generate_port_link($this_port) . "");
@@ -233,7 +233,7 @@ foreach(dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_low` = ? an
foreach(dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_high` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $lower_if)
{
- if($lower_if['interface_id_low'])
+ if ($lower_if['interface_id_low'])
{
$this_port = get_port_by_index_cache($device['device_id'], $lower_if['interface_id_low']);
echo("$br " . generate_port_link($this_port) . "");
diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php
index f9674ae99..1b1e5e22c 100644
--- a/html/includes/print-menubar.php
+++ b/html/includes/print-menubar.php
@@ -49,7 +49,7 @@ foreach (dbFetchRows("SELECT * FROM `devices`") as $device)
- Search
+ Search
@@ -98,7 +98,7 @@ if ($_SESSION['userlevel'] >= '10') {
diff --git a/html/pages/device/entphysical.inc.php b/html/pages/device/entphysical.inc.php
index 5b592d21c..007fa2602 100644
--- a/html/pages/device/entphysical.inc.php
+++ b/html/pages/device/entphysical.inc.php
@@ -19,7 +19,7 @@ function printEntPhysical($ent, $level, $class)
echo(" ");
# FIXME /ciscosensors? doesn't exist anymore methinks? or does it?
$sensor = dbFetchRow("SELECT * FROM `sensors` WHERE `device_id` = ? AND `entPhysicalIndex` = ?", array($device['device_id'], $ent['entPhysicalIndex']));
- if(count($sensor))
+ if (count($sensor))
{
$link = " href='device/".$device['device_id']."/health/".$sensor['sensor_class']."/' onmouseover=\"return overlib(' ', LEFT,FGCOLOR,'#e5e5e5', BGCOLOR, '#c0c0c0', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#050505');\" onmouseout=\"return nd();\"";
}
diff --git a/html/pages/device/graphs/ipSytemStats.inc.php b/html/pages/device/graphs/ipSytemStats.inc.php
index 3d4958963..f18bf825f 100644
--- a/html/pages/device/graphs/ipSytemStats.inc.php
+++ b/html/pages/device/graphs/ipSytemStats.inc.php
@@ -1,6 +1,6 @@
- if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv6.rrd")) {
+ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv6.rrd")) {
$graph_title = "IPv6 IP Packet Statistics";
$graph_type = "device_ipSystemStats_v6";
include ("includes/print-device-graph.php");
@@ -11,7 +11,7 @@
}
- if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv4.rrd")) {
+ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv4.rrd")) {
$graph_title = "IPv4 IP Packet Statistics";
$graph_type = "device_ipSystemStats_v4";
include ("includes/print-device-graph.php");
diff --git a/html/pages/device/overview/generic/sensor.inc.php b/html/pages/device/overview/generic/sensor.inc.php
index f897c4643..8f90eaf0e 100644
--- a/html/pages/device/overview/generic/sensor.inc.php
+++ b/html/pages/device/overview/generic/sensor.inc.php
@@ -18,7 +18,7 @@ if (count($sensors))
$graph_colour = str_replace("#", "", $row_colour);
- $graph_array = array();
+ $graph_array = array();
$graph_array['height'] = "100";
$graph_array['width'] = "210";
$graph_array['to'] = $now;
diff --git a/html/pages/device/overview/ports.inc.php b/html/pages/device/overview/ports.inc.php
index 560b3eace..d8c0c4981 100644
--- a/html/pages/device/overview/ports.inc.php
+++ b/html/pages/device/overview/ports.inc.php
@@ -7,7 +7,7 @@ if ($ports['total'])
$graph_array['height'] = "100";
$graph_array['width'] = "485";
$graph_array['to'] = $now;
- $graph_array['id'] = $device['device_id'];
+ $graph_array['id'] = $device['device_id'];
$graph_array['type'] = "device_bits";
$graph_array['from'] = $day;
$graph_array['legend'] = "no";
diff --git a/html/pages/device/port/macaccounting.inc.php b/html/pages/device/port/macaccounting.inc.php
index 49becf5a7..2fb01b806 100644
--- a/html/pages/device/port/macaccounting.inc.php
+++ b/html/pages/device/port/macaccounting.inc.php
@@ -25,8 +25,8 @@ echo("");
if ($vars['subview'] == "top10")
{
- if(!isset($vars['sort'])) { $vars['sort'] = "in"; }
- if(!isset($vars['period'])) { $vars['period'] = "1day"; }
+ if (!isset($vars['sort'])) { $vars['sort'] = "in"; }
+ if (!isset($vars['period'])) { $vars['period'] = "1day"; }
$from = "-" . $vars['period'];
diff --git a/html/pages/device/port/realtime.inc.php b/html/pages/device/port/realtime.inc.php
index 9bfc63389..cde53e704 100644
--- a/html/pages/device/port/realtime.inc.php
+++ b/html/pages/device/port/realtime.inc.php
@@ -3,7 +3,7 @@
### FIXME - do this in a function and/or do it in graph-realtime.php
if(!isset($vars['interval'])) {
- if($device['os'] == "linux") {
+ if ($device['os'] == "linux") {
$vars['interval'] = "15";
} else {
$vars['interval'] = "2";
diff --git a/html/pages/device/ports/neighbours.inc.php b/html/pages/device/ports/neighbours.inc.php
index 0240176ac..8c1ea6feb 100644
--- a/html/pages/device/ports/neighbours.inc.php
+++ b/html/pages/device/ports/neighbours.inc.php
@@ -18,7 +18,7 @@ foreach(dbFetchRows("SELECT * FROM links AS L, ports AS I WHERE I.device_id = ?
echo(' ');
echo(''.generate_port_link($neighbour).' '.$neighbour['ifAlias'].' | ');
- if(is_numeric($neighbour['remote_interface_id']) && $neighbour['remote_interface_id'])
+ if (is_numeric($neighbour['remote_interface_id']) && $neighbour['remote_interface_id'])
{
$remote_port = get_port_by_id($neighbour['remote_interface_id']);
$remote_device = device_by_id_cache($remote_port['device_id']);
diff --git a/html/pages/device/routing.inc.php b/html/pages/device/routing.inc.php
index 998fd2607..e1456c899 100644
--- a/html/pages/device/routing.inc.php
+++ b/html/pages/device/routing.inc.php
@@ -43,7 +43,7 @@ if (is_file("pages/device/routing/".mres($vars['proto']).".inc.php"))
{
if ($type != "overview")
{
- if(is_file("pages/device/routing/overview/".mres($type).".inc.php")) {
+ if (is_file("pages/device/routing/overview/".mres($type).".inc.php")) {
$g_i++;
if (!is_integer($g_i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
diff --git a/html/pages/device/routing/bgp.inc.php b/html/pages/device/routing/bgp.inc.php
index 2485314c4..89066142e 100644
--- a/html/pages/device/routing/bgp.inc.php
+++ b/html/pages/device/routing/bgp.inc.php
@@ -134,7 +134,7 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? ORDER BY `b
echo(" ".$i." |
" . $peeraddresslink . " ".generate_device_link($peer, shorthost($peer['hostname']), 'bgp/')." |
- $peer_type |
+ $peer_type |
" . (isset($peer['afi']) ? $peer['afi'] : '') . " |
AS" . $peer['bgpPeerRemoteAs'] . " " . $peer['astext'] . " |
" . $peer['bgpPeerAdminStatus'] . " " . $peer['bgpPeerState'] . " |
@@ -177,7 +177,7 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? ORDER BY `b
if ($vars['view'] == 'updates') { $peer['graph'] = 1; }
- if($peer['graph'])
+ if ($peer['graph'])
{
$graph_array['height'] = "100";
$graph_array['width'] = "216";
diff --git a/html/pages/device/routing/cef.inc.php b/html/pages/device/routing/cef.inc.php
index b832f9984..7a48909d7 100644
--- a/html/pages/device/routing/cef.inc.php
+++ b/html/pages/device/routing/cef.inc.php
@@ -3,7 +3,7 @@
print_optionbar_start();
$menu_options = array('basic' => 'Basic',
- 'graphs' => 'Graphs',
+ 'graphs' => 'Graphs',
);
if (!$_GET['optb']) { $_GET['optb'] = "basic"; }
@@ -48,7 +48,7 @@ foreach (dbFetchRows("SELECT * FROM `cef_switching` WHERE `device_id` = ? ORDER
$interval = $cef['updated'] - $cef['updated_prev'];
- if(!$entity['entPhysicalModelName'] && $entity['entPhysicalContainedIn'])
+ if (!$entity['entPhysicalModelName'] && $entity['entPhysicalContainedIn'])
{
$parent_entity = dbFetchRow("SELECT * FROM `entPhysical` WHERE device_id = ? AND `entPhysicalIndex` = ?", array($device['device_id'], $entity['entPhysicalContainedIn']));
$entity_descr = $entity['entPhysicalName'] . " (" . $parent_entity['entPhysicalModelName'] .")";
@@ -77,19 +77,19 @@ foreach (dbFetchRows("SELECT * FROM `cef_switching` WHERE `device_id` = ? ORDER
echo("");
echo("".format_si($cef['drop']));
- if($cef['drop'] > $cef['drop_prev']) { echo(" (".round(($cef['drop']-$cef['drop_prev'])/$interval,2)."/sec)"); }
+ if ($cef['drop'] > $cef['drop_prev']) { echo(" (".round(($cef['drop']-$cef['drop_prev'])/$interval,2)."/sec)"); }
echo(" | ");
echo("".format_si($cef['punt']));
- if($cef['punt'] > $cef['punt_prev']) { echo(" (".round(($cef['punt']-$cef['punt_prev'])/$interval,2)."/sec)"); }
+ if ($cef['punt'] > $cef['punt_prev']) { echo(" (".round(($cef['punt']-$cef['punt_prev'])/$interval,2)."/sec)"); }
echo(" | ");
echo("".format_si($cef['punt2host']));
- if($cef['punt2host'] > $cef['punt2host_prev']) { echo(" (".round(($cef['punt2host']-$cef['punt2host_prev'])/$interval,2)."/sec)"); }
+ if ($cef['punt2host'] > $cef['punt2host_prev']) { echo(" (".round(($cef['punt2host']-$cef['punt2host_prev'])/$interval,2)."/sec)"); }
echo(" | ");
echo("
");
- if($_GET['optb'] == "graphs")
+ if ($_GET['optb'] == "graphs")
{
$graph_array['height'] = "100";
$graph_array['width'] = "215";
diff --git a/html/pages/device/routing/ospf.inc.php b/html/pages/device/routing/ospf.inc.php
index c60151312..b161b487b 100644
--- a/html/pages/device/routing/ospf.inc.php
+++ b/html/pages/device/routing/ospf.inc.php
@@ -109,7 +109,7 @@ foreach (dbFetchRows("SELECT * FROM `ospf_instances` WHERE `device_id` = ?", arr
$host = @dbFetchRow("SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE A.ipv4_address = ?
AND I.interface_id = A.interface_id AND D.device_id = I.device_id", array($nbr['ospfNbrRtrId']));
- if(is_array($host)) { $rtr_id = generate_dev_link($host, $nbr['ospfNbrRtrId']); } else { $rtr_id = "unknown"; }
+ if (is_array($host)) { $rtr_id = generate_dev_link($host, $nbr['ospfNbrRtrId']); } else { $rtr_id = "unknown"; }
echo(' ');
echo(' | ');
diff --git a/html/pages/devices.inc.php b/html/pages/devices.inc.php
index db7d192ef..33da73e7f 100644
--- a/html/pages/devices.inc.php
+++ b/html/pages/devices.inc.php
@@ -203,7 +203,7 @@ foreach ($menu_options as $option => $text)
'')).'">Restore Search');
} else {
@@ -212,7 +212,7 @@ foreach ($menu_options as $option => $text)
echo(" | ");
- if($vars['bare'] == "yes")
+ if ($vars['bare'] == "yes")
{
echo('Restore Header');
} else {
@@ -262,7 +262,7 @@ if($format == "graph")
} else {
echo('');
- if($subformat = "detail")
+ if ($subformat = "detail")
{
echo(' | Device | | Operating System | Platform | Uptime/Location | ');
}
@@ -274,7 +274,7 @@ if($format == "graph")
if (!$location_filter || ((get_dev_attrib($device,'override_sysLocation_bool') && get_dev_attrib($device,'override_sysLocation_string') == $location_filter)
|| $device['location'] == $location_filter))
{
- if($subformat == "detail")
+ if ($subformat == "detail")
{
include("includes/hostbox.inc.php");
} else {
diff --git a/html/pages/front/default.php b/html/pages/front/default.php
index 1a151899d..c7af666d2 100644
--- a/html/pages/front/default.php
+++ b/html/pages/front/default.php
@@ -15,7 +15,7 @@ $sql = mysql_query("SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` =
} else {
$sql = mysql_query("SELECT * FROM `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND D.status = '0' AND D.ignore = '0'");
}
-while ($device = mysql_fetch_assoc($sql)){
+while ($device = mysql_fetch_assoc($sql)) {
generate_front_box("#ffaaaa", "".generate_device_link($device, shorthost($device['hostname']))."
Device Down
diff --git a/html/pages/front/demo.php b/html/pages/front/demo.php
index bb9719cc4..8d6973d6e 100644
--- a/html/pages/front/demo.php
+++ b/html/pages/front/demo.php
@@ -69,7 +69,7 @@ $nodes = array();
$sql = mysql_query("SELECT * FROM `devices` AS D, `devices_attribs` AS A WHERE D.status = '1' AND A.device_id = D.device_id AND A.attrib_type = 'uptime' AND A.attrib_value > '0' AND A.attrib_value < '86400'");
-while ($device = mysql_fetch_array($sql)){
+while ($device = mysql_fetch_array($sql)) {
unset($already);
$i = 0;
while ($i <= count($nodes)) {
@@ -84,7 +84,7 @@ while ($device = mysql_fetch_array($sql)){
$sql = mysql_query("SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'");
-while ($device = mysql_fetch_array($sql)){
+while ($device = mysql_fetch_array($sql)) {
if (device_permitted($device['device_id'])) {
echo("
".generate_device_link($device, shorthost($device['hostname']))."
@@ -157,7 +157,7 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c
}
echo("
- $errorboxes
+ $errorboxes
Recent Syslog Messages
");
diff --git a/html/pages/front/example2.php b/html/pages/front/example2.php
index dd5d8daf9..3b167566e 100644
--- a/html/pages/front/example2.php
+++ b/html/pages/front/example2.php
@@ -28,7 +28,7 @@ while ($device = mysql_fetch_assoc($sql))
}
$sql = mysql_query("SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'");
-while ($device = mysql_fetch_assoc($sql)){
+while ($device = mysql_fetch_assoc($sql)) {
echo("
".generate_device_link($device, shorthost($device['hostname']))."
@@ -39,7 +39,7 @@ while ($device = mysql_fetch_assoc($sql)){
}
$sql = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0'");
-while ($interface = mysql_fetch_assoc($sql)){
+while ($interface = mysql_fetch_assoc($sql)) {
echo("
".generate_device_link($interface, shorthost($interface['hostname']))."
@@ -51,7 +51,7 @@ while ($interface = mysql_fetch_assoc($sql)){
}
$sql = mysql_query("SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0'");
-while ($service = mysql_fetch_assoc($sql)){
+while ($service = mysql_fetch_assoc($sql)) {
echo("
".generate_device_link($service, shorthost($service['hostname']))."
@@ -63,7 +63,7 @@ while ($service = mysql_fetch_assoc($sql)){
}
$sql = mysql_query("SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerState != 'established' AND B.device_id = D.device_id");
-while ($peer = mysql_fetch_assoc($sql)){
+while ($peer = mysql_fetch_assoc($sql)) {
echo("
".generate_device_link($peer, shorthost($peer['hostname']))."
@@ -77,7 +77,7 @@ while ($peer = mysql_fetch_assoc($sql)){
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
{
$sql = mysql_query("SELECT * FROM `devices` AS D, devices_attribs AS A WHERE A.device_id = D.device_id AND A.attrib_type = 'uptime' AND A.attrib_value < '" . $config['uptime_warning'] . "'");
- while ($device = mysql_fetch_assoc($sql)){
+ while ($device = mysql_fetch_assoc($sql)) {
echo("
".generate_device_link($device, shorthost($device['hostname']))."
@@ -89,7 +89,7 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c
echo("
- $errorboxes
+ $errorboxes
Recent Syslog Messages
diff --git a/html/pages/front/jt.php b/html/pages/front/jt.php
index 1c7beb4f4..afcf180c3 100644
--- a/html/pages/front/jt.php
+++ b/html/pages/front/jt.php
@@ -14,7 +14,7 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c
$sql = mysql_query("SELECT * FROM `devices` AS D, `devices_attribs` AS A WHERE D.status = '1' AND A.device_id = D.device_id AND A.attrib_type = 'uptime' AND A.attrib_value > '0' " . $uptimesql);
-while ($device = mysql_fetch_assoc($sql)){
+while ($device = mysql_fetch_assoc($sql)) {
unset($already);
$i = 0;
while ($i <= count($nodes)) {
@@ -29,7 +29,7 @@ while ($device = mysql_fetch_assoc($sql)){
$sql = mysql_query("SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'");
-while ($device = mysql_fetch_assoc($sql)){
+while ($device = mysql_fetch_assoc($sql)) {
if (device_permitted($device['device_id'])) {
echo("
".generate_device_link($device, shorthost($device['hostname']))."
@@ -42,7 +42,7 @@ while ($device = mysql_fetch_assoc($sql)){
if ($config['warn']['ifdown']) {
$sql = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0'");
-while ($interface = mysql_fetch_assoc($sql)){
+while ($interface = mysql_fetch_assoc($sql)) {
if (port_permitted($interface['interface_id'])) {
echo("
".generate_device_link($interface, shorthost($interface['hostname']))."
@@ -56,7 +56,7 @@ while ($interface = mysql_fetch_assoc($sql)){
}
$sql = mysql_query("SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0'");
-while ($service = mysql_fetch_assoc($sql)){
+while ($service = mysql_fetch_assoc($sql)) {
if (device_permitted($service['device_id'])) {
echo("
".generate_device_link($service, shorthost($service['hostname']))."
@@ -68,7 +68,7 @@ while ($service = mysql_fetch_assoc($sql)){
}
$sql = mysql_query("SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerAdminStatus = 'start' AND bgpPeerState != 'established' AND B.device_id = D.device_id");
-while ($peer = mysql_fetch_assoc($sql)){
+while ($peer = mysql_fetch_assoc($sql)) {
if (device_permitted($peer['device_id'])) {
echo("
".generate_device_link($peer, shorthost($peer['hostname']))."
@@ -82,7 +82,7 @@ while ($peer = mysql_fetch_assoc($sql)){
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
{
$sql = mysql_query("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_value < '" . $config['uptime_warning'] . "' AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0'");
- while ($device = mysql_fetch_assoc($sql)){
+ while ($device = mysql_fetch_assoc($sql)) {
if (device_permitted($device['device_id']) && $device['attrib_value'] < $config['uptime_warning'] && $device['attrib_type'] == "uptime") {
echo("
".generate_device_link($device, shorthost($device['hostname']))."
@@ -96,7 +96,7 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c
echo("
- $errorboxes
+ $errorboxes
Recent Syslog Messages
diff --git a/html/pages/front/traffic.php b/html/pages/front/traffic.php
index 36ba7ad96..a8478b011 100644
--- a/html/pages/front/traffic.php
+++ b/html/pages/front/traffic.php
@@ -81,7 +81,7 @@ foreach (dbFetchRows("SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerA
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
{
- foreach (dbFetchRows("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_value < ? AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0'", array($config['uptime_warning'])) as $device){
+ foreach (dbFetchRows("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_value < ? AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0'", array($config['uptime_warning'])) as $device) {
if (device_permitted($device['device_id']) && $device['attrib_value'] < $config['uptime_warning'] && $device['attrib_type'] == "uptime") {
echo("
".generate_device_link($device, shorthost($device['hostname']))."
@@ -95,7 +95,7 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c
echo("
- $errorboxes
+ $errorboxes
Recent Syslog Messages
diff --git a/html/pages/health/sensors.inc.php b/html/pages/health/sensors.inc.php
index 2316075ad..a4c42d284 100644
--- a/html/pages/health/sensors.inc.php
+++ b/html/pages/health/sensors.inc.php
@@ -16,8 +16,8 @@ echo(' |