mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
device subpages cleanup, remove dead code
git-svn-id: http://www.observium.org/svn/observer/trunk@1896 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -5,10 +5,12 @@ $query = mysql_query("SELECT * FROM `applications` WHERE `device_id` = '".$devic
|
||||
print_optionbar_start();
|
||||
|
||||
unset($sep);
|
||||
while($app = mysql_fetch_array($query)) {
|
||||
|
||||
while ($app = mysql_fetch_array($query))
|
||||
{
|
||||
echo($sep);
|
||||
|
||||
if(!$_GET['opta']) { $_GET['opta'] = $app['app_type']; }
|
||||
if (!$_GET['opta']) { $_GET['opta'] = $app['app_type']; }
|
||||
|
||||
if ($_GET['opta'] == $app['app_type'])
|
||||
{
|
||||
@@ -31,4 +33,4 @@ if (is_file("pages/device/apps/".mres($_GET['opta']).".inc.php"))
|
||||
include("pages/device/apps/".mres($_GET['opta']).".inc.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
global $config;
|
||||
global $config;
|
||||
|
||||
$graphs = array('apache_bytes' => 'Traffic - Bytes/sec',
|
||||
'apache_hits' => 'Traffic - Hits',
|
||||
'apache_cpu' => 'CPU Utilisation',
|
||||
'apache_scoreboard' => 'Scoreboard Statistics');
|
||||
|
||||
foreach($graphs as $key => $text) {
|
||||
|
||||
foreach ($graphs as $key => $text)
|
||||
{
|
||||
$graph_type = "apache_scoreboard";
|
||||
|
||||
$graph_array['height'] = "100";
|
||||
@@ -21,14 +21,9 @@ foreach($graphs as $key => $text) {
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
|
||||
echo("</td></tr>");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -23,24 +23,20 @@ $graphs = array('mysql_command_counters' => 'Command Counters',
|
||||
'mysql_table_locks' => 'Table Locks',
|
||||
'mysql_temporary_objects' => 'Temporary Objects');
|
||||
|
||||
foreach($graphs as $key => $text) {
|
||||
$graph_type = $key;
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "215";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $app['app_id'];
|
||||
$graph_array['type'] = "application_".$key;
|
||||
echo('<h3>'.$text.'</h3>');
|
||||
foreach ($graphs as $key => $text)
|
||||
{
|
||||
$graph_type = $key;
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "215";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $app['app_id'];
|
||||
$graph_array['type'] = "application_".$key;
|
||||
echo('<h3>'.$text.'</h3>');
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
echo("</td></tr>");
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,27 +1,24 @@
|
||||
<?php
|
||||
|
||||
global $config;
|
||||
|
||||
$graphs = array('nginx_connections' => 'nginx Connections',
|
||||
'nginx_req' => 'nginx requests');
|
||||
|
||||
foreach($graphs as $key => $text) {
|
||||
$graph_type = $key;
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "215";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $app['app_id'];
|
||||
$graph_array['type'] = "application_".$key;
|
||||
echo('<h3>'.$text.'</h3>');
|
||||
foreach ($graphs as $key => $text)
|
||||
{
|
||||
$graph_type = $key;
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "215";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $app['app_id'];
|
||||
$graph_array['type'] = "application_".$key;
|
||||
echo('<h3>'.$text.'</h3>');
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
echo("</td></tr>");
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,20 +1,23 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
$sql = "SELECT * FROM ipv4_mac AS M, ports AS I WHERE I.interface_id = M.interface_id AND I.device_id = '".$device['device_id']."'";
|
||||
$query = mysql_query($sql);
|
||||
|
||||
echo("<table border=0 cellspacing=0 cellpadding=5 width=100%>");
|
||||
echo('<table border="0" cellspacing="0" cellpadding="5" width="100%">');
|
||||
|
||||
$i = "1";
|
||||
|
||||
while($arp = mysql_fetch_array($query)) {
|
||||
if(!is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; }
|
||||
while ($arp = mysql_fetch_array($query))
|
||||
{
|
||||
if (!is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; }
|
||||
|
||||
$arp_host = mysql_fetch_array(mysql_query("SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE A.ipv4_address = '".$arp['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); } else { unset($arp_name); }
|
||||
if($arp_host) { $arp_if = generate_port_link($arp_host); } else { unset($arp_if); }
|
||||
if ($arp_host) { $arp_name = generate_device_link($arp_host); } else { unset($arp_name); }
|
||||
if ($arp_host) { $arp_if = generate_port_link($arp_host); } else { unset($arp_if); }
|
||||
|
||||
if($arp_host['device_id'] == $device['device_id']) { $arp_name = "Localhost"; }
|
||||
if($arp_host['interface_id'] == $arp['interface_id']) { $arp_if = "Local Port"; }
|
||||
if ($arp_host['device_id'] == $device['device_id']) { $arp_name = "Localhost"; }
|
||||
if ($arp_host['interface_id'] == $arp['interface_id']) { $arp_if = "Local Port"; }
|
||||
|
||||
echo("
|
||||
<tr bgcolor=$bg_colour>
|
||||
@@ -29,4 +32,4 @@ while($arp = mysql_fetch_array($query)) {
|
||||
|
||||
echo("</table>");
|
||||
|
||||
?>
|
||||
?>
|
@@ -9,7 +9,7 @@ echo("
|
||||
<div style='margin: auto; text-align: left; padding-left: 11px; clear: both; display:block; height:20px;'>
|
||||
<a href='".$config['base_url']."/device/" . $_GET['id'] . "/bgp/'>No Graphs</a> |
|
||||
<a href='".$config['base_url']."/device/" . $_GET['id'] . "/bgp/updates/'>Updates</a>");
|
||||
|
||||
|
||||
echo(" | Prefixes:
|
||||
<a href='".$config['base_url']."/device/" . $_GET['id'] . "/bgp/prefixes/ipv4.unicast/'>IPv4</a> |
|
||||
<a href='".$config['base_url']."/device/" . $_GET['id'] . "/bgp/prefixes/ipv4.vpn/'>VPNv4</a> |
|
||||
@@ -30,6 +30,7 @@ print_optionbar_end();
|
||||
<?php
|
||||
$i = "1";
|
||||
$peer_query = mysql_query("select * from bgpPeers WHERE device_id = '".$device['device_id']."' ORDER BY bgpPeerRemoteAs, bgpPeerIdentifier");
|
||||
|
||||
while ($peer = mysql_fetch_assoc($peer_query))
|
||||
{
|
||||
$has_macaccounting = mysql_result(mysql_query("SELECT COUNT(*) FROM `ipv4_mac` AS I, mac_accounting AS M WHERE I.ipv4_address = '".$peer['bgpPeerIdentifier']."' AND M.mac = I.mac_address"),0);
|
||||
@@ -106,10 +107,10 @@ while ($peer = mysql_fetch_assoc($peer_query))
|
||||
|
||||
if (isset($_GET['opta']) && $_GET['opta'] != "macaccounting")
|
||||
{
|
||||
foreach(explode(" ", $_GET['opta']) as $graph_type)
|
||||
{
|
||||
foreach (explode(" ", $_GET['opta']) as $graph_type)
|
||||
{
|
||||
if ($graph_type == "prefixes") { list($afi, $safi) = explode(".", $_GET['optb']); $afisafi = "&afi=$afi&safi=$safi"; }
|
||||
if ($graph_type == "updates" || $valid_afi_safi[$afi][$safi])
|
||||
if ($graph_type == "updates" || $valid_afi_safi[$afi][$safi])
|
||||
{
|
||||
$daily_traffic = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=bgp_$graph_type&from=$day&to=$now&width=210&height=100$afisafi";
|
||||
$daily_url = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=bgp_$graph_type&from=$day&to=$now&width=500&height=150$afisafi";
|
||||
@@ -129,12 +130,12 @@ while ($peer = mysql_fetch_assoc($peer_query))
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET['opta'] == "macaccounting" && $has_macaccounting)
|
||||
if ($_GET['opta'] == "macaccounting" && $has_macaccounting)
|
||||
{
|
||||
$acc = mysql_fetch_assoc(mysql_query("SELECT * FROM `ipv4_mac` AS I, mac_accounting AS M, ports AS P WHERE I.ipv4_address = '".$peer['bgpPeerIdentifier']."' AND M.mac = I.mac_address AND P.interface_id = M.interface_id"));
|
||||
$graph_type = "mac_acc_bits";
|
||||
$database = $config['rrd_dir'] . "/" . $device['hostname'] . "/cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd";
|
||||
if (is_file($database))
|
||||
if (is_file($database))
|
||||
{
|
||||
$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";
|
||||
@@ -162,4 +163,4 @@ while ($peer = mysql_fetch_assoc($peer_query))
|
||||
}
|
||||
?>
|
||||
|
||||
</table></div>
|
||||
</table></div>
|
@@ -1,38 +1,39 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
unset ($sep);
|
||||
$query = mysql_query("SELECT `entSensorType` FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entSensorType != '' AND entSensorType NOT LIKE 'No%' GROUP BY `entSensorType` ORDER BY `entSensorType`");
|
||||
while($data = mysql_fetch_array($query)) {
|
||||
$type = $data['entSensorType'];
|
||||
if(!$_GET['opta']) { $_GET['opta'] = $type; }
|
||||
echo($sep);
|
||||
if($_GET['opta'] == $type) { echo("<strong>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ciscosensors/" . $type . "/'>" . htmlspecialchars($type) ."</a>\n");
|
||||
if($_GET['opta'] == $type) { echo("</strong>"); }
|
||||
$sep = ' | ';
|
||||
}
|
||||
unset ($sep);
|
||||
unset ($sep);
|
||||
$query = mysql_query("SELECT `entSensorType` FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entSensorType != '' AND entSensorType NOT LIKE 'No%' GROUP BY `entSensorType` ORDER BY `entSensorType`");
|
||||
while ($data = mysql_fetch_array($query))
|
||||
{
|
||||
$type = $data['entSensorType'];
|
||||
if (!$_GET['opta']) { $_GET['opta'] = $type; }
|
||||
echo($sep);
|
||||
if ($_GET['opta'] == $type) { echo("<strong>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ciscosensors/" . $type . "/'>" . htmlspecialchars($type) ."</a>\n");
|
||||
if ($_GET['opta'] == $type) { echo("</strong>"); }
|
||||
$sep = ' | ';
|
||||
}
|
||||
|
||||
unset ($sep);
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
$query = mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$device['device_id']."' and entSensorType = '".$_GET['opta']."' ORDER BY `entPhysicalName`");
|
||||
while($data = mysql_fetch_array($query)) {
|
||||
$query = mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$device['device_id']."' and entSensorType = '".$_GET['opta']."' ORDER BY `entPhysicalName`");
|
||||
while ($data = mysql_fetch_array($query))
|
||||
{
|
||||
if ($data['entSensorMeasuredEntity'])
|
||||
{
|
||||
$measured = mysql_fetch_array(mysql_query("SELECT * FROM entPhysical WHERE device_id = '".$device['device_id']."' AND entPhysicalIndex = '".$data['entSensorMeasuredEntity']."'"));
|
||||
}
|
||||
|
||||
if($data['entSensorMeasuredEntity']) {
|
||||
$measured = mysql_fetch_array(mysql_query("SELECT * FROM entPhysical WHERE device_id = '".$device['device_id']."' AND entPhysicalIndex = '".$data['entSensorMeasuredEntity']."'"));
|
||||
}
|
||||
echo("<div><h3>".$measured['entPhysicalName']." ".$data['entPhysicalName']."</h3>");
|
||||
$graph_type = "cisco_entity_sensor";
|
||||
$args = "&a=".$data['entPhysical_id'];
|
||||
|
||||
echo("<div><h3>".$measured['entPhysicalName']." ".$data['entPhysicalName']."</h3>");
|
||||
$graph_type = "cisco_entity_sensor";
|
||||
$args = "&a=".$data['entPhysical_id'];
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
echo("</div>");
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -50,11 +50,11 @@ print_optionbar_start();
|
||||
|
||||
$plugins = collectd_list_plugins($device['hostname']);
|
||||
foreach ($plugins as &$plugin) {
|
||||
if(!$_GET['opta']) { $_GET['opta'] = $plugin; }
|
||||
if (!$_GET['opta']) { $_GET['opta'] = $plugin; }
|
||||
echo($sep);
|
||||
if($_GET['opta'] == $plugin) { echo("<strong>"); }
|
||||
if ($_GET['opta'] == $plugin) { echo("<strong>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/collectd/" . $plugin . "/'>" . htmlspecialchars($plugin) ."</a>\n");
|
||||
if($_GET['opta'] == $plugin) { echo("</strong>"); }
|
||||
if ($_GET['opta'] == $plugin) { echo("</strong>"); }
|
||||
$sep = ' | ';
|
||||
}
|
||||
unset ($sep);
|
||||
@@ -70,18 +70,18 @@ print_optionbar_end();
|
||||
foreach ($types as &$type) {
|
||||
|
||||
$typeinstances = collectd_list_tinsts($device['hostname'], $_GET['opta'], $instance, $type);
|
||||
|
||||
if($MetaGraphDefs[$type]) { $typeinstances = array($MetaGraphDefs[$type]); }
|
||||
|
||||
|
||||
if ($MetaGraphDefs[$type]) { $typeinstances = array($MetaGraphDefs[$type]); }
|
||||
|
||||
|
||||
|
||||
foreach ($typeinstances as &$tinst) {
|
||||
$i++;
|
||||
if(!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
echo('<div style="background-color: '.$row_colour.';">');
|
||||
echo('<div class="graphhead" style="padding:4px 0px 0px 8px;">');
|
||||
if($tinst) {
|
||||
if ($tinst) {
|
||||
echo($_GET['opta']." $instance - $type - $tinst");
|
||||
} else {
|
||||
echo($_GET['opta']." $instance - $type");
|
||||
@@ -96,7 +96,7 @@ print_optionbar_end();
|
||||
$weekly_traffic = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$week&to=$now&width=215&height=100";
|
||||
$weekly_traffic .= $args;
|
||||
$weekly_url = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$week&to=$now&width=400&height=150";
|
||||
$weekly_url .= $args;
|
||||
$weekly_url .= $args;
|
||||
|
||||
$monthly_traffic = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$month&to=$now&width=215&height=100";
|
||||
$monthly_traffic .= $args;
|
||||
@@ -107,7 +107,7 @@ print_optionbar_end();
|
||||
$yearly_traffic .= $args;
|
||||
$yearly_url = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$year&to=$now&width=400&height=150";
|
||||
$yearly_url .= $args;
|
||||
|
||||
|
||||
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_traffic' border=0></a> ");
|
||||
@@ -117,9 +117,9 @@ print_optionbar_end();
|
||||
<img src='$monthly_traffic' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_traffic' border=0></a>");
|
||||
|
||||
|
||||
echo("</div>");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,42 +1,42 @@
|
||||
<?php
|
||||
|
||||
if($_SESSION['userlevel'] < '7') {
|
||||
if ($_SESSION['userlevel'] < '7')
|
||||
{
|
||||
print_error("Insufficient Privileges");
|
||||
} else {
|
||||
|
||||
$panes = array('device' => 'Device Settings',
|
||||
'ports' => 'Port Settings',
|
||||
'apps' => 'Applications',
|
||||
'services' => 'Services',
|
||||
'ipmi' => 'IPMI');
|
||||
|
||||
$panes = array('device' => 'Device Settings',
|
||||
'ports' => 'Port Settings',
|
||||
'apps' => 'Applications',
|
||||
'services' => 'Services',
|
||||
'ipmi' => 'IPMI');
|
||||
print_optionbar_start();
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
unset($sep);
|
||||
foreach($panes as $type => $text) {
|
||||
|
||||
if(!isset($_GET['opta'])) { $_GET['opta'] = $type; }
|
||||
echo($sep);
|
||||
if ($_GET['opta'] == $type)
|
||||
unset($sep);
|
||||
foreach ($panes as $type => $text)
|
||||
{
|
||||
echo("<strong>");
|
||||
echo('<img src="images/icons/'.$type.'.png" class="optionicon" />');
|
||||
} else {
|
||||
echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
|
||||
if (!isset($_GET['opta'])) { $_GET['opta'] = $type; }
|
||||
echo($sep);
|
||||
if ($_GET['opta'] == $type)
|
||||
{
|
||||
echo("<strong>");
|
||||
echo('<img src="images/icons/'.$type.'.png" class="optionicon" />');
|
||||
} else {
|
||||
echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
|
||||
}
|
||||
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/edit/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $text ."</a>\n");
|
||||
if ($_GET['opta'] == $type) { echo("</strong>"); }
|
||||
$sep = " | ";
|
||||
}
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if (is_file("pages/device/edit/".mres($_GET['opta']).".inc.php"))
|
||||
{
|
||||
include("pages/device/edit/".mres($_GET['opta']).".inc.php");
|
||||
}
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/edit/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $text ."</a>\n");
|
||||
if ($_GET['opta'] == $type) { echo("</strong>"); }
|
||||
$sep = " | ";
|
||||
}
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if (is_file("pages/device/edit/".mres($_GET['opta']).".inc.php"))
|
||||
{
|
||||
include("pages/device/edit/".mres($_GET['opta']).".inc.php");
|
||||
} else {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
if($_POST['editing']) {
|
||||
if($_SESSION['userlevel'] > "7") {
|
||||
if ($_POST['editing'])
|
||||
{
|
||||
if ($_SESSION['userlevel'] > "7")
|
||||
{
|
||||
include("includes/device-edit.inc.php");
|
||||
}
|
||||
}
|
||||
@@ -9,7 +11,8 @@ if($_POST['editing']) {
|
||||
$device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE `device_id` = '".$device['device_id']."'"));
|
||||
$descr = $device['purpose'];
|
||||
|
||||
if($updated && $update_message) {
|
||||
if ($updated && $update_message)
|
||||
{
|
||||
print_message($update_message);
|
||||
} elseif ($update_message) {
|
||||
print_error($update_message);
|
||||
@@ -53,11 +56,14 @@ echo("<table cellpadding=0 cellspacing=0><tr><td>
|
||||
<td width='300'><div align='right'>SNMP Transport</div></td>
|
||||
<td colspan='3'>
|
||||
<select name='transport'>");
|
||||
foreach ($config['snmp']['transports'] as $transport) {
|
||||
|
||||
foreach ($config['snmp']['transports'] as $transport)
|
||||
{
|
||||
echo ("<option value='".$transport."'");
|
||||
if ($transport == $device['transport']) { echo (" selected='selected'"); }
|
||||
echo (">".$transport."</option>");
|
||||
}
|
||||
|
||||
echo(" </select>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -102,11 +108,11 @@ echo("
|
||||
<tr>
|
||||
<td><div align='right'>Disable</div></td>
|
||||
<td><input name='disabled' type='checkbox' id='disabled' value='1'");
|
||||
if($device['disabled']) { echo("checked=checked"); }
|
||||
if ($device['disabled']) { echo("checked=checked"); }
|
||||
echo("/></td>
|
||||
<td><div align='right'>Ignore</div></td>
|
||||
<td><input name='ignore' type='checkbox' id='disable' value='1'");
|
||||
if($device['ignore']) { echo("checked=checked"); }
|
||||
if ($device['ignore']) { echo("checked=checked"); }
|
||||
echo("/></td>
|
||||
</tr>");
|
||||
|
||||
@@ -120,5 +126,4 @@ echo('
|
||||
</td>
|
||||
<td width="50"></td><td></td></tr></table>');
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
if($_POST['editing']) {
|
||||
if($_SESSION['userlevel'] > "7") {
|
||||
if ($_POST['editing'])
|
||||
{
|
||||
if ($_SESSION['userlevel'] > "7")
|
||||
{
|
||||
include("includes/device-ipmi-edit.inc.php");
|
||||
}
|
||||
}
|
||||
@@ -9,7 +11,8 @@ if($_POST['editing']) {
|
||||
$device = mysql_fetch_assoc(mysql_query("SELECT * FROM `devices` WHERE `device_id` = '".$device['device_id']."'"));
|
||||
$descr = $device['purpose'];
|
||||
|
||||
if($updated && $update_message) {
|
||||
if ($updated && $update_message)
|
||||
{
|
||||
print_message($update_message);
|
||||
} elseif ($update_message) {
|
||||
print_error($update_message);
|
||||
|
@@ -2,14 +2,16 @@
|
||||
|
||||
echo('<div style="padding: 10px;">');
|
||||
|
||||
if($_POST['ignoreport']) {
|
||||
if($_SESSION['userlevel'] == '10') {
|
||||
if ($_POST['ignoreport'])
|
||||
{
|
||||
if ($_SESSION['userlevel'] == '10')
|
||||
{
|
||||
include("includes/port-edit.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($updated && $update_message) {
|
||||
if ($updated && $update_message)
|
||||
{
|
||||
print_message($update_message);
|
||||
} elseif ($update_message) {
|
||||
print_error($update_message);
|
||||
@@ -23,13 +25,14 @@ echo("<div style='float: left;'>
|
||||
<tr><th>Port</th><th>ifDescr</th><th>ifAdminStatus</th><th>ifOperStatus</th><th>Ignore</th></tr>");
|
||||
|
||||
$query = mysql_query("SELECT * FROM `ports` WHERE device_id='".$device['device_id']."' ORDER BY `ifIndex` ");
|
||||
while($device = mysql_fetch_array($query)) {
|
||||
while ($device = mysql_fetch_array($query))
|
||||
{
|
||||
echo("<tr>");
|
||||
echo("<td align=right>". $device['ifIndex']."</td>");
|
||||
echo("<td align=left>".$device['ifDescr'] . "</td>");
|
||||
echo("<td align=right>". $device['ifAdminStatus']."</td>");
|
||||
|
||||
# Mark interfaces which are OperDown (but not AdminDown) yet not ignored, or up - yet ignored - as to draw the attention
|
||||
# Mark interfaces which are OperDown (but not AdminDown) yet not ignored, or up - yet ignored - as to draw the attention
|
||||
# to a possible problem.
|
||||
#
|
||||
$outofsync = ($device['ignore'] == ($device['ifOperStatus'] == 'down' && $device['ifAdminStatus'] != 'down' ? 1 : 0)) ? "" : "class=red";
|
||||
@@ -48,4 +51,4 @@ echo('</table>');
|
||||
echo('</form>');
|
||||
echo('</div>');
|
||||
|
||||
?>
|
||||
?>
|
@@ -2,49 +2,53 @@
|
||||
|
||||
echo('<div style="padding: 10px;">');
|
||||
|
||||
if($_POST['addsrv']) {
|
||||
if($_SESSION['userlevel'] == '10') {
|
||||
if ($_POST['addsrv']) {
|
||||
if ($_SESSION['userlevel'] == '10') {
|
||||
include("includes/service-add.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
if($_POST['delsrv']) {
|
||||
if($_SESSION['userlevel'] == '10') {
|
||||
if ($_POST['delsrv']) {
|
||||
if ($_SESSION['userlevel'] == '10') {
|
||||
include("includes/service-delete.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($handle = opendir($config['install_dir'] . "/includes/services/")) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != ".." && !strstr($file, ".")) {
|
||||
$servicesform .= "<option value='$file'>$file</option>";
|
||||
}
|
||||
if ($handle = opendir($config['install_dir'] . "/includes/services/"))
|
||||
{
|
||||
while (false !== ($file = readdir($handle)))
|
||||
{
|
||||
if ($file != "." && $file != ".." && !strstr($file, "."))
|
||||
{
|
||||
$servicesform .= "<option value='$file'>$file</option>";
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
$query = mysql_query("SELECT * FROM `devices` ORDER BY `hostname`");
|
||||
while($device = mysql_fetch_array($query)) {
|
||||
while ($device = mysql_fetch_array($query))
|
||||
{
|
||||
$devicesform .= "<option value='" . $device['device_id'] . "'>" . $device['hostname'] . "</option>";
|
||||
}
|
||||
|
||||
if($updated) { print_message("Device Settings Saved"); }
|
||||
|
||||
|
||||
if(mysql_result(mysql_query("SELECT COUNT(*) from `services` WHERE `device_id` = '".$device['device_id']."'"), 0) > '0') {
|
||||
$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)) {
|
||||
$existform .= "<option value='" . $service['service_id'] . "'>" . $service['service_type'] . "</option>";
|
||||
|
||||
}
|
||||
if ($updated) { print_message("Device Settings Saved"); }
|
||||
|
||||
if (mysql_result(mysql_query("SELECT COUNT(*) from `services` WHERE `device_id` = '".$device['device_id']."'"), 0) > '0')
|
||||
{
|
||||
$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))
|
||||
{
|
||||
$existform .= "<option value='" . $service['service_id'] . "'>" . $service['service_type'] . "</option>";
|
||||
}
|
||||
}
|
||||
|
||||
if($existform){
|
||||
echo('<div style="float: left;">');
|
||||
echo("
|
||||
if($existform
|
||||
{
|
||||
echo('<div style="float: left;">');
|
||||
echo("
|
||||
|
||||
<h1>Remove Service</h1>
|
||||
|
||||
@@ -64,12 +68,10 @@ echo("
|
||||
</tr>
|
||||
</table>
|
||||
<input type='submit' name='Submit' value='Delete' />
|
||||
<label><br />
|
||||
</label>
|
||||
</form>");
|
||||
|
||||
|
||||
echo('</div>');
|
||||
echo('</div>');
|
||||
}
|
||||
|
||||
echo('<div style="width: 45%; float: right;">');
|
||||
@@ -95,10 +97,7 @@ echo("
|
||||
<input type='submit' name='Submit' value='Add' />
|
||||
<label><br />
|
||||
</label>
|
||||
</form>");
|
||||
</form>
|
||||
</div>");
|
||||
|
||||
echo('</div>');
|
||||
|
||||
echo('</div>');
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,77 +1,84 @@
|
||||
<?php
|
||||
|
||||
function printEntPhysical($ent, $level, $class) {
|
||||
function printEntPhysical($ent, $level, $class)
|
||||
{
|
||||
global $device;
|
||||
|
||||
global $device;
|
||||
$query = mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$_GET['id']."' AND entPhysicalContainedIn = '".$ent."' ORDER BY entPhysicalContainedIn,entPhysicalIndex");
|
||||
while ($ent = mysql_fetch_array($query))
|
||||
{
|
||||
echo("
|
||||
<li class='$class'>");
|
||||
|
||||
$query = mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$_GET['id']."' AND entPhysicalContainedIn = '".$ent."' ORDER BY entPhysicalContainedIn,entPhysicalIndex");
|
||||
while($ent = mysql_fetch_array($query)) {
|
||||
echo("
|
||||
<li class='$class'>");
|
||||
if ($ent['entPhysicalClass'] == "chassis") { echo("<img src='images/16/server.png' style='vertical-align:middle'/> "); }
|
||||
if ($ent['entPhysicalClass'] == "module") { echo("<img src='images/16/drive.png' style='vertical-align:middle'/> "); }
|
||||
if ($ent['entPhysicalClass'] == "port") { echo("<img src='images/16/connect.png' style='vertical-align:middle'/> "); }
|
||||
if ($ent['entPhysicalClass'] == "container") { echo("<img src='images/16/box.png' style='vertical-align:middle'/> "); }
|
||||
if ($ent['entPhysicalClass'] == "sensor")
|
||||
{
|
||||
echo("<img src='images/16/contrast.png' style='vertical-align:middle'/> ");
|
||||
$link = " href='".$config['base_url'] . "/device/".$device['device_id']."/ciscosensors/".$ent['entSensorType']."/' onmouseover=\"return overlib('<img src=\'graph.php?host=49&type=cisco_entity_sensor&from=-2d&to=now&width=400&height=150&a=".$ent['entPhysical_id']."\'><img src=\'graph.php?host=49&type=cisco_entity_sensor&from=-2w&to=now&width=400&height=150&a=".$ent['entPhysical_id']."\'>', LEFT,FGCOLOR,'#e5e5e5', BGCOLOR, '#c0c0c0', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#050505');\" onmouseout=\"return nd();\"";
|
||||
} else { unset ($link); }
|
||||
|
||||
if($ent['entPhysicalClass'] == "chassis") { echo("<img src='images/16/server.png' style='vertical-align:middle'/> "); }
|
||||
if($ent['entPhysicalClass'] == "module") { echo("<img src='images/16/drive.png' style='vertical-align:middle'/> "); }
|
||||
if($ent['entPhysicalClass'] == "port") { echo("<img src='images/16/connect.png' style='vertical-align:middle'/> "); }
|
||||
if($ent['entPhysicalClass'] == "container") { echo("<img src='images/16/box.png' style='vertical-align:middle'/> "); }
|
||||
if($ent['entPhysicalClass'] == "sensor") {
|
||||
echo("<img src='images/16/contrast.png' style='vertical-align:middle'/> ");
|
||||
$link = " href='".$config['base_url'] . "/device/".$device['device_id']."/ciscosensors/".$ent['entSensorType']."/' onmouseover=\"return overlib('<img src=\'graph.php?host=49&type=cisco_entity_sensor&from=-2d&to=now&width=400&height=150&a=".$ent['entPhysical_id']."\'><img src=\'graph.php?host=49&type=cisco_entity_sensor&from=-2w&to=now&width=400&height=150&a=".$ent['entPhysical_id']."\'>', LEFT,FGCOLOR,'#e5e5e5', BGCOLOR, '#c0c0c0', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#050505');\" onmouseout=\"return nd();\"";
|
||||
} else { unset ($link); }
|
||||
if($ent['entPhysicalClass'] == "backplane") { echo("<img src='images/16/brick.png' style='vertical-align:middle'/> "); }
|
||||
if($ent['entPhysicalParentRelPos'] > '-1') {echo("<strong>".$ent['entPhysicalParentRelPos'].".</strong> ");}
|
||||
if ($ent['entPhysicalClass'] == "backplane") { echo("<img src='images/16/brick.png' style='vertical-align:middle'/> "); }
|
||||
if ($ent['entPhysicalParentRelPos'] > '-1') {echo("<strong>".$ent['entPhysicalParentRelPos'].".</strong> "); }
|
||||
|
||||
if($link) {echo("<a $link>");}
|
||||
if ($link) {echo("<a $link>"); }
|
||||
|
||||
if($ent['ifIndex']) {
|
||||
$interface = mysql_fetch_array(mysql_query("SELECT * FROM `ports` WHERE ifIndex = '".$ent['ifIndex']."' AND device_id = '".$device['device_id']."'"));
|
||||
$ent['entPhysicalName'] = generate_port_link($interface);
|
||||
}
|
||||
|
||||
if ($ent['entPhysicalModelName'] && $ent['entPhysicalName']) {
|
||||
echo("<strong>".$ent['entPhysicalModelName'] . "</strong> (".$ent['entPhysicalName'].")");
|
||||
} elseif($ent['entPhysicalModelName']) {
|
||||
echo("<strong>".$ent['entPhysicalModelName'] . "</strong>");
|
||||
} elseif($ent['entPhysicalName']) {
|
||||
echo("<strong>".$ent['entPhysicalName']."</strong>");
|
||||
} elseif($ent['entPhysicalDescr']) {
|
||||
echo("<strong>".$ent['entPhysicalDescr']."</strong>");
|
||||
}
|
||||
|
||||
if($ent['entPhysicalClass'] == "sensor") {
|
||||
echo(" (".$ent['entSensorValue'] ." ". $ent['entSensorType'].")");
|
||||
}
|
||||
|
||||
echo("<br /><div class='interface-desc' style='margin-left: 20px;'>" . $ent['entPhysicalDescr']);
|
||||
|
||||
if($link) {echo("</a>");}
|
||||
|
||||
if($ent['entPhysicalSerialNum']) {
|
||||
echo(" <br /><span style='color: #000099;'>Serial No. ".$ent['entPhysicalSerialNum']."</span> ");
|
||||
}
|
||||
|
||||
echo("</div>");
|
||||
|
||||
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `entPhysical` WHERE device_id = '".$_GET['id']."' AND entPhysicalContainedIn = '".$ent['entPhysicalIndex']."'"),0);
|
||||
if($count) {
|
||||
echo("<ul>");
|
||||
printEntPhysical($ent['entPhysicalIndex'], $level+1, '');
|
||||
echo("</ul>");
|
||||
}
|
||||
echo("</li>");
|
||||
if ($ent['ifIndex'])
|
||||
{
|
||||
$interface = mysql_fetch_array(mysql_query("SELECT * FROM `ports` WHERE ifIndex = '".$ent['ifIndex']."' AND device_id = '".$device['device_id']."'"));
|
||||
$ent['entPhysicalName'] = generate_port_link($interface);
|
||||
}
|
||||
|
||||
if ($ent['entPhysicalModelName'] && $ent['entPhysicalName'])
|
||||
{
|
||||
echo("<strong>".$ent['entPhysicalModelName'] . "</strong> (".$ent['entPhysicalName'].")");
|
||||
} elseif ($ent['entPhysicalModelName']) {
|
||||
echo("<strong>".$ent['entPhysicalModelName'] . "</strong>");
|
||||
} elseif ($ent['entPhysicalName']) {
|
||||
echo("<strong>".$ent['entPhysicalName']."</strong>");
|
||||
} elseif ($ent['entPhysicalDescr']) {
|
||||
echo("<strong>".$ent['entPhysicalDescr']."</strong>");
|
||||
}
|
||||
|
||||
if ($ent['entPhysicalClass'] == "sensor")
|
||||
{
|
||||
echo(" (".$ent['entSensorValue'] ." ". $ent['entSensorType'].")");
|
||||
}
|
||||
|
||||
echo("<br /><div class='interface-desc' style='margin-left: 20px;'>" . $ent['entPhysicalDescr']);
|
||||
|
||||
if ($link) { echo("</a>"); }
|
||||
|
||||
if ($ent['entPhysicalSerialNum'])
|
||||
{
|
||||
echo(" <br /><span style='color: #000099;'>Serial No. ".$ent['entPhysicalSerialNum']."</span> ");
|
||||
}
|
||||
|
||||
echo("</div>");
|
||||
|
||||
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `entPhysical` WHERE device_id = '".$_GET['id']."' AND entPhysicalContainedIn = '".$ent['entPhysicalIndex']."'"),0);
|
||||
if ($count)
|
||||
{
|
||||
echo("<ul>");
|
||||
printEntPhysical($ent['entPhysicalIndex'], $level+1, '');
|
||||
echo("</ul>");
|
||||
}
|
||||
|
||||
echo("</li>");
|
||||
}
|
||||
}
|
||||
|
||||
echo("<div style='float: right;'>
|
||||
<a href='#' class='button' onClick=\"expandTree('enttree');return false;\"><img src='images/16/bullet_toggle_plus.png'>Expand All Nodes</a>
|
||||
<a href='#' class='button' onClick=\"collapseTree('enttree');return false;\"><img src='images/16/bullet_toggle_minus.png'>Collapse All Nodes</a>
|
||||
</div>");
|
||||
echo("<div style='float: right;'>
|
||||
<a href='#' class='button' onClick=\"expandTree('enttree');return false;\"><img src='images/16/bullet_toggle_plus.png'>Expand All Nodes</a>
|
||||
<a href='#' class='button' onClick=\"collapseTree('enttree');return false;\"><img src='images/16/bullet_toggle_minus.png'>Collapse All Nodes</a>
|
||||
</div>");
|
||||
|
||||
echo("<div style='clear: both;'><UL CLASS='mktree' id='enttree'>");
|
||||
$level = "0";
|
||||
$ent['entPhysicalIndex'] = "0";
|
||||
printEntPhysical($ent['entPhysicalIndex'], $level, "liOpen");
|
||||
echo("</ul></div>");
|
||||
|
||||
|
||||
?>
|
||||
echo("<div style='clear: both;'><UL CLASS='mktree' id='enttree'>");
|
||||
$level = "0";
|
||||
$ent['entPhysicalIndex'] = "0";
|
||||
printEntPhysical($ent['entPhysicalIndex'], $level, "liOpen");
|
||||
echo("</ul></div>");
|
||||
|
||||
?>
|
@@ -4,9 +4,11 @@ $query = "SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `even
|
||||
$data = mysql_query($query);
|
||||
echo('<table cellspacing="0" cellpadding="2" width="100%">');
|
||||
|
||||
while($entry = mysql_fetch_array($data)) {
|
||||
while ($entry = mysql_fetch_array($data))
|
||||
{
|
||||
include("includes/print-event.inc");
|
||||
}
|
||||
|
||||
echo('</table>');
|
||||
|
||||
?>
|
||||
?>
|
@@ -11,18 +11,19 @@ print_optionbar_start('', '');
|
||||
|
||||
$sep = "";
|
||||
$query = mysql_query("SELECT * FROM device_graphs WHERE device_id = '".$device['device_id']."'");
|
||||
while($graph = mysql_fetch_assoc($query))
|
||||
|
||||
while ($graph = mysql_fetch_assoc($query))
|
||||
{
|
||||
$section = $config['graph_types']['device'][$graph['graph']]['section'];
|
||||
$graph_enable[$section][$graph['graph']] = $graph['graph'];
|
||||
}
|
||||
|
||||
foreach($config['graph_sections'] as $section)
|
||||
foreach ($config['graph_sections'] as $section)
|
||||
{
|
||||
if(isset($graph_enable) && is_array($graph_enable[$section]))
|
||||
if (isset($graph_enable) && is_array($graph_enable[$section]))
|
||||
{
|
||||
$type = strtolower($section);
|
||||
if(!$_GET['opta']) { $_GET['opta'] = $type; }
|
||||
if (!$_GET['opta']) { $_GET['opta'] = $type; }
|
||||
echo($sep);
|
||||
if ($_GET['opta'] == $type)
|
||||
{
|
||||
@@ -33,24 +34,21 @@ foreach($config['graph_sections'] as $section)
|
||||
{
|
||||
echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
|
||||
}
|
||||
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/graphs/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $type ."</a>\n");
|
||||
if ($_GET['opta'] == $type) { echo("</strong>"); }
|
||||
$sep = " | ";
|
||||
}
|
||||
}
|
||||
|
||||
unset ($sep);
|
||||
print_optionbar_end();
|
||||
|
||||
#echo("<pre>");
|
||||
#print_r($_GET['opta']);
|
||||
#print_r($graph_enable);
|
||||
#echo("</pre>");
|
||||
|
||||
$graph_enable = $graph_enable[$_GET['opta']];
|
||||
|
||||
foreach($config['graph_types']['device'] as $graph => $entry)
|
||||
foreach ($config['graph_types']['device'] as $graph => $entry)
|
||||
{
|
||||
if($graph_enable[$graph])
|
||||
if ($graph_enable[$graph])
|
||||
{
|
||||
$graph_title = $config['graph_types']['device'][$graph]['descr'];
|
||||
$graph_type = "device_" . $graph;
|
||||
@@ -58,5 +56,4 @@ foreach($config['graph_types']['device'] as $graph => $entry)
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
?>
|
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ucd_cpu.rrd")) {
|
||||
$graph_title = "Processor Utilisation";
|
||||
$graph_type = "device_cpu";
|
||||
include ("includes/print-device-graph.php");
|
||||
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ucd_cpu.rrd"))
|
||||
{
|
||||
$graph_title = "Processor Utilisation";
|
||||
$graph_type = "device_cpu";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
if($device['os'] == "fortigate" || $device['os_group'] == "fortigate") {
|
||||
$graph_title = "Firewall Sessions";
|
||||
$graph_type = "fortigate_sessions";
|
||||
include ("includes/print-device-graph.php");
|
||||
if ($device['os'] == "fortigate" || $device['os_group'] == "fortigate")
|
||||
{
|
||||
$graph_title = "Firewall Sessions";
|
||||
$graph_type = "fortigate_sessions";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/hrSystem.rrd")) {
|
||||
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/hrSystem.rrd"))
|
||||
{
|
||||
$graph_title = "Running Processes";
|
||||
$graph_type = "device_hrprocesses";
|
||||
$graph_type = "device_hrprocesses";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
?>
|
||||
|
||||
?>
|
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/hrSystem.rrd")) {
|
||||
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/hrSystem.rrd"))
|
||||
{
|
||||
$graph_title = "Users Logged On";
|
||||
$graph_type = "device_hrusers";
|
||||
include ("includes/print-device-graph.php");
|
||||
|
||||
$graph_type = "device_hrusers";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ucd_mem.rrd")) {
|
||||
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ucd_mem.rrd"))
|
||||
{
|
||||
$graph_title = "Memory Utilisation";
|
||||
$graph_type = "device_memory";
|
||||
include ("includes/print-device-graph.php");
|
||||
$graph_type = "device_memory";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
?>
|
||||
|
||||
?>
|
@@ -1,63 +1,68 @@
|
||||
<?php
|
||||
|
||||
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");
|
||||
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");
|
||||
|
||||
$graph_title = "IPv6 IP Fragmentation Statistics";
|
||||
$graph_type = "device_ipSystemStats_v6_frag";
|
||||
include ("includes/print-device-graph.php");
|
||||
$graph_title = "IPv6 IP Fragmentation Statistics";
|
||||
$graph_type = "device_ipSystemStats_v6_frag";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
}
|
||||
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");
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-ip.rrd"))
|
||||
{
|
||||
$graph_title = "IP Statistics";
|
||||
$graph_type = "device_ip";
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "IP Fragmented Statistics";
|
||||
$graph_type = "device_ip_fragmented";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-ip.rrd")) {
|
||||
$graph_title = "IP Statistics";
|
||||
$graph_type = "device_ip";
|
||||
include ("includes/print-device-graph.php");
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-tcp.rrd"))
|
||||
{
|
||||
$graph_title = "TCP Statistics";
|
||||
$graph_type = "device_tcp";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
$graph_title = "IP Fragmented Statistics";
|
||||
$graph_type = "device_ip_fragmented";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-udp.rrd"))
|
||||
{
|
||||
$graph_title = "UDP Statistics";
|
||||
$graph_type = "device_udp";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-tcp.rrd")) {
|
||||
$graph_title = "TCP Statistics";
|
||||
$graph_type = "device_tcp";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-snmp.rrd"))
|
||||
{
|
||||
$graph_title = "SNMP Packets Statistics";
|
||||
$graph_type = "device_snmp_packets";
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-udp.rrd")) {
|
||||
$graph_title = "UDP Statistics";
|
||||
$graph_type = "device_udp";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
$graph_title = "SNMP Message Type Statistics";
|
||||
$graph_type = "device_snmp_statistics";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-snmp.rrd")) {
|
||||
$graph_title = "SNMP Packets Statistics";
|
||||
$graph_type = "device_snmp_packets";
|
||||
include ("includes/print-device-graph.php");
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-icmp.rrd"))
|
||||
{
|
||||
$graph_title = "ICMP Statistics";
|
||||
$graph_type = "device_icmp";
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "SNMP Message Type Statistics";
|
||||
$graph_type = "device_snmp_statistics";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
$graph_title = "ICMP Informational Statistics";
|
||||
$graph_type = "device_icmp_informational";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-icmp.rrd")) {
|
||||
$graph_title = "ICMP Statistics";
|
||||
$graph_type = "device_icmp";
|
||||
include ("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "ICMP Informational Statistics";
|
||||
$graph_type = "device_icmp_informational";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-icmp.rrd")) {
|
||||
$graph_title = "ICMP Informational Statistics";
|
||||
$graph_type = "device_icmp_informational";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-icmp.rrd"))
|
||||
{
|
||||
$graph_title = "ICMP Informational Statistics";
|
||||
$graph_type = "device_icmp_informational";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-icmp.rrd")) {
|
||||
$graph_title = "ICMP Statistics";
|
||||
$graph_type = "device_icmp";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-icmp.rrd"))
|
||||
{
|
||||
$graph_title = "ICMP Statistics";
|
||||
$graph_type = "device_icmp";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -1,13 +1,14 @@
|
||||
<?php
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-ip.rrd")) {
|
||||
$graph_title = "IP Statistics";
|
||||
$graph_type = "device_ip";
|
||||
include ("includes/print-device-graph.php");
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-ip.rrd"))
|
||||
{
|
||||
$graph_title = "IP Statistics";
|
||||
$graph_type = "device_ip";
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "IP Fragmented Statistics";
|
||||
$graph_type = "device_ip_fragmented";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
$graph_title = "IP Fragmented Statistics";
|
||||
$graph_type = "device_ip_fragmented";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,13 +1,14 @@
|
||||
<?php
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-snmp.rrd")) {
|
||||
$graph_title = "SNMP Packets Statistics";
|
||||
$graph_type = "device_snmp_packets";
|
||||
include ("includes/print-device-graph.php");
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-snmp.rrd"))
|
||||
{
|
||||
$graph_title = "SNMP Packets Statistics";
|
||||
$graph_type = "device_snmp_packets";
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "SNMP Message Type Statistics";
|
||||
$graph_type = "device_snmp_statistics";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
$graph_title = "SNMP Message Type Statistics";
|
||||
$graph_type = "device_snmp_statistics";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-tcp.rrd")) {
|
||||
$graph_title = "TCP Statistics";
|
||||
$graph_type = "device_tcp";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-tcp.rrd"))
|
||||
{
|
||||
$graph_title = "TCP Statistics";
|
||||
$graph_type = "device_tcp";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-udp.rrd")) {
|
||||
$graph_title = "UDP Statistics";
|
||||
$graph_type = "device_udp";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-udp.rrd"))
|
||||
{
|
||||
$graph_title = "UDP Statistics";
|
||||
$graph_type = "device_udp";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
if($device['os'] == "netscreen" || $device['os_group'] == "netscreen") {
|
||||
|
||||
$graph_title = "Firewall Sessions";
|
||||
$graph_type = "netscreen_sessions"; include ("includes/print-device-graph.php");
|
||||
|
||||
if ($device['os'] == "netscreen" || $device['os_group'] == "netscreen")
|
||||
{
|
||||
$graph_title = "Firewall Sessions";
|
||||
$graph_type = "netscreen_sessions";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
if($device['os'] == "screenos" && is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/screenos-sessions.rrd")) {
|
||||
$graph_title = "Firewall Sessions";
|
||||
$graph_type = "screenos_sessions";
|
||||
include ("includes/print-device-graph.php");
|
||||
if ($device['os'] == "screenos" && is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/screenos-sessions.rrd"))
|
||||
{
|
||||
$graph_title = "Firewall Sessions";
|
||||
$graph_type = "screenos_sessions";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/wificlients-radio1.rrd")) {
|
||||
$graph_title = "Wireless clients";
|
||||
$graph_type = "device_wificlients";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/wificlients-radio1.rrd"))
|
||||
{
|
||||
$graph_title = "Wireless clients";
|
||||
$graph_type = "device_wificlients";
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -24,7 +24,6 @@ if ($volts) { $datas[] = 'voltages'; }
|
||||
if ($freqs) { $datas[] = 'frequencies'; }
|
||||
if ($current) { $datas[] = 'current'; }
|
||||
|
||||
|
||||
$type_text['overview'] = "Overview";
|
||||
$type_text['temperatures'] = "Temperatures";
|
||||
$type_text['humidity'] = "Humidity";
|
||||
@@ -39,14 +38,14 @@ $type_text['current'] = "Current";
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
if(!$_GET['opta']) { $_GET['opta'] = "overview"; }
|
||||
if (!$_GET['opta']) { $_GET['opta'] = "overview"; }
|
||||
|
||||
unset($sep);
|
||||
foreach ($datas as $type) {
|
||||
|
||||
foreach ($datas as $type)
|
||||
{
|
||||
echo($sep);
|
||||
|
||||
if ($_GET['opta'] == $type)
|
||||
if ($_GET['opta'] == $type)
|
||||
{
|
||||
echo("<strong>");
|
||||
echo('<img src="images/icons/'.$type.'.png" class="optionicon" />');
|
||||
@@ -60,18 +59,19 @@ foreach ($datas as $type) {
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if (is_file("pages/device/health/".mres($_GET['opta']).".inc.php"))
|
||||
{
|
||||
include("pages/device/health/".mres($_GET['opta']).".inc.php");
|
||||
} else {
|
||||
foreach ($datas as $type) {
|
||||
if($type != "overview") {
|
||||
if (is_file("pages/device/health/".mres($_GET['opta']).".inc.php"))
|
||||
{
|
||||
include("pages/device/health/".mres($_GET['opta']).".inc.php");
|
||||
} else {
|
||||
foreach ($datas as $type)
|
||||
{
|
||||
if ($type != "overview")
|
||||
{
|
||||
$graph_title = $type_text[$type];
|
||||
$graph_type = "device_".$type;
|
||||
include ("includes/print-device-graph.php");
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@@ -3,7 +3,7 @@
|
||||
$sql = "SELECT * FROM `ucd_diskio` WHERE device_id = '" . mres($_GET['id']) . "' ORDER BY diskio_descr";
|
||||
$query = mysql_query($sql);
|
||||
|
||||
echo("<table cellspacing=0 cellpadding=5 width=100%>");
|
||||
echo('<table cellspacing="0" cellpadding="5" width="100%">');
|
||||
|
||||
#echo("<tr class=tablehead>
|
||||
# <th width=250>Drive</th>
|
||||
@@ -14,28 +14,28 @@ echo("<table cellspacing=0 cellpadding=5 width=100%>");
|
||||
|
||||
$row = 1;
|
||||
|
||||
while($drive = mysql_fetch_array($query)) {
|
||||
while ($drive = mysql_fetch_array($query))
|
||||
{
|
||||
if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
$fs_url = "device/".$device['device_id']."/health/diskio/";
|
||||
|
||||
$fs_url = "device/".$device['device_id']."/health/diskio/";
|
||||
$fs_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['diskio_descr'];
|
||||
$fs_popup .= "</div><img src=\'graph.php?id=" . $drive['diskio_id'] . "&type=diskio_ops&from=$month&to=$now&width=400&height=125\'>";
|
||||
$fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"";
|
||||
|
||||
$fs_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['diskio_descr'];
|
||||
$fs_popup .= "</div><img src=\'graph.php?id=" . $drive['diskio_id'] . "&type=diskio_ops&from=$month&to=$now&width=400&height=125\'>";
|
||||
$fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"";
|
||||
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("<tr bgcolor='$row_colour'><th><a href='$fs_url' $fs_popup>" . $drive['diskio_descr'] . "</a></td></tr>");
|
||||
echo("<tr bgcolor='$row_colour'><th><a href='$fs_url' $fs_popup>" . $drive['diskio_descr'] . "</a></td></tr>");
|
||||
|
||||
$types = array("diskio_bits", "diskio_ops");
|
||||
|
||||
foreach($types as $graph_type) {
|
||||
|
||||
foreach ($types as $graph_type)
|
||||
{
|
||||
echo('<tr bgcolor="'.$row_colour.'"><td colspan=5>');
|
||||
|
||||
$graph_array['id'] = $drive['diskio_id'];
|
||||
@@ -44,13 +44,11 @@ while($drive = mysql_fetch_array($query)) {
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
|
||||
}
|
||||
|
||||
$row++;
|
||||
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</table>");
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,36 +1,39 @@
|
||||
<?php
|
||||
|
||||
$graph_type = "mempool_usage";
|
||||
|
||||
echo("<div style='margin-top: 5px; padding: 0px;'>");
|
||||
echo("<table width=100% cellpadding=6 cellspacing=0>");
|
||||
$i = '1';
|
||||
$mempools = mysql_query("SELECT * FROM `mempools` WHERE device_id = '" . $device['device_id'] . "'");
|
||||
while($mempool = mysql_fetch_array($mempools)) {
|
||||
if(!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
$text_descr = rewrite_entity_descr($mempool['mempool_descr']);
|
||||
|
||||
$mempool_url = "device/".$device['device_id']."/health/memory/";
|
||||
$mini_url = "graph.php?id=".$mempool['mempool_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4";
|
||||
echo("<div style='margin-top: 5px; padding: 0px;'>");
|
||||
echo("<table width=100% cellpadding=6 cellspacing=0>");
|
||||
|
||||
$mempool_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$text_descr;
|
||||
$mempool_popup .= "</div><img src=\'graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=125\'>";
|
||||
$mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
$i = '1';
|
||||
$mempools = mysql_query("SELECT * FROM `mempools` WHERE device_id = '" . $device['device_id'] . "'");
|
||||
|
||||
$total = formatStorage($mempool['mempool_total']);
|
||||
$used = formatStorage($mempool['mempool_used']);
|
||||
$free = formatStorage($mempool['mempool_free']);
|
||||
while ($mempool = mysql_fetch_array($mempools))
|
||||
{
|
||||
if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
$perc = round($mempool['mempool_used'] / $mempool['mempool_total'] * 100);
|
||||
$text_descr = rewrite_entity_descr($mempool['mempool_descr']);
|
||||
|
||||
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'; }
|
||||
$mempool_url = "device/".$device['device_id']."/health/memory/";
|
||||
$mini_url = "graph.php?id=".$mempool['mempool_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4";
|
||||
|
||||
echo("<tr bgcolor=$row_colour><td class=tablehead><a href='".$mempool_url."' $mempool_popup>" . $text_descr . "</a></td>
|
||||
$mempool_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$text_descr;
|
||||
$mempool_popup .= "</div><img src=\'graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=125\'>";
|
||||
$mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
|
||||
$total = formatStorage($mempool['mempool_total']);
|
||||
$used = formatStorage($mempool['mempool_used']);
|
||||
$free = formatStorage($mempool['mempool_free']);
|
||||
|
||||
$perc = round($mempool['mempool_used'] / $mempool['mempool_total'] * 100);
|
||||
|
||||
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("<tr bgcolor=$row_colour><td class=tablehead><a href='".$mempool_url."' $mempool_popup>" . $text_descr . "</a></td>
|
||||
<td width=90><a href='".$mempool_url."' $mempool_popup><img src='$mini_url'></a></td>
|
||||
<td width=200><a href='".$mempool_url."' $mempool_popup>
|
||||
".print_percentage_bar (400, 20, $perc, "$used / $total", "ffffff", $left_background, $free , "ffffff", $right_background)."
|
||||
@@ -38,23 +41,19 @@ $graph_type = "mempool_usage";
|
||||
<td width=50>".$perc."%</td>
|
||||
</tr>");
|
||||
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
|
||||
$graph_array['id'] = $mempool['mempool_id'];
|
||||
$graph_array['type'] = $graph_type;
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
|
||||
echo("</td></tr>");
|
||||
|
||||
$i++;
|
||||
}
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
|
||||
|
||||
?>
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
|
||||
?>
|
@@ -4,10 +4,11 @@ $graph_type = "processor_usage";
|
||||
|
||||
echo("<div style='margin-top: 5px; padding: 0px;'>");
|
||||
echo("<table width=100% cellpadding=6 cellspacing=0>");
|
||||
|
||||
$i = '1';
|
||||
$procs = mysql_query("SELECT * FROM `processors` WHERE device_id = '" . $device['device_id'] . "'");
|
||||
while($proc = mysql_fetch_array($procs)) {
|
||||
|
||||
while ($proc = mysql_fetch_array($procs))
|
||||
{
|
||||
$proc_url = "device/".$device['device_id']."/health/processors/";
|
||||
|
||||
$mini_url = "graph.php?id=".$proc['processor_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4";
|
||||
@@ -22,10 +23,10 @@ while($proc = mysql_fetch_array($procs)) {
|
||||
|
||||
$perc = round($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';
|
||||
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("<tr bgcolor=$row_colour>
|
||||
@@ -42,11 +43,9 @@ while($proc = mysql_fetch_array($procs)) {
|
||||
$graph_array['type'] = $graph_type;
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@@ -7,9 +7,9 @@ echo("<table cellspacing=0 cellpadding=5 width=100%>");
|
||||
|
||||
$row = 1;
|
||||
|
||||
while($temp = mysql_fetch_array($query)) {
|
||||
|
||||
if(!is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
while ($temp = mysql_fetch_array($query))
|
||||
{
|
||||
if (!is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
echo("<tr class=list-large style=\"background-color: $row_colour; padding: 5px;\">
|
||||
<td width=500>" . $temp['sensor_descr'] . "</td>
|
||||
@@ -27,12 +27,9 @@ while($temp = mysql_fetch_array($query)) {
|
||||
|
||||
echo("</td></tr>");
|
||||
|
||||
|
||||
$row++;
|
||||
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@@ -16,31 +16,31 @@ echo("<tr class=tablehead>
|
||||
|
||||
$row = 1;
|
||||
|
||||
while($drive = mysql_fetch_array($query)) {
|
||||
while ($drive = mysql_fetch_array($query))
|
||||
{
|
||||
if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
$total = $drive['storage_size'];
|
||||
$used = $drive['storage_used'];
|
||||
$free = $drive['storage_free'];
|
||||
$perc = round($drive['storage_perc'], 0);
|
||||
$used = formatStorage($used);
|
||||
$total = formatStorage($total);
|
||||
$free = formatStorage($free);
|
||||
|
||||
$total = $drive['storage_size'];
|
||||
$used = $drive['storage_used'];
|
||||
$free = $drive['storage_free'];
|
||||
$perc = round($drive['storage_perc'], 0);
|
||||
$used = formatStorage($used);
|
||||
$total = formatStorage($total);
|
||||
$free = formatStorage($free);
|
||||
$fs_url = "device/".$device['device_id']."/health/storage/";
|
||||
|
||||
$fs_url = "device/".$device['device_id']."/health/storage/";
|
||||
$fs_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['storage_descr'];
|
||||
$fs_popup .= "</div><img src=\'graph.php?id=" . $drive['storage_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=125\'>";
|
||||
$fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"";
|
||||
|
||||
$fs_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['storage_descr'];
|
||||
$fs_popup .= "</div><img src=\'graph.php?id=" . $drive['storage_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=125\'>";
|
||||
$fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"";
|
||||
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("<tr bgcolor='$row_colour'><th><a href='$fs_url' $fs_popup>" . $drive['storage_descr'] . "</a></td><td>
|
||||
echo("<tr bgcolor='$row_colour'><th><a href='$fs_url' $fs_popup>" . $drive['storage_descr'] . "</a></td><td>
|
||||
<a href='$fs_url' $fs_popup>".print_percentage_bar (400, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."</a>
|
||||
</td><td>" . $free . "</td><td></td></tr>");
|
||||
|
||||
@@ -53,11 +53,9 @@ while($drive = mysql_fetch_array($query)) {
|
||||
|
||||
echo("</td></tr>");
|
||||
|
||||
|
||||
$row++;
|
||||
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</table>");
|
||||
|
||||
?>
|
||||
?>
|
@@ -3,55 +3,56 @@
|
||||
echo("<table width=100%>");
|
||||
|
||||
$hrdevices = mysql_query("SELECT * FROM `hrDevice` WHERE `device_id` = '".$device['device_id']."' ORDER BY `hrDeviceIndex`");
|
||||
while($hrdevice = mysql_fetch_array($hrdevices)) {
|
||||
while ($hrdevice = mysql_fetch_array($hrdevices))
|
||||
{
|
||||
|
||||
echo("<tr><td>".$hrdevice['hrDeviceIndex']."</td>");
|
||||
|
||||
if($hrdevice['hrDeviceType'] == "hrDeviceProcessor") {
|
||||
$proc_id = mysql_result(mysql_query("SELECT processor_id FROM processors WHERE device_id = '".$device['device_id']."' AND hrDeviceIndex = '".$hrdevice['hrDeviceIndex']."'"),0);
|
||||
$proc_url = $config['base_url'] . "/device/".$device['device_id']."/health/processors/";
|
||||
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$hrdevice['hrDeviceDescr'];
|
||||
$proc_popup .= "</div><img src=\'".$config['base_url']."/graph.php?id=" . $proc_id . "&type=processor_usage&from=$month&to=$now&width=400&height=125\'>";
|
||||
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
echo("<td><a href='$proc_url' $proc_popup>".$hrdevice['hrDeviceDescr']."</a></td>");
|
||||
if ($hrdevice['hrDeviceType'] == "hrDeviceProcessor")
|
||||
{
|
||||
$proc_id = mysql_result(mysql_query("SELECT processor_id FROM processors WHERE device_id = '".$device['device_id']."' AND hrDeviceIndex = '".$hrdevice['hrDeviceIndex']."'"),0);
|
||||
$proc_url = $config['base_url'] . "/device/".$device['device_id']."/health/processors/";
|
||||
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$hrdevice['hrDeviceDescr'];
|
||||
$proc_popup .= "</div><img src=\'".$config['base_url']."/graph.php?id=" . $proc_id . "&type=processor_usage&from=$month&to=$now&width=400&height=125\'>";
|
||||
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
echo("<td><a href='$proc_url' $proc_popup>".$hrdevice['hrDeviceDescr']."</a></td>");
|
||||
|
||||
$graph_array['height'] = "20";
|
||||
$graph_array['width'] = "100";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $proc_id;
|
||||
$graph_array['type'] = 'processor_usage';
|
||||
$graph_array['from'] = $day;
|
||||
$graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400";
|
||||
$graph_array['height'] = "20";
|
||||
$graph_array['width'] = "100";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $proc_id;
|
||||
$graph_array['type'] = 'processor_usage';
|
||||
$graph_array['from'] = $day;
|
||||
$graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400";
|
||||
|
||||
$mini_graph = overlib_link($_SERVER['REQUEST_URI'], generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
|
||||
$mini_graph = overlib_link($_SERVER['REQUEST_URI'], generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
|
||||
|
||||
echo('<td>'.$mini_graph.'</td>');
|
||||
} elseif ($hrdevice['hrDeviceType'] == "hrDeviceNetwork") {
|
||||
$int = str_replace("network interface ", "", $hrdevice['hrDeviceDescr']);
|
||||
$interface = mysql_fetch_array(mysql_query("SELECT * FROM ports WHERE device_id = '".$device['device_id']."' AND ifDescr = '".$int."'"));
|
||||
if ($interface['ifIndex']) {
|
||||
echo("<td>".generate_port_link($interface)."</td>");
|
||||
|
||||
echo('<td>'.$mini_graph.'</td>');
|
||||
} elseif ($hrdevice['hrDeviceType'] == "hrDeviceNetwork") {
|
||||
$int = str_replace("network interface ", "", $hrdevice['hrDeviceDescr']);
|
||||
$interface = mysql_fetch_array(mysql_query("SELECT * FROM ports WHERE device_id = '".$device['device_id']."' AND ifDescr = '".$int."'"));
|
||||
if($interface['ifIndex']) {
|
||||
echo("<td>".generate_port_link($interface)."</td>");
|
||||
$graph_array['height'] = "20";
|
||||
$graph_array['width'] = "100";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $interface['interface_id'];
|
||||
$graph_array['type'] = 'port_bits';
|
||||
$graph_array['from'] = $day;
|
||||
$graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400";
|
||||
|
||||
$graph_array['height'] = "20";
|
||||
$graph_array['width'] = "100";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $interface['interface_id'];
|
||||
$graph_array['type'] = 'port_bits';
|
||||
$graph_array['from'] = $day;
|
||||
$graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400";
|
||||
$mini_graph = overlib_link($_SERVER['REQUEST_URI'], generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
|
||||
|
||||
$mini_graph = overlib_link($_SERVER['REQUEST_URI'], generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
|
||||
|
||||
echo("<td>$mini_graph</td>");
|
||||
echo("<td>$mini_graph</td>");
|
||||
} else {
|
||||
echo("<td>".$hrdevice['hrDeviceDescr']."</td>");
|
||||
echo("<td></td>");
|
||||
}
|
||||
} else {
|
||||
echo("<td>".$hrdevice['hrDeviceDescr']."</td>");
|
||||
echo("<td></td>");
|
||||
}
|
||||
} else {
|
||||
echo("<td>".$hrdevice['hrDeviceDescr']."</td>");
|
||||
echo("<td></td>");
|
||||
}
|
||||
|
||||
echo("<td>".$hrdevice['hrDeviceType']."</td><td>".$hrdevice['hrDeviceStatus']."</td>");
|
||||
echo("<td>".$hrdevice['hrDeviceErrors']."</td><td>".$hrdevice['hrProcessorLoad']."</td>");
|
||||
@@ -61,5 +62,4 @@ if($hrdevice['hrDeviceType'] == "hrDeviceProcessor") {
|
||||
|
||||
echo("</table>");
|
||||
|
||||
?>
|
||||
|
||||
?>
|
@@ -1,52 +1,57 @@
|
||||
<?php
|
||||
|
||||
if( !isset($_GET['optb']) ) { $_GET['optb'] = "graphs"; }
|
||||
if (!isset($_GET['optb']) ) { $_GET['optb'] = "graphs"; }
|
||||
|
||||
$interface_query = mysql_query("select * from ports WHERE interface_id = '".$_GET['opta']."'");
|
||||
$interface = mysql_fetch_assoc($interface_query);
|
||||
|
||||
$port_details = 1;
|
||||
$port_details = 1;
|
||||
|
||||
$hostname = $device['hostname'];
|
||||
$hostid = $device['interface_id'];
|
||||
$ifname = $interface['ifDescr'];
|
||||
$ifIndex = $interface['ifIndex'];
|
||||
$speed = humanspeed($interface['ifSpeed']);
|
||||
$hostname = $device['hostname'];
|
||||
$hostid = $device['interface_id'];
|
||||
$ifname = $interface['ifDescr'];
|
||||
$ifIndex = $interface['ifIndex'];
|
||||
$speed = humanspeed($interface['ifSpeed']);
|
||||
|
||||
$ifalias = $interface['name'];
|
||||
$ifalias = $interface['name'];
|
||||
|
||||
if($interface['ifPhysAddress']) { $mac = "$interface[ifPhysAddress]"; }
|
||||
if ($interface['ifPhysAddress']) { $mac = "$interface[ifPhysAddress]"; }
|
||||
|
||||
$color = "black";
|
||||
if ($interface['ifAdminStatus'] == "down") { $status = "<span class='grey'>Disabled</span>"; }
|
||||
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "down") { $status = "<span class='red'>Enabled / Disconnected</span>"; }
|
||||
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "up") { $status = "<span class='green'>Enabled / Connected</span>"; }
|
||||
$color = "black";
|
||||
if ($interface['ifAdminStatus'] == "down") { $status = "<span class='grey'>Disabled</span>"; }
|
||||
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "down") { $status = "<span class='red'>Enabled / Disconnected</span>"; }
|
||||
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "up") { $status = "<span class='green'>Enabled / Connected</span>"; }
|
||||
|
||||
$i = 1;
|
||||
$inf = fixifName($ifname);
|
||||
$i = 1;
|
||||
$inf = fixifName($ifname);
|
||||
|
||||
$bg="#ffffff";
|
||||
$bg="#ffffff";
|
||||
|
||||
$show_all = 1;
|
||||
$show_all = 1;
|
||||
|
||||
echo("<div class=ifcell style='margin: 0px;'><table width=100% cellpadding=10 cellspacing=0>");
|
||||
echo("<div class=ifcell style='margin: 0px;'><table width=100% cellpadding=10 cellspacing=0>");
|
||||
|
||||
include("includes/print-interface.inc.php");
|
||||
include("includes/print-interface.inc.php");
|
||||
|
||||
echo("</table></div>");
|
||||
echo("</table></div>");
|
||||
|
||||
$pos = strpos(strtolower($ifname), "vlan");
|
||||
if( $pos !== false ) {
|
||||
$pos = strpos(strtolower($ifname), "vlan");
|
||||
if ($pos !== false )
|
||||
{
|
||||
$broke = yes;
|
||||
}
|
||||
$pos = strpos(strtolower($ifname), "loopback");
|
||||
if( $pos !== false ) {
|
||||
$broke = yes;
|
||||
}
|
||||
}
|
||||
|
||||
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `ports` WHERE `pagpGroupIfIndex` = '".$interface['ifIndex']."' and `device_id` = '".$device['device_id']."'"),0)) {
|
||||
$pos = strpos(strtolower($ifname), "loopback");
|
||||
|
||||
if ($pos !== false )
|
||||
{
|
||||
$broke = yes;
|
||||
}
|
||||
|
||||
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ports` WHERE `pagpGroupIfIndex` = '".$interface['ifIndex']."' and `device_id` = '".$device['device_id']."'"),0))
|
||||
{
|
||||
$pagp = " | <a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/pagp/'>PAgP</a>";
|
||||
}
|
||||
}
|
||||
|
||||
echo("<div style='clear: both;'>");
|
||||
|
||||
@@ -54,37 +59,35 @@ print_optionbar_start();
|
||||
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/'>Graphs</a> | ");
|
||||
|
||||
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `ports_adsl` WHERE `interface_id` = '".$interface['interface_id']."'"),0))
|
||||
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ports_adsl` WHERE `interface_id` = '".$interface['interface_id']."'"),0))
|
||||
{
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/interface/".$interface['interface_id']."/adsl/'>ADSL</a> | ");
|
||||
}
|
||||
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/arp/'>ARP Table</a>$pagp");
|
||||
|
||||
|
||||
|
||||
if(mysql_result(mysql_query("SELECT count(*) FROM mac_accounting WHERE interface_id = '".$interface['interface_id']."'"),0) > "0"){
|
||||
echo(" | Mac Accounting :
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/'>Bits</a>
|
||||
(<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/thumbs/'>Mini</a>|<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/top10/'>Top10</a>) |
|
||||
if (mysql_result(mysql_query("SELECT count(*) FROM mac_accounting WHERE interface_id = '".$interface['interface_id']."'"),0) > "0")
|
||||
{
|
||||
echo(" | Mac Accounting :
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/'>Bits</a>
|
||||
(<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/thumbs/'>Mini</a>|<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/top10/'>Top10</a>) |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/pkts/'>Packets</a>
|
||||
(<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/pkts/thumbs/'>Mini</a>)");
|
||||
}
|
||||
|
||||
|
||||
if(mysql_result(mysql_query("SELECT COUNT(*) FROM juniAtmVp WHERE interface_id = '".$interface['interface_id']."'"),0) > "0"){
|
||||
echo(" | ATM VPs :");
|
||||
echo(" <a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/junose-atm-vp/bits/'>Bits</a>");
|
||||
echo(" | <a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/junose-atm-vp/packets/'>Packets</a>");
|
||||
echo(" | <a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/junose-atm-vp/cells/'>Cells</a>");
|
||||
echo(" | <a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/junose-atm-vp/errors/'>Errors</a>");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (mysql_result(mysql_query("SELECT COUNT(*) FROM juniAtmVp WHERE interface_id = '".$interface['interface_id']."'"),0) > "0")
|
||||
{
|
||||
echo(" | ATM VPs :");
|
||||
echo(" <a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/junose-atm-vp/bits/'>Bits</a>");
|
||||
echo(" | <a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/junose-atm-vp/packets/'>Packets</a>");
|
||||
echo(" | <a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/junose-atm-vp/cells/'>Cells</a>");
|
||||
echo(" | <a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/junose-atm-vp/errors/'>Errors</a>");
|
||||
}
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
echo("<div style='margin: 5px;'>");
|
||||
include("pages/device/port/".mres($_GET['optb']).".inc.php");
|
||||
echo("</div>");
|
||||
?>
|
||||
|
||||
?>
|
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
### Connect to database
|
||||
|
||||
$nagios_host = mysql_fetch_array( mysql_query("SELECT * FROM nagios_hosts WHERE address = '".$device['hostname']."'", $nagios_link) );
|
||||
$nagios_hoststatus = mysql_fetch_array( mysql_query("SELECT * FROM nagios_hoststatus WHERE '".$nagios_host['host_object_id']."'", $nagios_link) );
|
||||
|
||||
$i = 0;
|
||||
|
||||
$service_text = array ('0' => 'Up', '1' => 'Down', '2' => 'Critical', '3' => 'Unknown');
|
||||
$host_text = array ('0' => 'Up', '1' => 'Down', '2' => 'Unreachable');
|
||||
|
||||
$host_colour = array ('0' => '#99ff99', '1' => '#ff9999', '2' => '#ff6666');
|
||||
$service_colour = array ('0' => '#99ff99', '1' => '#ff9999', '2' => '#ff6666', '3' => '#ffaa99');
|
||||
|
||||
|
||||
echo("<div style='font-size: 20px; padding:5px; margin:5px; background: ".$host_colour[$nagios_hoststatus[current_state]]."'>Status : " . $host_text[$nagios_hoststatus[current_state]] . " ".$nagios_hoststatus['output']."</div>");
|
||||
|
||||
|
||||
echo("<table cellspacing=0 cellpadding=3>");
|
||||
$nagios_services = mysql_query("SELECT * FROM nagios_services AS N, nagios_servicestatus AS S WHERE N.host_object_id = '".$nagios_host['host_object_id']."' AND S.service_object_id = N.service_object_id", $nagios_link);
|
||||
while ($nagios_service = mysql_fetch_array($nagios_services)) {
|
||||
if(!is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; }
|
||||
echo("<tr bgcolor=$bg_colour>");
|
||||
$service_state = $nagios_service['current_state'];
|
||||
echo("<td>" . $nagios_service['display_name'] . "</td><td bgcolor=".$service_colour[$service_state].">".$service_text[$service_state]."</td><td>" . $nagios_service['output'] . "</td>");
|
||||
echo("</tr>");
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
|
||||
|
||||
?>
|
@@ -2,10 +2,6 @@
|
||||
|
||||
$overview = 1;
|
||||
|
||||
#$id = $_GET['id'];
|
||||
|
||||
#$device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE `device_id` = '$_GET[id]'"));
|
||||
|
||||
$ports['total'] = mysql_result(mysql_query("SELECT count(*) FROM ports WHERE device_id = '" . $device['device_id'] . "'"),0);
|
||||
$ports['up'] = mysql_result(mysql_query("SELECT count(*) FROM ports WHERE device_id = '" . $device['device_id'] . "' AND ifOperStatus = 'up'"),0);
|
||||
$ports['down'] = mysql_result(mysql_query("SELECT count(*) FROM ports WHERE device_id = '" . $device['device_id'] . "' AND ifOperStatus = 'down' AND ifAdminStatus = 'up'"),0);
|
||||
@@ -16,12 +12,12 @@ $services['up'] = mysql_result(mysql_query("SELECT count(service_id) FROM servic
|
||||
$services['down'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE device_id = '" . $device['device_id'] . "' AND service_status = '0' AND service_ignore = '0'"),0);
|
||||
$services['disabled'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE device_id = '" . $device['device_id'] . "' AND service_ignore = '1'"),0);
|
||||
|
||||
if($services['down']) { $services_colour = $warn_colour_a; } else { $services_colour = $list_colour_a; }
|
||||
if($ports['down']) { $ports_colour = $warn_colour_a; } else { $ports_colour = $list_colour_a; }
|
||||
if ($services['down']) { $services_colour = $warn_colour_a; } else { $services_colour = $list_colour_a; }
|
||||
if ($ports['down']) { $ports_colour = $warn_colour_a; } else { $ports_colour = $list_colour_a; }
|
||||
|
||||
echo("<div style='width: 50%; float: left;'>");
|
||||
|
||||
#if(file_exists("includes/dev-data-" . strtolower($device[os]) . ".inc.php")) {
|
||||
#if (file_exists("includes/dev-data-" . strtolower($device[os]) . ".inc.php")) {
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
# echo("<p class=sectionhead>Device Data</p><div style='height: 5px;'></div>");
|
||||
# include("includes/dev-data-" . strtolower($device[os]) . ".inc.php");
|
||||
@@ -29,15 +25,14 @@ echo("<div style='width: 50%; float: left;'>");
|
||||
echo("</div>");
|
||||
#}
|
||||
|
||||
|
||||
include("overview/ports.inc.php");
|
||||
|
||||
if($services['total']) {
|
||||
|
||||
if ($services['total'])
|
||||
{
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead><img align='absmiddle' src='".$config['base_url']."/images/16/cog.png'> Services</p><div style='height: 5px;'></div>");
|
||||
|
||||
echo("
|
||||
echo("
|
||||
<table class=tablehead cellpadding=2 cellspacing=0 width=100%>
|
||||
<tr bgcolor=$services_colour align=center><td></td>
|
||||
<td width=25%><img src='images/16/cog.png' align=absmiddle> $services[total]</td>
|
||||
@@ -50,7 +45,8 @@ echo("
|
||||
|
||||
$sql = "SELECT * FROM services WHERE device_id = '" . $device['device_id'] . "' ORDER BY service_type";
|
||||
$query = mysql_query($sql);
|
||||
while($data = mysql_fetch_array($query)) {
|
||||
while ($data = mysql_fetch_array($query))
|
||||
{
|
||||
if ($data[service_status] == "0" && $data[service_ignore] == "1") { $status = "grey"; }
|
||||
if ($data[service_status] == "1" && $data[service_ignore] == "1") { $status = "green"; }
|
||||
if ($data[service_status] == "0" && $data[service_ignore] == "0") { $status = "red"; }
|
||||
@@ -60,20 +56,19 @@ echo("
|
||||
}
|
||||
|
||||
echo("</div>");
|
||||
|
||||
echo("</div>");
|
||||
|
||||
}
|
||||
|
||||
$sql = "SELECT *, DATE_FORMAT(timestamp, '%d/%b/%y %T') AS date from syslog WHERE device_id = '" . $_GET['id'] . "' $where";
|
||||
$sql .= " ORDER BY timestamp DESC LIMIT 20";
|
||||
$query = mysql_query($sql);
|
||||
|
||||
if(mysql_affected_rows() > "0"){
|
||||
if (mysql_affected_rows() > "0")
|
||||
{
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead><img align='absmiddle' src='".$config['base_url']."/images/16/printer.png'> Recent Syslog</p>");
|
||||
echo("<table cellspacing=0 cellpadding=2 width=100%>");
|
||||
while($entry = mysql_fetch_array($query)) { include("includes/print-syslog.inc"); }
|
||||
while ($entry = mysql_fetch_array($query)) { include("includes/print-syslog.inc"); }
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
}
|
||||
@@ -82,7 +77,6 @@ echo("</div>");
|
||||
|
||||
echo("<div style='float:right; width: 50%;'>");
|
||||
|
||||
|
||||
### Right Pane
|
||||
include("overview/processors.inc.php");
|
||||
include("overview/mempools.inc.php");
|
||||
@@ -105,11 +99,12 @@ $data = mysql_query($query);
|
||||
|
||||
echo("<table cellspacing=0 cellpadding=2 width=100%>");
|
||||
|
||||
while($entry = mysql_fetch_array($data)) {
|
||||
while ($entry = mysql_fetch_array($data))
|
||||
{
|
||||
include("includes/print-event-short.inc");
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
|
||||
echo("</div>");
|
||||
?>
|
||||
|
||||
?>
|
@@ -2,16 +2,16 @@
|
||||
|
||||
$results = mysql_query("SELECT * FROM sensors WHERE sensor_class='" . $sensor_class . "' AND device_id = '" . $device['device_id'] . "' ORDER BY sensor_index");
|
||||
|
||||
if(mysql_num_rows($results))
|
||||
if (mysql_num_rows($results))
|
||||
{
|
||||
$rows = round(mysql_num_rows($results) / 2,0);
|
||||
echo('<div style="background-color: #eeeeee; margin: 5px; padding: 5px;">');
|
||||
echo('<p style="padding: 0px 5px 5px;" class="sectionhead"><a class="sectionhead" href="device/'.$device['device_id'].'/health/' . strtolower($sensor_type) . '/"><img align="absmiddle" src="'.$config['base_url'].'/images/icons/' . strtolower($sensor_type) . '.png"> ' . $sensor_type . '</p>');
|
||||
$i = '1';
|
||||
echo('<table width="100%" valign="top">');
|
||||
while($sensor = mysql_fetch_array($results))
|
||||
while ($sensor = mysql_fetch_array($results))
|
||||
{
|
||||
if(is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
if (is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
$graph_colour = str_replace("#", "", $row_colour);
|
||||
|
||||
@@ -33,8 +33,9 @@ if(mysql_num_rows($results))
|
||||
echo("<tr bgcolor='$row_colour'><td class=tablehead><strong>$sensor_link_a</strong></td><td width=80 align=right class=tablehead>$sensor_link_b<td width=80 align=right class=tablehead>$sensor_link_c</td></tr>");
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -2,14 +2,17 @@
|
||||
|
||||
$graph_type = "mempool_usage";
|
||||
|
||||
if(mysql_result(mysql_query("SELECT count(*) from mempools WHERE device_id = '" . $device['device_id'] . "'"),0)) {
|
||||
if (mysql_result(mysql_query("SELECT count(*) from mempools WHERE device_id = '" . $device['device_id'] . "'"),0))
|
||||
{
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead><img align='absmiddle' src='".$config['base_url']."/images/icons/memory.png'> Memory Pools</p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
$mempool_rows = '1';
|
||||
$mempools = mysql_query("SELECT * FROM `mempools` WHERE device_id = '" . $device['device_id'] . "'");
|
||||
while($mempool = mysql_fetch_array($mempools)) {
|
||||
if(is_integer($mempool_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
while ($mempool = mysql_fetch_array($mempools))
|
||||
{
|
||||
if (is_integer($mempool_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
$perc = round($mempool['mempool_used'] / ($mempool['mempool_total']) * 100,2);
|
||||
|
||||
$text_descr = rewrite_entity_descr($mempool['mempool_descr']);
|
||||
@@ -25,25 +28,24 @@ if(mysql_result(mysql_query("SELECT count(*) from mempools WHERE device_id = '"
|
||||
$used = formatStorage($mempool['mempool_used']);
|
||||
$free = formatStorage($mempool['mempool_free']);
|
||||
|
||||
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("<tr bgcolor=$row_colour><td class=tablehead><a href='".$mempool_url."' $mempool_popup>" . $text_descr . "</a></td>
|
||||
<td width=90><a href='".$mempool_url."' $mempool_popup><img src='$mini_url'></a></td>
|
||||
<td width=200><a href='".$mempool_url."' $mempool_popup>
|
||||
".print_percentage_bar (200, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."
|
||||
".print_percentage_bar (200, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."
|
||||
</a></td>
|
||||
</tr>");
|
||||
|
||||
|
||||
$mempool_rows++;
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
if($ports['total']) {
|
||||
if ($ports['total'])
|
||||
{
|
||||
echo('<div style="background-color: #eeeeee; margin: 5px; padding: 5px;">');
|
||||
# ' . device_traffic_image($device['device_id'], 490, 100, $day, '-300s'));
|
||||
|
||||
@@ -13,7 +14,6 @@ if($ports['total']) {
|
||||
$graph_array['legend'] = "no";
|
||||
$graph = generate_graph_tag($graph_array);
|
||||
|
||||
|
||||
$content = "<div class=list-large>".$device['hostname']." - Device Traffic</div>";
|
||||
$content .= "<div style=\'width: 850px\'>";
|
||||
$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(' <div style="height: 5px;"></div>');
|
||||
|
||||
echo(' <table class="tablehead" cellpadding="2" cellspacing="0" width="100%">
|
||||
@@ -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(" </div>");
|
||||
echo("</div>");
|
||||
}
|
||||
?>
|
||||
|
||||
?>
|
@@ -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("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead><img align='absmiddle' src='".$config['base_url']."/images/icons/processors.png'> Processors</p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
$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("<tr bgcolor=$row_colour><td class=tablehead><a href='".$proc_url."' $proc_popup>" . $text_descr . "</a></td>
|
||||
<td width=90><a href='".$proc_url."' $proc_popup><img src='$mini_url'></a></td>
|
||||
@@ -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)."
|
||||
</a></td>
|
||||
</tr>");
|
||||
$processor_rows++;
|
||||
$processor_rows++;
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -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("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead><img align='absmiddle' src='".$config['base_url']."/images/icons/storage.png'> Storage</p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
$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("<tr bgcolor=$row_colour><td class=tablehead><a href='".$fs_url."' $fs_popup>" . $drive['storage_descr'] . "</a></td>
|
||||
<td width=90><a href='".$fs_url."' $fs_popup><img src='$mini_graph' /></a></td>
|
||||
<td width=200><a href='".$fs_url."' $fs_popup>".print_percentage_bar (200, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."</a></td>
|
||||
</tr>");
|
||||
$drive_rows++;
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
unset ($drive_rows);
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,39 +1,23 @@
|
||||
<?php
|
||||
|
||||
if(file_exists($config['rrd_dir'] . "/" . $hostname . "/port-". $ifIndex . "-adsl.rrd")) {
|
||||
if (file_exists($config['rrd_dir'] . "/" . $hostname . "/port-". $ifIndex . "-adsl.rrd"))
|
||||
{
|
||||
$iid = $id;
|
||||
echo("<div class=graphhead>ADSL Line Speed</div>");
|
||||
$graph_type = "port_adsl_speed";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
$iid = $id;
|
||||
echo("<div class=graphhead>ADSL Line Speed</div>");
|
||||
$graph_type = "port_adsl_speed";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
echo("<div class=graphhead>ADSL Line Attenuation</div>");
|
||||
$graph_type = "port_adsl_attenuation";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>ADSL Line Attenuation</div>");
|
||||
$graph_type = "port_adsl_attenuation";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
echo("<div class=graphhead>ADSL Line SNR Margin</div>");
|
||||
$graph_type = "port_adsl_snr";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>ADSL Line SNR Margin</div>");
|
||||
$graph_type = "port_adsl_snr";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
echo("<div class=graphhead>ADSL Output Powers</div>");
|
||||
$graph_type = "port_adsl_power";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
}
|
||||
|
||||
echo("<div class=graphhead>ADSL Output Powers</div>");
|
||||
$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);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,30 +1,30 @@
|
||||
<?php
|
||||
|
||||
if(file_exists($config['rrd_dir'] . "/" . $hostname . "/port-". $ifIndex . ".rrd")) {
|
||||
if (file_exists($config['rrd_dir'] . "/" . $hostname . "/port-". $ifIndex . ".rrd"))
|
||||
{
|
||||
$iid = $id;
|
||||
echo("<div class=graphhead>Interface Traffic</div>");
|
||||
$graph_type = "port_bits";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
$iid = $id;
|
||||
echo("<div class=graphhead>Interface Traffic</div>");
|
||||
$graph_type = "port_bits";
|
||||
echo("<div class=graphhead>Interface Packets</div>");
|
||||
$graph_type = "port_upkts";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>Interface Non Unicast</div>");
|
||||
$graph_type = "port_nupkts";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>Interface Errors</div>");
|
||||
$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("<div class=graphhead>Ethernet Errors</div>");
|
||||
$graph_type = "port_etherlike";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>Interface Packets</div>");
|
||||
$graph_type = "port_upkts";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>Interface Non Unicast</div>");
|
||||
$graph_type = "port_nupkts";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>Interface Errors</div>");
|
||||
$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("<div class=graphhead>Ethernet Errors</div>");
|
||||
$graph_type = "port_etherlike";
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,39 +1,42 @@
|
||||
<?php
|
||||
|
||||
$row = 0;
|
||||
$row = 0;
|
||||
|
||||
if($_GET['optc']) { $graph_type = "atmvp_".$_GET['optc']; }
|
||||
if(!$graph_type) { $graph_type = "atmvp_bits"; }
|
||||
if ($_GET['optc']) { $graph_type = "atmvp_".$_GET['optc']; }
|
||||
if (!$graph_type) { $graph_type = "atmvp_bits"; }
|
||||
|
||||
echo("<table cellspacing=0 cellpadding=5 border=0>");
|
||||
echo('<table cellspacing="0" cellpadding="5" border="0">');
|
||||
|
||||
$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('<tr bgcolor="'.$row_colour.'">');
|
||||
echo('<td><span class=list-bold>'.$row.'. VP'.$vp['vp_id'].' '.$vp['vp_descr'].'</span></td>');
|
||||
echo('</tr>');
|
||||
$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('<tr bgcolor="'.$row_colour.'">');
|
||||
echo('<td><span class=list-bold>'.$row.'. VP'.$vp['vp_id'].' '.$vp['vp_descr'].'</span></td>');
|
||||
echo('</tr>');
|
||||
|
||||
$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('<tr bgcolor="'.$row_colour.'"><td>');
|
||||
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("</td></tr>");
|
||||
|
||||
$row++;
|
||||
$periods = array('day', 'week', 'month', 'year');
|
||||
|
||||
echo('<tr bgcolor="'.$row_colour.'"><td>');
|
||||
|
||||
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('</td></tr>');
|
||||
|
||||
echo("</table>");
|
||||
$row++;
|
||||
}
|
||||
|
||||
?>
|
||||
echo('</table>');
|
||||
|
||||
?>
|
@@ -1,204 +1,218 @@
|
||||
<?php
|
||||
|
||||
$hostname = $device['hostname'];
|
||||
$hostid = $device['interface_id'];
|
||||
$ifname = $interface['ifDescr'];
|
||||
$ifIndex = $interface['ifIndex'];
|
||||
$speed = humanspeed($interface['ifSpeed']);
|
||||
$hostname = $device['hostname'];
|
||||
$hostid = $device['interface_id'];
|
||||
$ifname = $interface['ifDescr'];
|
||||
$ifIndex = $interface['ifIndex'];
|
||||
$speed = humanspeed($interface['ifSpeed']);
|
||||
|
||||
$ifalias = $interface['name'];
|
||||
$ifalias = $interface['name'];
|
||||
|
||||
if($interface['ifPhysAddress']) { $mac = "$interface[ifPhysAddress]"; }
|
||||
if ($interface['ifPhysAddress']) { $mac = "$interface[ifPhysAddress]"; }
|
||||
|
||||
$color = "black";
|
||||
if ($interface['ifAdminStatus'] == "down") { $status = "<span class='grey'>Disabled</span>"; }
|
||||
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "down") { $status = "<span class='red'>Enabled / Disconnected</span>"; }
|
||||
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "up") { $status = "<span class='green'>Enabled / Connected</span>"; }
|
||||
$color = "black";
|
||||
if ($interface['ifAdminStatus'] == "down") { $status = "<span class='grey'>Disabled</span>"; }
|
||||
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "down") { $status = "<span class='red'>Enabled / Disconnected</span>"; }
|
||||
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "up") { $status = "<span class='green'>Enabled / Connected</span>"; }
|
||||
|
||||
$i = 1;
|
||||
$inf = fixifName($ifname);
|
||||
$i = 1;
|
||||
$inf = fixifName($ifname);
|
||||
|
||||
echo("<div style='clear: both;'>");
|
||||
echo("<div style='clear: both;'>");
|
||||
|
||||
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("<div style='margin: 0px 0px 0px 0px'>
|
||||
<div style=' margin:0px; float: left;';>
|
||||
<div style='margin: 0px 10px 5px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Day</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id'].
|
||||
"/macaccounting/$stat/top10/1day/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id'].
|
||||
"&stat=$stat&type=port_mac_acc_total&sort=$sort&from=-1day&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 10px 5px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Two Day</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id'].
|
||||
"/macaccounting/$stat/top10/2day/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id'].
|
||||
"&stat=$stat&type=port_mac_acc_total&sort=$sort&from=-2day&to=now&width=150&height=50' />
|
||||
if ($_GET['optf'])
|
||||
{
|
||||
$sort = $_GET['optf'];
|
||||
} else { $sort = "in"; }
|
||||
|
||||
echo("<div style='margin: 0px 0px 0px 0px'>
|
||||
<div style=' margin:0px; float: left;';>
|
||||
<div style='margin: 0px 10px 5px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Day</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id'].
|
||||
"/macaccounting/$stat/top10/1day/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id'].
|
||||
"&stat=$stat&type=port_mac_acc_total&sort=$sort&from=-1day&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 10px 5px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Two Day</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id'].
|
||||
"/macaccounting/$stat/top10/2day/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id'].
|
||||
"&stat=$stat&type=port_mac_acc_total&sort=$sort&from=-2day&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 10px 5px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Week</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/$stat/top10/1week/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&type=port_mac_acc_total&sort=$sort&stat=$stat&from=-1week&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 10px 5px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Week</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/$stat/top10/1week/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&type=port_mac_acc_total&sort=$sort&stat=$stat&from=-1week&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 10px 5px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Month</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/$stat/top10/1month/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&type=port_mac_acc_total&sort=$sort&stat=$stat&from=-1month&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 10px 5px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Year</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/$stat/top10/1year/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&type=port_mac_acc_total&sort=$sort&stat=$stat&from=-1year&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div style='float: left;'>
|
||||
<img src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&type=port_mac_acc_total&sort=$sort&stat=$stat&from=$from&to=now&width=745&height=300' />
|
||||
</div>
|
||||
<div style=' margin:0px; float: left;';>
|
||||
<div style='margin: 0px 0px 5px 10px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Traffic</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/top10/$period/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&stat=bits&type=port_mac_acc_total&sort=$sort&from=$from&to=now&width=150&height=50' />
|
||||
<span class=device-head>Month</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/$stat/top10/1month/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&type=port_mac_acc_total&sort=$sort&stat=$stat&from=-1month&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 10px 5px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Year</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/$stat/top10/1year/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&type=port_mac_acc_total&sort=$sort&stat=$stat&from=-1year&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div style='float: left;'>
|
||||
<img src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&type=port_mac_acc_total&sort=$sort&stat=$stat&from=$from&to=now&width=745&height=300' />
|
||||
</div>
|
||||
<div style=' margin:0px; float: left;';>
|
||||
<div style='margin: 0px 0px 5px 10px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Packets</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/pkts/top10/$period/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&stat=pkts&type=port_mac_acc_total&sort=$sort&from=$from&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 0px 5px 10px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Top Input</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id'].
|
||||
"/macaccounting/$stat/top10/$period/in/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id'].
|
||||
"&stat=$stat&type=port_mac_acc_total&sort=in&from=$from&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 0px 5px 10px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Top Output</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id'].
|
||||
"/macaccounting/$stat/top10/$period/out/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id'].
|
||||
"&stat=$stat&type=port_mac_acc_total&sort=out&from=$from&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 0px 5px 10px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Top Aggregate</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id'].
|
||||
"/macaccounting/$stat/top10/$period/both/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id'].
|
||||
"&stat=$stat&type=port_mac_acc_total&sort=both&from=$from&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class=device-head>Traffic</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/top10/$period/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&stat=bits&type=port_mac_acc_total&sort=$sort&from=$from&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 0px 5px 10px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Packets</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/pkts/top10/$period/$sort/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id']."&stat=pkts&type=port_mac_acc_total&sort=$sort&from=$from&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 0px 5px 10px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Top Input</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id'].
|
||||
"/macaccounting/$stat/top10/$period/in/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id'].
|
||||
"&stat=$stat&type=port_mac_acc_total&sort=in&from=$from&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 0px 5px 10px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Top Output</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id'].
|
||||
"/macaccounting/$stat/top10/$period/out/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id'].
|
||||
"&stat=$stat&type=port_mac_acc_total&sort=out&from=$from&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 0px 5px 10px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Top Aggregate</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id'].
|
||||
"/macaccounting/$stat/top10/$period/both/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?id=".$interface['interface_id'].
|
||||
"&stat=$stat&type=port_mac_acc_total&sort=both&from=$from&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
");
|
||||
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("<div style='display: block; padding: 3px; margin: 3px; min-width: 221px; max-width:221px; min-height:90px; max-height:90px; text-align: center; float: left; background-color: #e5e5e5;'>
|
||||
".$addy['ipv4_address']." - ".$asn."
|
||||
<a href='#' onmouseover=\"return overlib('\
|
||||
<div style=\'font-size: 16px; padding:5px; font-weight: bold; color: #555555;\'>".$name." - ".$addy['ipv4_address']." - ".$asn."</div>\
|
||||
<img src=\'graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=-2day&to=$now&width=450&height=150\'>\
|
||||
', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >
|
||||
<img src='graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=-2day&to=$now&width=213&height=45'></a>
|
||||
|
||||
<span style='font-size: 10px;'>".$name."</span>
|
||||
</div>");
|
||||
|
||||
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("<div style='background-color: $row_colour; padding: 0px;'>");
|
||||
|
||||
if($_GET['optc']) {
|
||||
$graph_type = "port_mac_acc_" . $_GET['optc'];
|
||||
} else {
|
||||
$graph_type = "port_mac_acc_bits";
|
||||
}
|
||||
echo("
|
||||
<table>
|
||||
<tr>
|
||||
<td class=list-large width=200>".mac_clean_to_readable($acc['mac'])."</td>
|
||||
<td class=list-large width=200>".$addy['ipv4_address']."</td>
|
||||
<td class=list-large width=500>".$name." ".$arp_name . "</td>
|
||||
<td class=list-large width=100>".formatRates($acc['cipMacHCSwitchedBytes_input_rate'] / 8)."</td>
|
||||
<td class=list-large width=100>".formatRates($acc['cipMacHCSwitchedBytes_output_rate'] / 8)."</td>
|
||||
</tr>
|
||||
</table>
|
||||
");
|
||||
|
||||
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("<div style='display: block; padding: 3px; margin: 3px; min-width: 221px; max-width:221px; min-height:90px; max-height:90px; text-align: center; float: left; background-color: #e5e5e5;'>
|
||||
".$addy['ipv4_address']." - ".$asn."
|
||||
<a href='#' onmouseover=\"return overlib('\
|
||||
<div style=\'font-size: 16px; padding:5px; font-weight: bold; color: #555555;\'>".$name." - ".$addy['ipv4_address']." - ".$asn."</div>\
|
||||
<img src=\'graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=-2day&to=$now&width=450&height=150\'>\
|
||||
', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >
|
||||
<img src='graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=-2day&to=$now&width=213&height=45'></a>
|
||||
echo("<a href='device/" . $acc['device_id'] . "/interface/" . $interface['ma_id'] . "' onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_traffic' border=0></a> ");
|
||||
echo("<a href='device/" . $acc['device_id'] . "/interface/" . $interface['ma_id'] . "' onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_traffic' border=0></a> ");
|
||||
echo("<a href='device/" . $acc['device_id'] . "/interface/" . $interface['ma_id'] . "' onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_traffic' border=0></a> ");
|
||||
echo("<a href='device/" . $acc['device_id'] . "/interface/" . $interface['ma_id'] . "' onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_traffic' border=0></a>");
|
||||
|
||||
<span style='font-size: 10px;'>".$name."</span>
|
||||
</div>");
|
||||
|
||||
} else {
|
||||
|
||||
echo("<div style='background-color: $row_colour; padding: 0px;'>");
|
||||
|
||||
echo("
|
||||
<table>
|
||||
<tr>
|
||||
<td class=list-large width=200>".mac_clean_to_readable($acc['mac'])."</td>
|
||||
<td class=list-large width=200>".$addy['ipv4_address']."</td>
|
||||
<td class=list-large width=500>".$name." ".$arp_name . "</td>
|
||||
<td class=list-large width=100>".formatRates($acc['cipMacHCSwitchedBytes_input_rate'] / 8)."</td>
|
||||
<td class=list-large width=100>".formatRates($acc['cipMacHCSwitchedBytes_output_rate'] / 8)."</td>
|
||||
</tr>
|
||||
</table>
|
||||
");
|
||||
|
||||
$peer_info['astext'];
|
||||
|
||||
$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("<a href='device/" . $acc['device_id'] . "/interface/" . $interface['ma_id'] . "' onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_traffic' border=0></a> ");
|
||||
echo("<a href='device/" . $acc['device_id'] . "/interface/" . $interface['ma_id'] . "' onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_traffic' border=0></a> ");
|
||||
echo("<a href='device/" . $acc['device_id'] . "/interface/" . $interface['ma_id'] . "' onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_traffic' border=0></a> ");
|
||||
echo("<a href='device/" . $acc['device_id'] . "/interface/" . $interface['ma_id'] . "' onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_traffic' border=0></a>");
|
||||
|
||||
echo("</div>");
|
||||
$i++;
|
||||
}
|
||||
echo("</div>");
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,37 +1,35 @@
|
||||
<?php
|
||||
|
||||
global $config;
|
||||
global $config;
|
||||
|
||||
if(!$graph_type) { $graph_type = "pagp_bits"; }
|
||||
if (!$graph_type) { $graph_type = "pagp_bits"; }
|
||||
|
||||
$daily_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$day&to=$now&width=215&height=100";
|
||||
$daily_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$day&to=$now&width=500&height=150";
|
||||
$daily_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$day&to=$now&width=215&height=100";
|
||||
$daily_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$day&to=$now&width=500&height=150";
|
||||
|
||||
$weekly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$week&to=$now&width=215&height=100";
|
||||
$weekly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$week&to=$now&width=500&height=150";
|
||||
$weekly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$week&to=$now&width=215&height=100";
|
||||
$weekly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$week&to=$now&width=500&height=150";
|
||||
|
||||
$monthly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$month&to=$now&width=215&height=100";
|
||||
$monthly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$month&to=$now&width=500&height=150";
|
||||
$monthly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$month&to=$now&width=215&height=100";
|
||||
$monthly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$month&to=$now&width=500&height=150";
|
||||
|
||||
$yearly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=215&height=100";
|
||||
$yearly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=500&height=150";
|
||||
$yearly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=215&height=100";
|
||||
$yearly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=500&height=150";
|
||||
|
||||
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_traffic' border=0></a> ");
|
||||
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_traffic' border=0></a> ");
|
||||
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_traffic' border=0></a> ");
|
||||
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_traffic' border=0></a>");
|
||||
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_traffic' border=0></a> ");
|
||||
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_traffic' border=0></a> ");
|
||||
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_traffic' border=0></a> ");
|
||||
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_traffic' border=0></a>");
|
||||
|
||||
$members = mysql_query("SELECT * FROM `ports` WHERE `pagpGroupIfIndex` = '".$interface['ifIndex']."' and `device_id` = '".$device['device_id']."'");
|
||||
while ($member = mysql_fetch_array($members))
|
||||
{
|
||||
echo("$br<img src='images/16/brick_link.png' align=absmiddle> <strong>" . generate_port_link($member) . " (PAgP)</strong>");
|
||||
$br = "<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<img src='images/16/brick_link.png' align=absmiddle> <strong>" . generate_port_link($member) . " (PAgP)</strong>");
|
||||
$br = "<br />";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,42 +1,44 @@
|
||||
<?php
|
||||
|
||||
if($_GET['opta'] == graphs ) {
|
||||
if($_GET['optb']) { $graph_type = "port_" . $_GET['optb']; } else { $graph_type = "port_bits"; }
|
||||
if ($_GET['opta'] == graphs )
|
||||
{
|
||||
if ($_GET['optb']) { $graph_type = "port_" . $_GET['optb']; } else { $graph_type = "port_bits"; }
|
||||
}
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/'>Basic</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/details/'>Details</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/arp/'>ARP Table</a> |
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/'>Basic</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/details/'>Details</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/arp/'>ARP Table</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/adsl/'>ADSL</a> |
|
||||
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
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/$type/'>$descr</a>
|
||||
foreach ($graph_types as $type => $descr)
|
||||
{
|
||||
echo("$type_sep
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/$type/'>$descr</a>
|
||||
(<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/$type/thumbs/'>Mini</a>) ");
|
||||
$type_sep = " | ";
|
||||
}
|
||||
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if($_GET['optc'] == thumbs) {
|
||||
|
||||
if ($_GET['optc'] == thumbs)
|
||||
{
|
||||
$timeperiods = array('-1day','-1week','-1month','-1year');
|
||||
$from = '-1day';
|
||||
echo("<div style='display: block; clear: both; margin: auto;'>");
|
||||
$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("<div style='display: block; padding: 3px; margin: 3px; min-width: 183px; max-width:183px; min-height:90px; max-height:90px; text-align: center; float: left; background-color: #e9e9e9;'>
|
||||
<div style='font-weight: bold;'>".makeshortif($interface['ifDescr'])."</div>
|
||||
<a href='device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('\
|
||||
@@ -51,32 +53,35 @@ if($_GET['optc'] == thumbs) {
|
||||
}
|
||||
echo("</div>");
|
||||
} else {
|
||||
if($_GET['opta'] == "arp" ) {
|
||||
if ($_GET['opta'] == "arp" )
|
||||
{
|
||||
include("arp.inc.php");
|
||||
} elseif($_GET['opta'] == "adsl") {
|
||||
} elseif ($_GET['opta'] == "adsl") {
|
||||
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>");
|
||||
|
||||
echo("<tr><th>Port</th><th>Traffic</th><th>Sync Speed</th><th>Attainable Speed</th><th>Attenuation</th><th>SNR Margin</th><th>Output Powers</th></tr>");
|
||||
$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("</table></div>");
|
||||
echo("<div style='min-height: 150px;'></div>");
|
||||
} else {
|
||||
if($_GET['opta'] == "details" ) { $port_details = 1; }
|
||||
if ($_GET['opta'] == "details" ) { $port_details = 1; }
|
||||
echo("<div style='margin: 0px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>");
|
||||
$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("</table></div>");
|
||||
echo("<div style='min-height: 150px;'></div>");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -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());
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,22 +1,20 @@
|
||||
<?php
|
||||
|
||||
if(mysql_result(mysql_query("select count(service_id) from services WHERE device_id = '".$device['device_id']."'"), 0) > '0') {
|
||||
|
||||
echo("<div style='margin: 5px;'><table cellpadding=7 border=0 cellspacing=0 width=100%>");
|
||||
$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("</table></div>");
|
||||
|
||||
} else {
|
||||
if (mysql_result(mysql_query("select count(service_id) from services WHERE device_id = '".$device['device_id']."'"), 0) > '0')
|
||||
{
|
||||
echo("<div style='margin: 5px;'><table cellpadding=7 border=0 cellspacing=0 width=100%>");
|
||||
$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("</table></div>");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("No Services");
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
?>
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
print_optionbar_start('25');
|
||||
print_optionbar_start('25');
|
||||
|
||||
?>
|
||||
|
||||
@@ -14,9 +14,9 @@ print_optionbar_start('25');
|
||||
<option value="">All Programs</option>
|
||||
<?php
|
||||
$query = mysql_query("SELECT `program` FROM `syslog` WHERE device_id = '" . $_GET['id'] . "' GROUP BY `program` ORDER BY `program`");
|
||||
while($data = mysql_fetch_array($query)) {
|
||||
while ($data = mysql_fetch_array($query)) {
|
||||
echo("<option value='".$data['program']."'");
|
||||
if($data['program'] == $_POST['program']) { echo("selected"); }
|
||||
if ($data['program'] == $_POST['program']) { echo("selected"); }
|
||||
echo(">".$data['program']."</option>");
|
||||
}
|
||||
?>
|
||||
@@ -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("<table cellspacing=0 cellpadding=2 width=100%>");
|
||||
while($entry = mysql_fetch_array($query)) { include("includes/print-syslog.inc"); }
|
||||
while ($entry = mysql_fetch_array($query)) { include("includes/print-syslog.inc"); }
|
||||
echo("</table>");
|
||||
|
||||
?>
|
||||
?>
|
@@ -3,22 +3,25 @@
|
||||
print_optionbar_start();
|
||||
|
||||
echo("<div style='margin: auto; text-align: left; padding: 2px 5px; padding-left: 11px; clear: both; display:block; height:20px;'>
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/'>Basic</a> | Graphs :
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/'>Basic</a> | Graphs :
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/bits/'>Bits</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/pkts/'>Packets</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/nupkts/'>NU Packets</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/pkts/'>Packets</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/nupkts/'>NU Packets</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/errors/'>Errors</a> ");
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
echo('<table border="0" cellspacing="0" cellpadding="5" width="100%">');
|
||||
|
||||
echo("<table border=0 cellspacing=0 cellpadding=5 width=100%>");
|
||||
$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("</table>");
|
||||
$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("</table>");
|
||||
|
||||
?>
|
@@ -11,14 +11,15 @@ echo("
|
||||
");
|
||||
print_optionbar_end();
|
||||
|
||||
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>");
|
||||
$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("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>");
|
||||
$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("</table></div>");
|
||||
echo("</table></div>");
|
||||
|
||||
?>
|
||||
?>
|
Reference in New Issue
Block a user