mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-30 16:14:21 +02:00
add infrastructure to collect status of cisco catalyst 6k crossbar and new state table for entity-mib
git-svn-id: http://www.observium.org/svn/observer/trunk@2723 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
echo("<table border=0 cellspacing=0 cellpadding=5 class=devicetable width=100%>
|
||||
<tr style=\"font-weight: bold; \">
|
||||
<td width=\"7\"></td>
|
||||
<td width=\"220\">Period</td>
|
||||
<td width=\"300\">Period</td>
|
||||
<td>Type</td>
|
||||
<td>Allowed</td>
|
||||
<td>Inbound</td>
|
||||
@@ -54,7 +54,7 @@
|
||||
echo("
|
||||
<tr style=\"background: $row_colour;\">
|
||||
<td></td>
|
||||
<td><span style=\"font-weight: bold;\" class=\"interface\">".strftime("%Y", strtotime($datefrom))." to ".strftime("%Y", strtotime($dateto))."</span></td>
|
||||
<td><span style=\"font-weight: bold;\" class=\"interface\">".strftime("%Y-%m-%d", strtotime($datefrom))." -> ".strftime("%Y-%m-%d", strtotime($dateto))."</span></td>
|
||||
<td>$type</td>
|
||||
<td>$allowed</td>
|
||||
<td>$in</td>
|
||||
|
||||
@@ -22,6 +22,10 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
$device = device_by_id_cache($vars['device']);
|
||||
$attribs = get_dev_attribs($device['device_id']);
|
||||
|
||||
$entity_state = get_dev_entity_state($device['device_id']);
|
||||
|
||||
# print_r($entity_state);
|
||||
|
||||
$pagetitle[] = $device['hostname'];
|
||||
|
||||
if ($config['os'][$device['os']]['group']) { $device['os_group'] = $config['os'][$device['os']]['group']; }
|
||||
|
||||
@@ -78,6 +78,7 @@ echo("<td style='width: 50%; vertical-align: top;'>");
|
||||
include("overview/processors.inc.php");
|
||||
include("overview/mempools.inc.php");
|
||||
include("overview/storage.inc.php");
|
||||
if(is_array($entity_state['group']['c6kxbar'])) { include("overview/c6kxbar.inc.php"); }
|
||||
include("overview/sensors/temperatures.inc.php");
|
||||
include("overview/sensors/humidity.inc.php");
|
||||
include("overview/sensors/fanspeeds.inc.php");
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead>");
|
||||
echo('<a class="sectionhead" href="device/device='.$device['device_id'].'/tab=health/metric=mempool/">');
|
||||
echo("<img align='absmiddle' src='images/16/arrow_switch.png'> Catalyst 6k Crossbar</a></p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
$c6kxbar_rows = '0';
|
||||
|
||||
foreach($entity_state['group']['c6kxbar'] as $index => $entry)
|
||||
{
|
||||
if (is_integer($c6kxbar_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
$entity = dbFetchRow("SELECT * FROM entPhysical WHERE device_id = ? AND entPhysicalIndex = ?", array($device['device_id'], $index));
|
||||
|
||||
echo("<tr bgcolor=$row_colour>
|
||||
<td colspan=2 width=200><strong>".$entity['entPhysicalName']."</strong></td>
|
||||
<td colspan=4>".$entry['']['cc6kxbarModuleModeSwitchingMode']."</td>
|
||||
</tr>");
|
||||
|
||||
foreach($entity_state['group']['c6kxbar'][$index] as $subindex => $fabric)
|
||||
{
|
||||
if(is_numeric($subindex)) {
|
||||
|
||||
if($fabric['cc6kxbarModuleChannelFabStatus'] == "ok")
|
||||
{
|
||||
$fabric['mode_class'] = "green";
|
||||
} else {
|
||||
$fabric['mode_class'] = "red";
|
||||
}
|
||||
|
||||
$percent_in = $fabric['cc6kxbarStatisticsInUtil'];
|
||||
$background_in = get_percentage_colours($percent_in);
|
||||
|
||||
$percent_out = $fabric['cc6kxbarStatisticsOutUtil'];
|
||||
$background_out = get_percentage_colours($percent_out);
|
||||
|
||||
|
||||
echo("<tr bgcolor=$row_colour>
|
||||
<td width=10></td>
|
||||
<td width=200><strong>Fabric ".$subindex."</strong></td>
|
||||
<td><span style='font-weight: bold;' class=".$fabric['mode_class'].">".$fabric['cc6kxbarModuleChannelFabStatus']."</span></td>
|
||||
<td>".formatRates($fabric['cc6kxbarModuleChannelSpeed']*1000000)."</td>
|
||||
<td>".print_percentage_bar (125, 20, $percent_in, "Ingress", "ffffff", $background['left'], $percent_in . "%", "ffffff", $background['right'])."</td>
|
||||
<td>".print_percentage_bar (125, 20, $percent_out, "Egress", "ffffff", $background['left'], $percent_out . "%", "ffffff", $background['right'])."</td>
|
||||
</tr>");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$c6kxbar_rows++;
|
||||
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user