mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #1357 from laf/issue-1328
Added basic detection for Mellanox devices
This commit is contained in:
BIN
html/images/os/mellanox.png
Normal file
BIN
html/images/os/mellanox.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@@ -601,6 +601,16 @@ $config['os'][$os]['over'][1]['text'] = 'CPU Usage';
|
||||
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
|
||||
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
|
||||
|
||||
$os = 'mellanox';
|
||||
$config['os'][$os]['text'] = 'Mellanox';
|
||||
$config['os'][$os]['type'] = 'network';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Device Traffic';
|
||||
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
|
||||
$config['os'][$os]['over'][1]['text'] = 'CPU Usage';
|
||||
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
|
||||
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
|
||||
|
||||
$os = 'netscaler';
|
||||
$config['os'][$os]['text'] = 'Citrix Netscaler';
|
||||
$config['os'][$os]['type'] = 'loadbalancer';
|
||||
|
@@ -158,7 +158,7 @@ if ($config['enable_bgp']) {
|
||||
if (!isset($j_peerIndexes)) {
|
||||
$j_bgp = snmpwalk_cache_multi_oid($device, 'jnxBgpM2PeerTable', $jbgp, 'BGP4-V2-MIB-JUNIPER', $config['install_dir'].'/mibs/junos');
|
||||
|
||||
foreach ($j_bgp as $index => $entry) n{
|
||||
foreach ($j_bgp as $index => $entry) {
|
||||
switch ($entry['jnxBgpM2PeerRemoteAddrType']) {
|
||||
case 'ipv4':
|
||||
$ip = long2ip(hexdec($entry['jnxBgpM2PeerRemoteAddr']));
|
||||
|
7
includes/discovery/os/mellanox.inc.php
Normal file
7
includes/discovery/os/mellanox.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!$os) {
|
||||
if (strstr($sysObjectId, ".33049.1.1.1.")) {
|
||||
$os = "mellanox";
|
||||
}
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!$os) {
|
||||
if (strstr($sysDescr, 'NX-OS')) {
|
||||
if (strstr($sysDescr, 'NX-OS(tm)')) {
|
||||
$os = 'nxos';
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
# Sorry about the OIDs but there doesn't seem to be a matching MIB available... :-/
|
||||
if(!empty(snmp_get($device, "1.3.6.1.4.1.14125.100.1.8.0", "-OQv"))) {
|
||||
$response = snmp_get($device, "1.3.6.1.4.1.14125.100.1.8.0", "-OQv");
|
||||
if(!empty($response)) {
|
||||
$version = "Kernel " . trim(snmp_get($device, "1.3.6.1.4.1.14125.100.1.8.0", "-OQv"),'" ');
|
||||
$version .= " / Apps " . trim(snmp_get($device, "1.3.6.1.4.1.14125.100.1.9.0", "-OQv"),'" ');
|
||||
}
|
||||
@@ -11,7 +12,8 @@ else {
|
||||
$serial = trim(snmp_get($device, "1.3.6.1.4.1.14125.100.1.7.0", "-OQv"),'" ');
|
||||
|
||||
# There doesn't seem to be a real hardware identification.. sysName will have to do?
|
||||
if(!empty(snmp_get($device, "1.3.6.1.4.1.14125.100.1.6.0", "-OQv"))) {
|
||||
$hw_response = snmp_get($device, "1.3.6.1.4.1.14125.100.1.6.0", "-OQv");
|
||||
if(!empty($hw_response)) {
|
||||
$hardware = str_replace("EnGenius ","",snmp_get($device,"sysName.0", "-OQv")) . " v" . trim(snmp_get($device, "1.3.6.1.4.1.14125.100.1.6.0", "-OQv"),'" .');
|
||||
}
|
||||
else {
|
||||
|
8
includes/polling/os/mellanox.inc.php
Normal file
8
includes/polling/os/mellanox.inc.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
if (stristr($poll_device['sysDescr'], "Linux")) {
|
||||
list(,,$version,$hardware) = explode(' ', $poll_device['sysDescr']);
|
||||
} else {
|
||||
list($hardware,,$version) = explode(',',$poll_device['sysDescr']);
|
||||
$hardware = preg_replace("/Mellanox /","", $hardware);
|
||||
}
|
Reference in New Issue
Block a user