mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added discovery and polling support for brocade VDX devices. Removed an obsolete value and check for ifAlias (in definitions and ports) since VDX nowdays report correct from ifAlias. Removed printing of interface numbers for vdx devices in the interface list since VDX devices do not report the expected ifIndex value like other switches do
This commit is contained in:
@@ -38,9 +38,18 @@ else {
|
||||
|
||||
echo "<tr style=\"background-color: $row_colour;\" valign=top onmouseover=\"this.style.backgroundColor='$list_highlight';\" onmouseout=\"this.style.backgroundColor='$row_colour';\" style='cursor: pointer;'>
|
||||
<td valign=top width=350 onclick=\"location.href='".generate_port_url($port)."'\">";
|
||||
echo ' <span class=list-large>
|
||||
|
||||
// Don't echo out ports ifIndex if it's a NOS device since their ifIndex is, for lack of better words....different
|
||||
if ($device['os'] == 'nos') {
|
||||
echo ' <span class=list-large>
|
||||
'.generate_port_link($port, $port['label'])." $error_img $mac
|
||||
</span><br /><span class=interface-desc>".$port['ifAlias'].'</span>';
|
||||
}
|
||||
else {
|
||||
echo ' <span class=list-large>
|
||||
'.generate_port_link($port, $port['ifIndex'].'. '.$port['label'])." $error_img $mac
|
||||
</span><br /><span class=interface-desc>".$port['ifAlias'].'</span>';
|
||||
}
|
||||
|
||||
if ($port['ifAlias']) {
|
||||
echo '<br />';
|
||||
|
||||
@@ -452,7 +452,6 @@ $os = 'nos';
|
||||
$config['os'][$os]['text'] = 'Brocade NOS';
|
||||
$config['os'][$os]['type'] = 'network';
|
||||
$config['os'][$os]['ifname'] = 1;
|
||||
$config['os'][$os]['descr_to_alias'] = 1;
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Device Traffic';
|
||||
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
|
||||
|
||||
15
includes/discovery/mempools/nos.inc.php
Normal file
15
includes/discovery/mempools/nos.inc.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == "nos") {
|
||||
echo("nos: ");
|
||||
|
||||
$used = snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.6.0", "-Ovq");
|
||||
$total = "100";
|
||||
$free = ($total - $used);
|
||||
|
||||
$percent = $used;
|
||||
|
||||
if (is_numeric($used)) {
|
||||
discover_mempool($valid_mempool, $device, 0, "nos", "Memory", "1", NULL, NULL);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!$os) {
|
||||
if (strstr($sysObjectId, '.1.3.6.1.4.1.1588.2.2.1.1.1.5') || stristr($sysDescr, 'Brocade Communications Systems')) {
|
||||
$os = 'nos';
|
||||
if (strstr($sysDescr, "Brocade VDX")) {
|
||||
$os = "nos";
|
||||
}
|
||||
}
|
||||
|
||||
14
includes/discovery/processors/nos.inc.php
Normal file
14
includes/discovery/processors/nos.inc.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == "nos") {
|
||||
echo("nos : ");
|
||||
|
||||
$descr = "CPU";
|
||||
$usage = snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.1.0", "-Ovq");
|
||||
|
||||
if (is_numeric($usage)) {
|
||||
discover_processor($valid['processor'], $device, "1.3.6.1.4.1.1588.2.1.1.1.26.1", "0", "nos", $descr, "1", $usage, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
unset ($processors_array);
|
||||
7
includes/polling/mempools/nos.inc.php
Normal file
7
includes/polling/mempools/nos.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
// Somewhat of an uggly hack since NOS doesn't support fetching total memory of the device over SNMP
|
||||
// Given OID returns usage in percent so we set total to 100 in order to get a proper graph
|
||||
$mempool['total'] = "100";
|
||||
$mempool['used'] = snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.6.0", "-Ovq");
|
||||
$mempool['free'] = ($mempool['total'] - $mempool['used']);
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
// SNMPv2-MIB::sysDescr.0 Brocade VDX Switch.
|
||||
if (preg_match('/Brocade ([\s\d\w]+)/', $poll_device['sysDescr'], $hardware)) {
|
||||
$hardware = $hardware[1];
|
||||
}
|
||||
$version = trim(snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.1.6.0", "-Ovq"),'"');
|
||||
$hardware = trim(snmp_get($device, "ENTITY-MIB::entPhysicalDescr.1", "-Ovq"),'"');
|
||||
$serial = trim(snmp_get($device, "1.3.6.1.2.1.47.1.1.1.1.11.1", "-Ovq"),'"');
|
||||
@@ -333,7 +333,7 @@ foreach ($ports as $port) {
|
||||
echo 'VLAN == '.$this_port['ifVlan'];
|
||||
|
||||
// When devices do not provide ifAlias data, populate with ifDescr data if configured
|
||||
if (($this_port['ifAlias'] == '' || $this_port['ifAlias'] == NULL) || $config['os'][$device['os']]['descr_to_alias'] == 1) {
|
||||
if (($this_port['ifAlias'] == '' || $this_port['ifAlias'] == NULL) {
|
||||
$this_port['ifAlias'] = $this_port['ifDescr'];
|
||||
d_echo('Using ifDescr as ifAlias');
|
||||
}
|
||||
|
||||
3
includes/polling/processors/nos.inc.php
Normal file
3
includes/polling/processors/nos.inc.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$proc = trim(snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.1.0", "-Ovq"),'"');
|
||||
Reference in New Issue
Block a user