Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

device: Improve Allied Telesis Chassis product support #8139

Merged
merged 22 commits into from Mar 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
eb3f31b
device: Improve Allied Telesis Chassis product support
mattie47 Jan 23, 2018
4e4e611
device: Update awplus to use snmp_get_multi_oid
mattie47 Jan 25, 2018
cf2d597
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Jan 25, 2018
690221c
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Feb 12, 2018
c391b06
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Feb 12, 2018
7003034
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Feb 12, 2018
6234949
update awplus device support
mattie47 Feb 13, 2018
a8f2936
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Feb 15, 2018
e551c34
device: Fix awplus snmptranslate logic error
mattie47 Feb 15, 2018
227ee48
device: awplus chassis support improvements
mattie47 Feb 28, 2018
6cff76c
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Feb 28, 2018
5be0caf
device: update awplus test data
mattie47 Feb 28, 2018
83ac798
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Mar 2, 2018
e21e52e
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Mar 3, 2018
a8483b7
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Mar 4, 2018
9a1d105
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Mar 6, 2018
e1656f6
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Mar 9, 2018
68c2599
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Mar 10, 2018
14f443a
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Mar 12, 2018
f9ec756
Merge branch 'master' of https://github.com/librenms/librenms into pa…
mattie47 Mar 13, 2018
793d1e7
device: fix awplus serial number info
mattie47 Mar 13, 2018
07f90cf
device: fix awplus test data
mattie47 Mar 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 20 additions & 5 deletions includes/polling/os/awplus.inc.php
Expand Up @@ -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'];
}
}
10 changes: 5 additions & 5 deletions tests/data/awplus.json
Expand Up @@ -9711,7 +9711,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,
Expand All @@ -9729,16 +9729,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"
}
]
Expand Down
16 changes: 15 additions & 1 deletion tests/snmpsim/awplus.snmprec
@@ -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>
Expand Down Expand Up @@ -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