Files

43 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2012-01-27 11:29:37 +00:00
<?php
echo 'Doing Extreme/Avaya/Nortel ERS ';
2012-01-27 11:29:37 +00:00
// Try multiple ways of getting firmware version
$version = snmp_get($device, 'SNMPv2-SMI::enterprises.2272.1.1.7.0', '-Oqvn');
$version = explode(' on', $version);
2012-01-27 11:29:37 +00:00
$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';
}
2012-01-27 11:29:37 +00:00
}
// Get hardware details
$sysDescr = $device['sysDescr'];
2012-01-27 11:29:37 +00:00
$details = explode(' ', $sysDescr);
$details = str_replace('ERS-', 'Ethernet Routing Switch ', $details);
2012-01-27 11:29:37 +00:00
$hardware = explode(' (', $details[0]);
2018-04-22 09:03:53 -05:00
// 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]);
2012-01-27 11:29:37 +00:00
$hardware = $hardware[0];
// Is this a 5500 series or 5600 series stack?
$features = '';
2012-01-27 11:29:37 +00:00
$stack = snmp_walk($device, 'SNMPv2-SMI::enterprises.45.1.6.3.3.1.1.6.8', '-OsqnU');
$stack = explode("\n", $stack);
2012-01-27 11:29:37 +00:00
$stack_size = count($stack);
if ($stack_size > 1) {
$features = "Stack of $stack_size units";
2012-01-27 11:29:37 +00:00
}
$version = str_replace('"', '', $version);
$features = str_replace('"', '', $features);
$hardware = str_replace('"', '', $hardware);