Merge pull request #1357 from laf/issue-1328

Added basic detection for Mellanox devices
This commit is contained in:
Daniel Preussker
2015-07-15 21:26:52 +02:00
7 changed files with 31 additions and 4 deletions

BIN
html/images/os/mellanox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -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';

View File

@@ -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']));

View File

@@ -0,0 +1,7 @@
<?php
if (!$os) {
if (strstr($sysObjectId, ".33049.1.1.1.")) {
$os = "mellanox";
}
}

View File

@@ -1,7 +1,7 @@
<?php
if (!$os) {
if (strstr($sysDescr, 'NX-OS')) {
if (strstr($sysDescr, 'NX-OS(tm)')) {
$os = 'nxos';
}
}

View File

@@ -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 {

View 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);
}