";
$graph_array['legend'] = "yes";
@@ -30,10 +30,8 @@ if($ports['total']) {
$link = $config['base_url'] . "/graphs/" . $graph_array['id'] . "/" . $graph_array['type'] . "/" . $day . "/" . $config['now'] . "/";
-
echo(overlib_link($link, $graph, $content, NULL));
-
echo('
');
echo('
@@ -50,14 +48,18 @@ if($ports['total']) {
$sql = "SELECT * FROM ports WHERE `device_id` = '" . $device['device_id'] . "' AND deleted != '1'";
$query = mysql_query($sql);
$ifsep = "";
- while($data = mysql_fetch_array($query)) {
+
+ while ($data = mysql_fetch_array($query))
+ {
$data = ifNameDescr($data);
$data = array_merge($data, $device);
echo("$ifsep" . generate_port_link($data, makeshortif(strtolower($data['label']))));
$ifsep = ", ";
}
+
unset($ifsep);
echo(" ");
echo("");
}
-?>
+
+?>
\ No newline at end of file
diff --git a/html/pages/device/overview/processors.inc.php b/html/pages/device/overview/processors.inc.php
index 75c53d9e1..119982427 100644
--- a/html/pages/device/overview/processors.inc.php
+++ b/html/pages/device/overview/processors.inc.php
@@ -2,15 +2,17 @@
$graph_type = "processor_usage";
-if(mysql_result(mysql_query("SELECT count(*) from processors WHERE device_id = '" . $device['device_id'] . "'"),0)) {
+if (mysql_result(mysql_query("SELECT count(*) from processors WHERE device_id = '" . $device['device_id'] . "'"),0))
+{
$processor_rows = 0;
echo("");
echo("
Processors
");
echo("
");
$i = '1';
$procs = mysql_query("SELECT * FROM `processors` WHERE device_id = '" . $device['device_id'] . "' ORDER BY processor_descr ASC");
- while($proc = mysql_fetch_array($procs)) {
- if(is_integer($processor_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
+ while ($proc = mysql_fetch_array($procs))
+ {
+ if (is_integer($processor_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
$proc_url = $config['base_url'] . "/device/".$device['device_id']."/health/processors/";
@@ -29,12 +31,11 @@ if(mysql_result(mysql_query("SELECT count(*) from processors WHERE device_id = '
$perc = $proc['processor_usage'];
- if($perc > '90') { $left_background='c4323f'; $right_background='C96A73';
- } elseif($perc > '75') { $left_background='bf5d5b'; $right_background='d39392';
- } elseif($perc > '50') { $left_background='bf875b'; $right_background='d3ae92';
- } elseif($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3';
- } else { $left_background='9abf5b'; $right_background='bbd392'; }
-
+ if ($perc > '90') { $left_background='c4323f'; $right_background='C96A73'; }
+ elseif ($perc > '75') { $left_background='bf5d5b'; $right_background='d39392'; }
+ elseif ($perc > '50') { $left_background='bf875b'; $right_background='d3ae92'; }
+ elseif ($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3'; }
+ else { $left_background='9abf5b'; $right_background='bbd392'; }
echo("" . $text_descr . "
@@ -42,10 +43,11 @@ if(mysql_result(mysql_query("SELECT count(*) from processors WHERE device_id = '
".print_percentage_bar (200, 20, $perc, NULL, "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."
");
- $processor_rows++;
+ $processor_rows++;
}
+
echo("
");
echo("
");
}
-?>
+?>
\ No newline at end of file
diff --git a/html/pages/device/overview/storage.inc.php b/html/pages/device/overview/storage.inc.php
index 10a8f448a..bdb47d917 100644
--- a/html/pages/device/overview/storage.inc.php
+++ b/html/pages/device/overview/storage.inc.php
@@ -2,36 +2,43 @@
$graph_type = "storage_usage";
-if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE device_id = '" . $device['device_id'] . "'"),0)) {
+if (mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE device_id = '" . $device['device_id'] . "'"),0))
+{
echo("");
echo("
Storage
");
echo("
");
$drive_rows = '0';
$drives = mysql_query("SELECT * FROM `storage` WHERE device_id = '" . $device['device_id'] . "' ORDER BY storage_descr ASC");
- while($drive = mysql_fetch_array($drives)) {
-
+ while ($drive = mysql_fetch_array($drives))
+ {
$skipdrive = 0;
- if ($device["os"] == "junos") {
- foreach ($config['ignore_junos_os_drives'] as $jdrive) {
- if (preg_match($jdrive, $drive["storage_descr"])) {
- $skipdrive = 1;
- }
+ if ($device["os"] == "junos")
+ {
+ foreach ($config['ignore_junos_os_drives'] as $jdrive)
+ {
+ if (preg_match($jdrive, $drive["storage_descr"]))
+ {
+ $skipdrive = 1;
}
- $drive["storage_descr"] = preg_replace("/.*mounted on: (.*)/", "\\1", $drive["storage_descr"]);
+ }
+ $drive["storage_descr"] = preg_replace("/.*mounted on: (.*)/", "\\1", $drive["storage_descr"]);
}
- if ($device['os'] == "freebsd") {
- foreach ($config['ignore_bsd_os_drives'] as $jdrive) {
- if (preg_match($jdrive, $drive["storage_descr"])) {
- $skipdrive = 1;
- }
+ if ($device['os'] == "freebsd")
+ {
+ foreach ($config['ignore_bsd_os_drives'] as $jdrive)
+ {
+ if (preg_match($jdrive, $drive["storage_descr"]))
+ {
+ $skipdrive = 1;
}
+ }
}
if ($skipdrive) { continue; }
- if(is_integer($drive_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
+ if (is_integer($drive_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
$perc = round($drive['storage_perc'], 0);
$total = formatStorage($drive['storage_size']);
$free = formatStorage($drive['storage_free']);
@@ -45,24 +52,23 @@ if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE device_
$mini_graph = $config['base_url'] . "/graph.php?id=".$drive['storage_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4";
+ if ($perc > '90') { $left_background='c4323f'; $right_background='C96A73'; }
+ elseif ($perc > '75') { $left_background='bf5d5b'; $right_background='d39392'; }
+ elseif ($perc > '50') { $left_background='bf875b'; $right_background='d3ae92'; }
+ elseif ($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3'; }
+ else { $left_background='9abf5b'; $right_background='bbd392'; }
-
- if($perc > '90') { $left_background='c4323f'; $right_background='C96A73';
- } elseif($perc > '75') { $left_background='bf5d5b'; $right_background='d39392';
- } elseif($perc > '50') { $left_background='bf875b'; $right_background='d3ae92';
- } elseif($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3';
- } else { $left_background='9abf5b'; $right_background='bbd392'; }
-
echo("" . $drive['storage_descr'] . "
".print_percentage_bar (200, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."
");
$drive_rows++;
}
+
echo("
");
echo("
");
}
unset ($drive_rows);
-?>
+?>
\ No newline at end of file
diff --git a/html/pages/device/port/adsl.inc.php b/html/pages/device/port/adsl.inc.php
index 57c405fe9..276f1fa70 100644
--- a/html/pages/device/port/adsl.inc.php
+++ b/html/pages/device/port/adsl.inc.php
@@ -1,39 +1,23 @@
ADSL Line Speed");
+ $graph_type = "port_adsl_speed";
+ include("includes/print-interface-graphs.inc.php");
- $iid = $id;
- echo("ADSL Line Speed
");
- $graph_type = "port_adsl_speed";
- include("includes/print-interface-graphs.inc.php");
+ echo("ADSL Line Attenuation
");
+ $graph_type = "port_adsl_attenuation";
+ include("includes/print-interface-graphs.inc.php");
- echo("ADSL Line Attenuation
");
- $graph_type = "port_adsl_attenuation";
- include("includes/print-interface-graphs.inc.php");
+ echo("ADSL Line SNR Margin
");
+ $graph_type = "port_adsl_snr";
+ include("includes/print-interface-graphs.inc.php");
- echo("ADSL Line SNR Margin
");
- $graph_type = "port_adsl_snr";
- include("includes/print-interface-graphs.inc.php");
+ echo("ADSL Output Powers
");
+ $graph_type = "port_adsl_power";
+ include("includes/print-interface-graphs.inc.php");
+}
- echo("ADSL Output Powers
");
- $graph_type = "port_adsl_power";
- include("includes/print-interface-graphs.inc.php");
-
-
- }
-
-# $graph_array['height'] = "100";
-# $graph_array['width'] = "385";
-# $graph_array['to'] = $now;
-# $graph_array['port'] = $ports['fileserver'];
-# $graph_array['type'] = "port_bits";
-# $graph_array['from'] = $day;
-# $graph_array['legend'] = "no";
-
-# $graph_array['popup_title'] = "Central Fileserver";
-
-# print_graph_popup($graph_array);
-
-
-
-?>
+?>
\ No newline at end of file
diff --git a/html/pages/device/port/graphs.inc.php b/html/pages/device/port/graphs.inc.php
index e34d29e02..38b350858 100644
--- a/html/pages/device/port/graphs.inc.php
+++ b/html/pages/device/port/graphs.inc.php
@@ -1,30 +1,30 @@
Interface Traffic");
+ $graph_type = "port_bits";
+ include("includes/print-interface-graphs.inc.php");
- $iid = $id;
- echo("Interface Traffic
");
- $graph_type = "port_bits";
+ echo("Interface Packets
");
+ $graph_type = "port_upkts";
+ include("includes/print-interface-graphs.inc.php");
+
+ echo("Interface Non Unicast
");
+ $graph_type = "port_nupkts";
+ include("includes/print-interface-graphs.inc.php");
+
+ echo("Interface Errors
");
+ $graph_type = "port_errors";
+ include("includes/print-interface-graphs.inc.php");
+
+ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . $interface['ifIndex'] . "-dot3.rrd"))
+ {
+ echo("Ethernet Errors
");
+ $graph_type = "port_etherlike";
include("includes/print-interface-graphs.inc.php");
-
- echo("Interface Packets
");
- $graph_type = "port_upkts";
- include("includes/print-interface-graphs.inc.php");
-
- echo("Interface Non Unicast
");
- $graph_type = "port_nupkts";
- include("includes/print-interface-graphs.inc.php");
-
- echo("Interface Errors
");
- $graph_type = "port_errors";
- include("includes/print-interface-graphs.inc.php");
-
- if(is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . $interface['ifIndex'] . "-dot3.rrd")) {
- echo("Ethernet Errors
");
- $graph_type = "port_etherlike";
- include("includes/print-interface-graphs.inc.php");
- }
}
+}
-
-?>
+?>
\ No newline at end of file
diff --git a/html/pages/device/port/junose-atm-vp.inc.php b/html/pages/device/port/junose-atm-vp.inc.php
index eaebce14a..3edbc50dc 100644
--- a/html/pages/device/port/junose-atm-vp.inc.php
+++ b/html/pages/device/port/junose-atm-vp.inc.php
@@ -1,39 +1,42 @@
");
+echo('');
- $vps = mysql_query("SELECT * FROM juniAtmVp WHERE interface_id = '".$interface['interface_id']."'");
- while($vp = mysql_fetch_array($vps)) {
- if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
- echo('');
- echo(''.$row.'. VP'.$vp['vp_id'].' '.$vp['vp_descr'].' ');
- echo(' ');
+$vps = mysql_query("SELECT * FROM juniAtmVp WHERE interface_id = '".$interface['interface_id']."'");
+while ($vp = mysql_fetch_array($vps))
+{
+ if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
+ echo('');
+ echo(''.$row.'. VP'.$vp['vp_id'].' '.$vp['vp_descr'].' ');
+ echo(' ');
- $graph_array['height'] = "100";
- $graph_array['width'] = "214";
- $graph_array['to'] = $now;
- $graph_array['id'] = $vp['juniAtmVp_id'];
- $graph_array['type'] = $graph_type;
+ $graph_array['height'] = "100";
+ $graph_array['width'] = "214";
+ $graph_array['to'] = $now;
+ $graph_array['id'] = $vp['juniAtmVp_id'];
+ $graph_array['type'] = $graph_type;
- $periods = array('day', 'week', 'month', 'year');
-
- echo('');
- foreach($periods as $period) {
- $graph_array['from'] = $$period;
- $graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400";
- echo(overlib_link($_SERVER['REQUEST_URI'], generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL));
- }
- echo(" ");
-
- $row++;
+ $periods = array('day', 'week', 'month', 'year');
+ echo('');
+
+ foreach ($periods as $period)
+ {
+ $graph_array['from'] = $$period;
+ $graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400";
+ echo(overlib_link($_SERVER['REQUEST_URI'], generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL));
}
+
+ echo(' ');
- echo("
");
+ $row++;
+}
-?>
+echo('
');
+
+?>
\ No newline at end of file
diff --git a/html/pages/device/port/macaccounting.inc.php b/html/pages/device/port/macaccounting.inc.php
index 1f03c0095..0b1091b2b 100644
--- a/html/pages/device/port/macaccounting.inc.php
+++ b/html/pages/device/port/macaccounting.inc.php
@@ -1,204 +1,218 @@
Disabled"; }
- if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "down") { $status = "
Enabled / Disconnected "; }
- if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "up") { $status = "
Enabled / Connected "; }
+$color = "black";
+if ($interface['ifAdminStatus'] == "down") { $status = "
Disabled "; }
+if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "down") { $status = "
Enabled / Disconnected "; }
+if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "up") { $status = "
Enabled / Connected "; }
- $i = 1;
- $inf = fixifName($ifname);
+$i = 1;
+$inf = fixifName($ifname);
- echo("
");
+echo("
");
- if($_GET['optd'] == "top10") {
- if($_GET['opte']) {
- $period = $_GET['opte'];
- } else { $period = "1day"; }
- $from = "-" . $period;
- if($_GET['optc']) {
- $stat = $_GET['optc'];
- } else { $stat = "bits"; }
- if($_GET['optf']) {
- $sort = $_GET['optf'];
- } else { $sort = "in"; }
+if ($_GET['optd'] == "top10")
+{
+ if ($_GET['opte'])
+ {
+ $period = $_GET['opte'];
+ } else { $period = "1day"; }
+ $from = "-" . $period;
+ if ($_GET['optc'])
+ {
+ $stat = $_GET['optc'];
+ } else { $stat = "bits"; }
- echo("
-
-
-
+
+
Packets
+
+
+
+
+
+
Top Input
+
+
+
+
+
+
Top Output
+
+
+
+
+
+
Top Aggregate
+
+
+
+
+
+
");
- unset($query);
- } else {
+ unset($query);
+ }
+ else
+ {
- $query = mysql_query("SELECT *, (M.cipMacHCSwitchedBytes_input_rate + M.cipMacHCSwitchedBytes_output_rate) as bps FROM `mac_accounting` AS M,
- `ports` AS I, `devices` AS D WHERE M.interface_id = '".$interface['interface_id']."' AND I.interface_id = M.interface_id
- AND I.device_id = D.device_id ORDER BY bps DESC");
+ $query = mysql_query("SELECT *, (M.cipMacHCSwitchedBytes_input_rate + M.cipMacHCSwitchedBytes_output_rate) as bps FROM `mac_accounting` AS M,
+ `ports` AS I, `devices` AS D WHERE M.interface_id = '".$interface['interface_id']."' AND I.interface_id = M.interface_id
+ AND I.device_id = D.device_id ORDER BY bps DESC");
- while($acc = mysql_fetch_array($query)) {
- if(!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
- $addy = mysql_fetch_array(mysql_query("SELECT * FROM ipv4_mac where mac_address = '".$acc['mac']."'"));
- $name = gethostbyaddr($addy['ipv4_address']);
+ while ($acc = mysql_fetch_array($query))
+ {
+ if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
+ $addy = mysql_fetch_array(mysql_query("SELECT * FROM ipv4_mac where mac_address = '".$acc['mac']."'"));
+ $name = gethostbyaddr($addy['ipv4_address']);
- $arp_host = mysql_fetch_array(mysql_query("SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE A.ipv4_address = '".$addy['ipv4_address']."' AND I.interface_id = A.interface_id AND D.device_id = I.device_id"));
- if($arp_host) { $arp_name = generate_device_link($arp_host); $arp_name .= " ".generate_port_link($arp_host); } else { unset($arp_if); }
+ $arp_host = mysql_fetch_array(mysql_query("SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE A.ipv4_address = '".$addy['ipv4_address']."' AND I.interface_id = A.interface_id AND D.device_id = I.device_id"));
+ if ($arp_host) { $arp_name = generate_device_link($arp_host); $arp_name .= " ".generate_port_link($arp_host); } else { unset($arp_if); }
+
+ if ($name == $addy['ipv4_address']) { unset ($name); }
+ if (mysql_result(mysql_query("SELECT count(*) FROM bgpPeers WHERE device_id = '".$acc['device_id']."' AND bgpPeerIdentifier = '".$addy['ipv4_address']."'"),0))
+ {
+ $peer_query = mysql_query("SELECT * FROM bgpPeers WHERE device_id = '".$acc['device_id']."' AND bgpPeerIdentifier = '".$addy['ipv4_address']."'");
+ $peer_info = mysql_fetch_array($peer_query);
+ } else { unset ($peer_info); }
+
+ if ($peer_info)
+ {
+ $asn = "AS".$peer_info['bgpPeerRemoteAs']; $astext = $peer_info['astext'];
+ } else {
+ unset ($as); unset ($astext); unset($asn);
+ }
+
+ if ($_GET['optc'])
+ {
+ $graph_type = "port_mac_acc_" . $_GET['optc'];
+ } else {
+ $graph_type = "port_mac_acc_bits";
+ }
+
+ if ($_GET['optd'] == "thumbs")
+ {
+ if (!$asn) { $asn = "No Session"; }
+
+ echo("
\
+
\
+ ', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >
+
+
+
".$name."
+
");
- if($name == $addy['ipv4_address']) { unset ($name); }
- if(mysql_result(mysql_query("SELECT count(*) FROM bgpPeers WHERE device_id = '".$acc['device_id']."' AND bgpPeerIdentifier = '".$addy['ipv4_address']."'"),0)) {
- $peer_query = mysql_query("SELECT * FROM bgpPeers WHERE device_id = '".$acc['device_id']."' AND bgpPeerIdentifier = '".$addy['ipv4_address']."'");
- $peer_info = mysql_fetch_array($peer_query);
- } else { unset ($peer_info); }
- if($peer_info) { $asn = "AS".$peer_info['bgpPeerRemoteAs']; $astext = $peer_info['astext']; } else {
- unset ($as); unset ($astext); unset($asn);
}
+ else
+ {
+ echo("
");
- if($_GET['optc']) {
- $graph_type = "port_mac_acc_" . $_GET['optc'];
- } else {
- $graph_type = "port_mac_acc_bits";
- }
+ echo("
+
+
+ ".mac_clean_to_readable($acc['mac'])."
+ ".$addy['ipv4_address']."
+ ".$name." ".$arp_name . "
+ ".formatRates($acc['cipMacHCSwitchedBytes_input_rate'] / 8)."
+ ".formatRates($acc['cipMacHCSwitchedBytes_output_rate'] / 8)."
+
+
+ ");
- if($_GET['optd'] == "thumbs") {
+ $peer_info['astext'];
- if(!$asn) { $asn = "No Session"; }
+ $daily_traffic = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$day&to=$now&width=210&height=100";
+ $daily_url = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$day&to=$now&width=500&height=150";
+ $weekly_traffic = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$week&to=$now&width=210&height=100";
+ $weekly_url = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$week&to=$now&width=500&height=150";
+ $monthly_traffic = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$month&to=$now&width=210&height=100";
+ $monthly_url = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$month&to=$now&width=500&height=150";
+ $yearly_traffic = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$year&to=$now&width=210&height=100";
+ $yearly_url = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$year&to=$now&width=500&height=150";
- echo("
\
-
\
- ', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >
-
+ echo("
', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
+ ");
+ echo("
', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
+ ");
+ echo("
', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
+ ");
+ echo("
', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
+ ");
-
".$name."
-
");
-
- } else {
-
- echo("
");
- $i++;
- }
+ echo("
");
+ $i++;
+ }
+ }
}
-}
-
-?>
+?>
\ No newline at end of file
diff --git a/html/pages/device/port/pagp.inc.php b/html/pages/device/port/pagp.inc.php
index 57b88c819..2c0066309 100644
--- a/html/pages/device/port/pagp.inc.php
+++ b/html/pages/device/port/pagp.inc.php
@@ -1,37 +1,35 @@
', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
-
");
- echo("
', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
- ");
- echo("
', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
- ");
- echo("
', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
- ");
+echo("
', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
+ ");
+echo("
', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
+ ");
+echo("
', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
+ ");
+echo("
', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
+ ");
+$members = mysql_query("SELECT * FROM `ports` WHERE `pagpGroupIfIndex` = '".$interface['ifIndex']."' and `device_id` = '".$device['device_id']."'");
+while ($member = mysql_fetch_array($members))
+{
+ echo("$br
" . generate_port_link($member) . " (PAgP) ");
+ $br = "
";
+}
-
- $members = mysql_query("SELECT * FROM `ports` WHERE `pagpGroupIfIndex` = '".$interface['ifIndex']."' and `device_id` = '".$device['device_id']."'");
- while($member = mysql_fetch_array($members)) {
- echo("$br
" . generate_port_link($member) . " (PAgP) ");
- $br = "
";
- }
-
-
-?>
+?>
\ No newline at end of file
diff --git a/html/pages/device/ports.inc.php b/html/pages/device/ports.inc.php
index db545e896..b1d9f0755 100644
--- a/html/pages/device/ports.inc.php
+++ b/html/pages/device/ports.inc.php
@@ -1,42 +1,44 @@
Basic |
-
Details |
-
ARP Table |
+echo("
Basic |
+
Details |
+
ARP Table |
ADSL |
Graphs: ");
$graph_types = array("bits" => "Bits",
"upkts" => "Unicast Packets",
- "nupkts" => "Non-Unicast Packets",
- "errors" => "Errors",
+ "nupkts" => "Non-Unicast Packets",
+ "errors" => "Errors",
"etherlike" => "Etherlike");
-foreach ($graph_types as $type => $descr) {
- echo("$type_sep
-
$descr
+foreach ($graph_types as $type => $descr)
+{
+ echo("$type_sep
+
$descr
(
Mini ) ");
$type_sep = " | ";
}
-
print_optionbar_end();
-if($_GET['optc'] == thumbs) {
-
+if ($_GET['optc'] == thumbs)
+{
$timeperiods = array('-1day','-1week','-1month','-1year');
$from = '-1day';
echo("
");
$sql = "select * from ports WHERE device_id = '".$device['device_id']."' ORDER BY ifIndex";
$query = mysql_query($sql);
unset ($seperator);
- while($interface = mysql_fetch_assoc($query)) {
+ while ($interface = mysql_fetch_assoc($query))
+ {
echo("
".makeshortif($interface['ifDescr'])."
");
} else {
- if($_GET['opta'] == "arp" ) {
+ if ($_GET['opta'] == "arp" )
+ {
include("arp.inc.php");
- } elseif($_GET['opta'] == "adsl") {
+ } elseif ($_GET['opta'] == "adsl") {
echo("");
echo("Port Traffic Sync Speed Attainable Speed Attenuation SNR Margin Output Powers ");
$i = "0";
$interface_query = mysql_query("select * from `ports` AS P, `ports_adsl` AS A WHERE P.device_id = '".$device['device_id']."' AND A.interface_id = P.interface_id AND P.deleted = '0' ORDER BY `ifIndex` ASC");
- while($interface = mysql_fetch_assoc($interface_query)) {
+ while ($interface = mysql_fetch_assoc($interface_query))
+ {
include("includes/print-interface-adsl.inc.php");
$i++;
}
echo("
");
echo("
");
} else {
- if($_GET['opta'] == "details" ) { $port_details = 1; }
+ if ($_GET['opta'] == "details" ) { $port_details = 1; }
echo("");
$i = "1";
$interface_query = mysql_query("select * from ports WHERE device_id = '".$device['device_id']."' AND deleted = '0' ORDER BY `ifIndex` ASC");
- while($interface = mysql_fetch_assoc($interface_query)) {
+ while ($interface = mysql_fetch_assoc($interface_query))
+ {
include("includes/print-interface.inc.php");
- $i++;
+ $i++;
}
echo("
");
echo("
");
}
}
-?>
+?>
\ No newline at end of file
diff --git a/html/pages/device/showconfig.inc.php b/html/pages/device/showconfig.inc.php
index af99abe72..e369084bd 100644
--- a/html/pages/device/showconfig.inc.php
+++ b/html/pages/device/showconfig.inc.php
@@ -2,13 +2,14 @@
include("includes/geshi/geshi.php");
-if($_SESSION['userlevel'] >= "7") {
+if ($_SESSION['userlevel'] >= "7")
+{
+ if (!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); }
- if(!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); }
-
- foreach($config['rancid_configs'] as $configs) {
+ foreach ($config['rancid_configs'] as $configs)
+ {
if ($configs[strlen($configs)-1] != '/') { $configs .= '/'; }
- if(is_file($configs . $device['hostname'])) { $file = $configs . $device['hostname']; }
+ if (is_file($configs . $device['hostname'])) { $file = $configs . $device['hostname']; }
}
$fh = fopen($file, 'r') or die("Can't open file");
@@ -24,12 +25,13 @@ if($_SESSION['userlevel'] >= "7") {
}
$text = join("\n",$lines);
}
+
$language = "ios";
$geshi = new GeSHi($text, $language);
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
$geshi->set_overall_style('color: black;');
- #$geshi->set_line_style('color: #999999');
+ #$geshi->set_line_style('color: #999999');
echo($geshi->parse_code());
}
-?>
+?>
\ No newline at end of file
diff --git a/html/pages/device/srv.inc.php b/html/pages/device/srv.inc.php
index 1e0d2e5c1..3d9ec7d2b 100644
--- a/html/pages/device/srv.inc.php
+++ b/html/pages/device/srv.inc.php
@@ -1,22 +1,20 @@
'0') {
-
- echo("");
- $i = "1";
- $service_query = mysql_query("select * from services WHERE device_id = '".$device['device_id']."' ORDER BY service_type");
- while($service = mysql_fetch_array($service_query)) {
-
- include("includes/print-service.inc");
- }
- echo("
");
-
-} else {
+if (mysql_result(mysql_query("select count(service_id) from services WHERE device_id = '".$device['device_id']."'"), 0) > '0')
+{
+ echo("");
+ $i = "1";
+ $service_query = mysql_query("select * from services WHERE device_id = '".$device['device_id']."' ORDER BY service_type");
+ while ($service = mysql_fetch_array($service_query))
+ {
+ include("includes/print-service.inc");
+ }
+ echo("
");
+}
+else
+{
echo("No Services");
-
}
-
-?>
-
+?>
\ No newline at end of file
diff --git a/html/pages/device/syslog.inc.php b/html/pages/device/syslog.inc.php
index eb8d6518c..83ea15041 100644
--- a/html/pages/device/syslog.inc.php
+++ b/html/pages/device/syslog.inc.php
@@ -1,6 +1,6 @@
-
@@ -14,9 +14,9 @@ print_optionbar_start('25');
All Programs
".$data['program']."");
}
?>
@@ -29,11 +29,13 @@ print_optionbar_start('25');
print_optionbar_end();
-if($_POST['string']) {
+if ($_POST['string'])
+{
$where = " AND msg LIKE '%".$_POST['string']."%'";
}
-if($_POST['program']) {
+if ($_POST['program'])
+{
$where .= " AND program = '".$_POST['program']."'";
}
@@ -41,7 +43,7 @@ $sql = "SELECT *, DATE_FORMAT(timestamp, '%D %b %T') AS date from syslog WHERE
$sql .= " ORDER BY timestamp DESC LIMIT 1000";
$query = mysql_query($sql);
echo(" ");
-while($entry = mysql_fetch_array($query)) { include("includes/print-syslog.inc"); }
+while ($entry = mysql_fetch_array($query)) { include("includes/print-syslog.inc"); }
echo("
");
-?>
+?>
\ No newline at end of file
diff --git a/html/pages/device/vlans.inc.php b/html/pages/device/vlans.inc.php
index d6412432b..43c09c9ae 100644
--- a/html/pages/device/vlans.inc.php
+++ b/html/pages/device/vlans.inc.php
@@ -3,22 +3,25 @@
print_optionbar_start();
echo("
-
Basic | Graphs :
+
Basic | Graphs :
Bits |
-
Packets |
-
NU Packets |
+
Packets |
+
NU Packets |
Errors ");
print_optionbar_end();
+echo('
');
- echo("");
- $i = "1";
- $vlan_query = mysql_query("select * from vlans WHERE device_id = '".$_GET['id']."' ORDER BY 'vlan_vlan'");
- while($vlan = mysql_fetch_array($vlan_query)) {
- include("includes/print-vlan.inc.php");
- $i++;
- }
- echo("
");
+$i = "1";
+$vlan_query = mysql_query("select * from vlans WHERE device_id = '".mres($_GET['id'])."' ORDER BY 'vlan_vlan'");
-?>
+while ($vlan = mysql_fetch_array($vlan_query))
+{
+ include("includes/print-vlan.inc.php");
+ $i++;
+}
+
+echo("
");
+
+?>
\ No newline at end of file
diff --git a/html/pages/device/vrfs.inc.php b/html/pages/device/vrfs.inc.php
index e0474093e..ae7ffa0f3 100644
--- a/html/pages/device/vrfs.inc.php
+++ b/html/pages/device/vrfs.inc.php
@@ -11,14 +11,15 @@ echo("
");
print_optionbar_end();
+echo("
");
+$i = "0";
+$vrf_query = mysql_query("select * from vrfs WHERE device_id = '".$_GET['id']."' ORDER BY 'vrf_name'");
+while ($vrf = mysql_fetch_array($vrf_query))
+{
+ include("includes/print-vrf.inc");
+ $i++;
+}
- echo("");
- $i = "0";
- $vrf_query = mysql_query("select * from vrfs WHERE device_id = '".$_GET['id']."' ORDER BY 'vrf_name'");
- while($vrf = mysql_fetch_array($vrf_query)) {
- include("includes/print-vrf.inc");
- $i++;
- }
- echo("
");
+echo("
");
-?>
+?>
\ No newline at end of file