mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: detect more devices as Comware (#6386)
* newdevice: improve comware detection Only some H3C Comware devices were detected as comware, detect them all. * Update the test data FYI, C1234 was just a nonsense string
This commit is contained in:
committed by
Neil Lathwood
parent
d44d23dba6
commit
e005f78211
@@ -5,6 +5,4 @@ icon: hpe
|
|||||||
over:
|
over:
|
||||||
- { graph: device_bits, text: Traffic }
|
- { graph: device_bits, text: Traffic }
|
||||||
discovery:
|
discovery:
|
||||||
- sysObjectId: .1.3.6.1.4.1.25506.11.1
|
- sysObjectId: .1.3.6.1.4.1.25506.
|
||||||
- sysDescr: Comware
|
|
||||||
- sysDescr_regex: '/HP [a-zA-Z0-9- ]+ Switch Software Version/'
|
|
||||||
|
@@ -319,7 +319,13 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
|
|||||||
log_event('Sensor Warn Low Limit Updated: ' . mres($class) . ' ' . mres($type) . ' ' . mres($index) . ' ' . mres($descr) . ' (' . $low_warn_limit . ')', $device, 'sensor', 3, $sensor_id);
|
log_event('Sensor Warn Low Limit Updated: ' . mres($class) . ' ' . mres($type) . ' ' . mres($index) . ' ' . mres($descr) . ' (' . $low_warn_limit . ')', $device, 'sensor', 3, $sensor_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($oid == $sensor_entry['sensor_oid'] && $descr == $sensor_entry['sensor_descr'] && $multiplier == $sensor_entry['sensor_multiplier'] && $divisor == $sensor_entry['sensor_divisor'] && $entPhysicalIndex_measured == $sensor_entry['entPhysicalIndex_measured'] && $entPhysicalIndex == $sensor_entry['entPhysicalIndex']) {
|
if ($oid == $sensor_entry['sensor_oid'] &&
|
||||||
|
$descr == $sensor_entry['sensor_descr'] &&
|
||||||
|
$multiplier == $sensor_entry['sensor_multiplier'] &&
|
||||||
|
$divisor == $sensor_entry['sensor_divisor'] &&
|
||||||
|
$entPhysicalIndex_measured == $sensor_entry['entPhysicalIndex_measured'] &&
|
||||||
|
$entPhysicalIndex == $sensor_entry['entPhysicalIndex']
|
||||||
|
) {
|
||||||
echo '.';
|
echo '.';
|
||||||
} else {
|
} else {
|
||||||
$update = array(
|
$update = array(
|
||||||
|
@@ -21,7 +21,24 @@ if (!empty($entphydata)) {
|
|||||||
foreach ($tempdata as $tempindex => $value) {
|
foreach ($tempdata as $tempindex => $value) {
|
||||||
if ($index['entPhysicalIndex'] == $tempindex && $value['hh3cEntityExtTemperature'] != 65535) {
|
if ($index['entPhysicalIndex'] == $tempindex && $value['hh3cEntityExtTemperature'] != 65535) {
|
||||||
$cur_oid = '.1.3.6.1.4.1.25506.2.6.1.1.1.1.12.';
|
$cur_oid = '.1.3.6.1.4.1.25506.2.6.1.1.1.1.12.';
|
||||||
discover_sensor($valid['sensor'], 'temperature', $device, $cur_oid . $tempindex, 'temp-' . $tempindex, 'comware', $index['entPhysicalName'], '1', '1', null, null, null, null, $value['hh3cEntityExtTemperature'], 'snmp', $index);
|
discover_sensor(
|
||||||
|
$valid['sensor'],
|
||||||
|
'temperature',
|
||||||
|
$device,
|
||||||
|
$cur_oid . $tempindex,
|
||||||
|
'temp-' . $tempindex,
|
||||||
|
'comware',
|
||||||
|
$index['entPhysicalName'],
|
||||||
|
'1',
|
||||||
|
'1',
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
$value['hh3cEntityExtTemperature'],
|
||||||
|
'snmp',
|
||||||
|
$index
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -467,7 +467,7 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$this->checkOS('comware');
|
$this->checkOS('comware');
|
||||||
$this->checkOS('comware', 'comware1');
|
$this->checkOS('comware', 'comware1');
|
||||||
$this->checkOS('comware', 'comware-hp-c1234');
|
$this->checkOS('comware', 'comware-h3c');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCoriant()
|
public function testCoriant()
|
||||||
|
2
tests/snmpsim/comware-h3c.snmprec
Normal file
2
tests/snmpsim/comware-h3c.snmprec
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1.3.6.1.2.1.1.1.0|4|HP V1910-48G Switch Software Version 5.20 Release 1111P01
|
||||||
|
1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.25506.11.1.85
|
@@ -1 +0,0 @@
|
|||||||
1.3.6.1.2.1.1.1.0|4|HP C1234 Switch Software Version
|
|
@@ -1,2 +1,2 @@
|
|||||||
1.3.6.1.2.1.1.1.0|4|HPE V1910-24G Switch Software Version 5.20, Release 1516 Copyright(c) 2010-2015 Hewlett-Packard Development Company, L.P.
|
1.3.6.1.2.1.1.1.0|4|Hangzhou H3C Comware Platform Software, Software Version 3.10, Release 2211P06
|
||||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.25506.11.1.82
|
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.25506.1.244
|
||||||
|
Reference in New Issue
Block a user