add avaya ers support

git-svn-id: http://www.observium.org/svn/observer/trunk@2854 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-01-27 11:29:37 +00:00
parent be6a81f193
commit dcf48ae16d
8 changed files with 151 additions and 0 deletions

BIN
html/images/os/avaya.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

View File

@@ -0,0 +1,29 @@
<?php
$OID = ".1.3.6.1.4.1.45.1.6.3.8.1.1.12";
if ($device['os'] == "avaya-ers")
# Memory information only known to work with 5500 and 5600 switches
if (preg_match("/5[56][0-9][0-9]/", $device["sysDescr"])) {
{
# Get major version number of running firmware
$fw_major_version = Null;
preg_match("/[0-9]\.[0-9]/", $device['version'], $fw_major_version);
$fw_major_version = $fw_major_version[0];
# Temperature info only known to be present in firmware 6.1 or higher
if ($fw_major_version >= 6.1) {
$mem = snmp_walk($device, $OID, "-Osqn");
echo "$mem\n";
foreach (explode("\n", $mem) as $i => $t) {
$t = explode(" ",$t);
$oid = str_replace($OID, "", $t[0]);
discover_mempool($valid_mempool, $device, $oid, "avaya-ers", "Unit " . ($i+1) . " memory", "1", NULL, NULL);
}
}
}
}
?>

View File

@@ -0,0 +1,9 @@
<?php
if (!$os)
{
if (strstr($sysDescr, "Ethernet Routing Switch")) { $os = "avaya-ers"; }
else if (strstr($sysDescr, "ERS-")) { $os = "avaya-ers"; }
}
?>

View File

@@ -0,0 +1,18 @@
<?php
if ($device['os'] == "avaya-ers")
# Processor information only know to work with 5500 and 5600 switches
if (preg_match("/5[56][0-9][0-9]/", $device["sysDescr"])) {
{
$procs = snmp_walk($device, ".1.3.6.1.4.1.45.1.6.3.8.1.1.6", "-Osqn");
foreach (explode("\n", $procs) as $i => $t) {
$t = explode(" ",$t);
$oid = $t[0];
$val = $t[1];
discover_processor($valid['processor'], $device, $oid, zeropad($i+1), "avaya-ers", "Unit " . ($i+1) . " processor", "1", $val, $i, NULL);
}
}
}
?>

View File

@@ -0,0 +1,25 @@
<?php
if ($device['os'] == "avaya-ers")
{
# Get major version number of running firmware
$fw_major_version = Null;
preg_match("/[0-9]\.[0-9]/", $device['version'], $fw_major_version);
$fw_major_version = $fw_major_version[0];
# Temperature info only known to be present in firmware 6.1 or higher
if ($fw_major_version >= 6.1) {
$temps = snmp_walk($device, "1.3.6.1.4.1.45.1.6.3.7.1.1.5.5", "-Osqn");
foreach (explode("\n", $temps) as $i => $t) {
$t = explode(" ",$t);
$oid = $t[0];
$val = $t[1];
# Sensors are reported as 2 * value
$val = trim($val) / 2;
discover_sensor($valid['sensor'], 'temperature', $device, $oid, zeropad($i+1), 'avaya-ers', "Unit " . ($i+1) . " temperature", '2', '1', NULL, NULL, NULL, NULL, $val);
}
}
}
?>

View File

@@ -0,0 +1,19 @@
<?php
if ($device['os'] == "avaya-ers")
# Memory information only known to work with 5500 and 5600 switches
if (preg_match("/5[56][0-9][0-9]/", $device["sysDescr"])) {
{
$index = $mempool['mempool_index'];
$total = snmp_get($device, ".1.3.6.1.4.1.45.1.6.3.8.1.1.12$index", "-Oqv") * 1048576;
$avail = snmp_get($device, ".1.3.6.1.4.1.45.1.6.3.8.1.1.13$index", "-Oqv") * 1048576;
$mempool['total'] = $total;
$mempool['free'] = $avail;
$mempool['used'] = $total - $avail;
}
}
?>

View File

@@ -0,0 +1,44 @@
<?php
echo("Doing Nortel/Avaya ERS ");
$sysObjectID = snmp_get($device, "sysObjectID.0", "-Oqvn");
# 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 = snmp_get($device, "SNMPv2-MIB::sysDescr.0", "-Oqvn");
$details = explode(" ", $sysDescr);
$details = str_replace("ERS-", "Ethernet Routing Switch ", $details);
$hardware = explode(" (", $details[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);
?>

View File

@@ -408,6 +408,13 @@ $config['os'][$os]['over'][1]['text'] = "CPU Usage";
$config['os'][$os]['over'][2]['graph'] = "device_mempool";
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
$os = "avaya-ers";
$config['os'][$os]['text'] = "ERS Firmware";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['icon'] = "avaya";
$config['os'][$os]['over'][0]['graph'] = "device_bits";
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
$os = "arista_eos";
$config['os'][$os]['text'] = "Arista EOS";
$config['os'][$os]['type'] = "network";