mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Boss hardware is a very long string by default for sysDescr. I want to convert these long strings to "ERS-" and "VSP-". root@cox-home-dashboard:~# snmpwalk -v2c -c public 192.168.1.6 .1.3.6.1.2.1.1.1 iso.3.6.1.2.1.1.1.0 = STRING: "Ethernet Routing Switch 4850GTS-PWR+ HW:14 FW:5.8.0.3 SW:v5.11.1.013 BN:13 (c) Avaya Networks" root@cox-home-dashboard:~# snmpwalk -v2c -c public 192.168.1.9 .1.3.6.1.2.1.1.1 iso.3.6.1.2.1.1.1.0 = STRING: "Ethernet Routing Switch 3510GT-PWR+ HW:17 FW:5.3.0.8 SW:v5.3.6.015 BN:15 (c) Extreme Networks"
43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
|
|
echo 'Doing Extreme/Avaya/Nortel ERS ';
|
|
|
|
// Try multiple ways of getting firmware version
|
|
$version = snmp_get($device, 'SNMPv2-SMI::enterprises.2272.1.1.7.0', '-Oqvn');
|
|
$version = explode(' on', $version);
|
|
$version = $version[0];
|
|
|
|
if ($version == '') {
|
|
$version = snmp_get($device, 'SNMPv2-SMI::enterprises.45.1.6.4.2.1.10.0', '-Oqvn');
|
|
if ($version == '') {
|
|
$version = 'Unknown Version';
|
|
}
|
|
}
|
|
|
|
// Get hardware details
|
|
$sysDescr = $device['sysDescr'];
|
|
|
|
$details = explode(' ', $sysDescr);
|
|
$details = str_replace('ERS-', 'Ethernet Routing Switch ', $details);
|
|
|
|
$hardware = explode(' (', $details[0]);
|
|
|
|
// Make boss devices hardware string compact
|
|
$hardware[0] = str_replace('Ethernet Routing Switch ', 'ERS-', $hardware[0]);
|
|
$hardware[0] = str_replace('Virtual Services Platform ', 'VSP-', $hardware[0]);
|
|
$hardware = $hardware[0];
|
|
|
|
// Is this a 5500 series or 5600 series stack?
|
|
$features = '';
|
|
|
|
$stack = snmp_walk($device, 'SNMPv2-SMI::enterprises.45.1.6.3.3.1.1.6.8', '-OsqnU');
|
|
$stack = explode("\n", $stack);
|
|
$stack_size = count($stack);
|
|
if ($stack_size > 1) {
|
|
$features = "Stack of $stack_size units";
|
|
}
|
|
|
|
$version = str_replace('"', '', $version);
|
|
$features = str_replace('"', '', $features);
|
|
$hardware = str_replace('"', '', $hardware);
|