device: Improve Allied Telesis Chassis product support (#8139)

* device: Improve Allied Telesis Chassis product support

Fix - Wrong Serial number was displayed
Enhancement - Show the type of Controller card in chassis

Controller card can be either CFC400, or CFC960.

Tests:
- Checked Chassis x8106, and x8112
- Checked with CFC400 and CFC960
-- Checked behaviour with/without CFC in bay 1.5

* device: Update awplus to use snmp_get_multi_oid

* update awplus device support

* device: Fix awplus snmptranslate logic error

* device: awplus chassis support improvements

* device: update awplus test data

* device: fix awplus serial number info

* device: fix awplus test data
This commit is contained in:
mattie47 2018-03-15 22:52:29 +13:00 committed by Neil Lathwood
parent 2c83056663
commit 0491e2edd0
3 changed files with 40 additions and 11 deletions

View File

@ -3,13 +3,28 @@
//$hardware and $serial use snmp_getnext as the OID for these is not always fixed.
//However, the first OID is the device baseboard.
$hardware = snmp_getnext($device, "rscBoardName", "-OQv", "AT-RESOURCE-MIB");
$data = snmp_getnext_multi($device, 'rscBoardName rscBoardSerialNumber', '-OQs', 'AT-RESOURCE-MIB');
$hardware = $data['rscBoardName'];
$serial = $data['rscBoardSerialNumber'];
$version = snmp_get($device, "currSoftVersion.0", "-OQv", "AT-SETUP-MIB");
$hostname = snmp_get($device, "sysName.0", "-OQv", "SNMPv2-MIB");
$serial = snmp_getnext($device, "rscBoardSerialNumber", "-OQv", "AT-RESOURCE-MIB");
// SBx8100 platform has line cards show up first in "rscBoardName" above.
//Instead use sysObjectID.0
if (strpos($hardware, 'SBx81') !== false) {
$hardware = snmp_get($device, "sysObjectID.0", "-OQvs", "SNMPv2-MIB:AT-PRODUCT-MIB");
$hardware = str_replace('at', '', $hardware);
$data_array = snmpwalk_cache_multi_oid($device, 'rscBoardName', $data_array, 'AT-RESOURCE-MIB', '-OUsb');
$data_array = snmpwalk_cache_multi_oid($device, 'rscBoardSerialNumber', $data_array, 'AT-RESOURCE-MIB', '-OUsb');
$hardware = snmp_translate($device['sysObjectID'], 'AT-PRODUCT-MIB', null, null, $device);
$hardware = str_replace('at', 'AT-', $hardware);
// Features and Serial is set to Controller card 1.5
$features = $data_array['5.6']['rscBoardName'];
$serial = $data_array['5.6']['rscBoardSerialNumber'];
// If bay 1.5 is empty, set to Controller card 1.6
if (!$features && !$serial) {
$features = $data_array['6.6']['rscBoardName'];
$serial = $data_array['6.6']['rscBoardSerialNumber'];
}
}

View File

@ -9704,7 +9704,7 @@
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.207.1.14.137",
"sysObjectID": ".1.3.6.1.4.1.207.1.14.114",
"sysDescr": "Allied Telesis router/switch, AW+ v5.4.7-2.1",
"sysContact": null,
"version": null,
@ -9722,16 +9722,16 @@
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.207.1.14.137",
"sysObjectID": ".1.3.6.1.4.1.207.1.14.114",
"sysDescr": "Allied Telesis router/switch, AW+ v5.4.7-2.1",
"sysContact": "<private>",
"version": "5.4.7-2.1",
"hardware": "AT-SBx908 GEN2",
"features": null,
"hardware": "AT-SBx8106",
"features": "AT-SBx81CFC960",
"location": "<private>",
"os": "awplus",
"type": "network",
"serial": "A12345678900000",
"serial": "A04699H130900048",
"icon": "alliedtelesis.svg"
}
]

View File

@ -1,5 +1,5 @@
1.3.6.1.2.1.1.1.0|4|Allied Telesis router/switch, AW+ v5.4.7-2.1
1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.207.1.14.137
1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.207.1.14.114
1.3.6.1.2.1.1.3.0|67|17317200
1.3.6.1.2.1.1.4.0|4|<private>
1.3.6.1.2.1.1.5.0|4|<private>
@ -2429,7 +2429,21 @@
1.3.6.1.4.1.207.8.4.4.3.12.4.2.1.7.2.1.2|2|1
1.3.6.1.4.1.207.8.4.4.3.12.4.2.1.7.2.1.3|2|2
1.3.6.1.4.1.207.8.4.4.3.12.4.2.1.7.2.1.4|2|2
1.3.6.1.4.1.207.8.4.4.3.21.1.1.4.1.1|4|AT-SBx81GP24
1.3.6.1.4.1.207.8.4.4.3.21.1.1.4.1.3|4|AT-SBx908 GEN2
1.3.6.1.4.1.207.8.4.4.3.21.1.1.4.1.5|4|AT-SBx908 GEN2
1.3.6.1.4.1.207.8.4.4.3.21.1.1.4.5.6|4|AT-SBx81CFC960
1.3.6.1.4.1.207.8.4.4.3.21.1.1.4.5.7|4|AT-SBx8112
1.3.6.1.4.1.207.8.4.4.3.21.1.1.4.5.10|4|AT-SBxPWRSYS1/AC
1.3.6.1.4.1.207.8.4.4.3.21.1.1.4.5.11|4|AT-SBxFAN12
1.3.6.1.4.1.207.8.4.4.3.21.1.1.4.6.6|4|AT-SBx81CFC960
1.3.6.1.4.1.207.8.4.4.3.21.1.1.8.1.1|4|A1XQD500P
1.3.6.1.4.1.207.8.4.4.3.21.1.1.8.1.3|4|A12345678900000
1.3.6.1.4.1.207.8.4.4.3.21.1.1.8.1.5|4|A10064A172100016
1.3.6.1.4.1.207.8.4.4.3.21.1.1.8.5.6|4|A04699H130900048
1.3.6.1.4.1.207.8.4.4.3.21.1.1.8.5.7|4|A042764102400007
1.3.6.1.4.1.207.8.4.4.3.21.1.1.8.5.10|4|A045804134300032
1.3.6.1.4.1.207.8.4.4.3.21.1.1.8.5.11|4|A042844102400016
1.3.6.1.4.1.207.8.4.4.3.21.1.1.8.6.6|4|A270F900C
1.3.6.1.4.1.207.8.4.4.4.500.2.1.1.0|4|5.4.7-2.1
1.3.6.1.6.3.10.2.1.3.0|2|173123