Merge pull request #3074 from xbeaudouin/adx_stuff

ServerIron / ServerIron ADX support
This commit is contained in:
Tony Murray
2016-03-02 19:30:08 -06:00
8 changed files with 154 additions and 0 deletions

View File

@@ -483,6 +483,19 @@ $config['os'][$os]['over'][2]['graph'] = 'device_mempool';
$config['os'][$os]['over'][2]['text'] = 'Memory Usage'; $config['os'][$os]['over'][2]['text'] = 'Memory Usage';
$config['os'][$os]['icon'] = 'brocade'; $config['os'][$os]['icon'] = 'brocade';
// Brocade/Foundry ServerIron
$os = 'serveriron';
$config['os'][$os]['text'] = 'Brocade ServerIron';
$config['os'][$os]['type'] = 'loadbalancer';
$config['os'][$os]['ifname'] = 1;
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
$config['os'][$os]['over'][0]['text'] = 'Device Traffic';
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
$config['os'][$os]['over'][1]['text'] = 'CPU Usage';
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
$config['os'][$os]['icon'] = 'brocade';
// Cisco Small Business // Cisco Small Business
$os = 'ciscosb'; $os = 'ciscosb';
$config['os'][$os]['group'] = 'cisco'; $config['os'][$os]['group'] = 'cisco';

View File

@@ -0,0 +1,11 @@
<?php
if ($device['os'] == 'serveriron') {
echo 'ServerIron Dynamic: ';
$percent = snmp_get($device, 'snAgGblDynMemUtil.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
if (is_numeric($percent)) {
discover_mempool($valid_mempool, $device, 0, 'serveriron', 'Dynamic Memory', '1', null, null);
}
}

View File

@@ -0,0 +1,19 @@
<?php
if (!$os) {
if (preg_match('/ServerIron/', $sysDescr)) {
$os = 'serveriron';
$serviron_mibs = array (
"snL4slbTotalConnections" => "FOUNDRY-SN-SW-L4-SWITCH-GROUP-MIB", // Total connections in this device
"snL4slbLimitExceeds" => "FOUNDRY-SN-SW-L4-SWITCH-GROUP-MIB", // exceeds snL4TCPSynLimit (numbers of connection per second)
"snL4slbForwardTraffic" => "FOUNDRY-SN-SW-L4-SWITCH-GROUP-MIB", // Client->Server
"snL4slbReverseTraffic" => "FOUNDRY-SN-SW-L4-SWITCH-GROUP-MIB", // Server->Client
"snL4slbFinished" => "FOUNDRY-SN-SW-L4-SWITCH-GROUP-MIB", // FIN_or_RST
"snL4FreeSessionCount" => "FOUNDRY-SN-SW-L4-SWITCH-GROUP-MIB", // Maximum sessions - used sessions
"snL4unsuccessfulConn" => "FOUNDRY-SN-SW-L4-SWITCH-GROUP-MIB", // Unsuccessfull connection
);
register_mibs($device, $serviron_mibs, "includes/discovery/os/serveriron.inc.php");
}
}

View File

@@ -0,0 +1,39 @@
<?php
if ($device['os'] == 'serveriron') {
echo 'ServerIron : ';
$processors_array = snmpwalk_cache_triple_oid($device, 'snAgentCpuUtilEntry', $processors_array, 'FOUNDRY-SN-AGENT-MIB');
d_echo($processors_array);
foreach ($processors_array as $index => $entry) {
if (($entry['snAgentCpuUtilValue'] || $entry['snAgentCpuUtil100thPercent']) && $entry['snAgentCpuUtilInterval'] == '300') {
// $entPhysicalIndex = $entry['cpmCPUTotalPhysicalIndex'];
if ($entry['snAgentCpuUtil100thPercent']) {
$usage_oid = '.1.3.6.1.4.1.1991.1.1.2.11.1.1.6.'.$index;
$usage = $entry['snAgentCpuUtil100thPercent'];
$precision = 100;
}
else if ($entry['snAgentCpuUtilValue']) {
$usage_oid = '.1.3.6.1.4.1.1991.1.1.2.11.1.1.4.'.$index;
$usage = $entry['snAgentCpuUtilValue'];
$precision = 100;
}
list($slot, $instance, $interval) = explode('.', $index);
$descr_oid = 'snAgentConfigModuleDescription.'.$entry['snAgentCpuUtilSlotNum'];
$descr = snmp_get($device, $descr_oid, '-Oqv', 'FOUNDRY-SN-AGENT-MIB');
$descr = str_replace('"', '', $descr);
list($descr) = explode(' ', $descr);
$descr = 'Slot '.$entry['snAgentCpuUtilSlotNum'].' '.$descr;
$descr = $descr.' ['.$instance.']';
if (!strstr($descr, 'No') && !strstr($usage, 'No') && $descr != '') {
discover_processor($valid['processor'], $device, $usage_oid, $index, 'serveriron', $descr, $precision, $usage, $entPhysicalIndex, null);
}
}//end if
}//end foreach
}//end if
unset($processors_array);

View File

@@ -0,0 +1,26 @@
<?php
if ($device['os'] == 'serveriron') {
echo 'ServerIron States';
// All those states are : (Value: 1 Other, 2 Normal, 3 failure) (Power Supply and Fans)
// Power Supplies
for ($i=1; $i != 3; $i++) {
$power_oid = 'FOUNDRY-SN-AGENT-MIB::snChasPwrSupplyOperStatus.'.$i;
$power_status = snmp_get($device, $power_oid, '-Oqv','FOUNDRY-SN-AGENT-MIB');
if(!empty($power_status)) {
discover_sensor($valid['sensor'], 'state', $device, $power_oid, 'powerstatus'.$i, 'snmp', 'Power Supply '.$i.' Status', '1', '1', '1', null, null, '3', $power_status);
}
}
// Fan status
for ($i=1; $i != 7; $i++) {
$fan_oid = 'FOUNDRY-SN-AGENT-MIB::snChasFanOperStatus.'.$i;
$fan_status = snmp_get($device, $fan_oid, '-Oqv','FOUNDRY-SN-AGENT-MIB');
if(!empty($fan_status)) {
discover_sensor($valid['sensor'], 'state', $device, $fan_oid, 'fanstatus'.$i, 'snmp', 'Fan '.$i.' Status', '1', '1', '1', null, null, '3', $fan_status);
}
}
}//end if

View File

@@ -0,0 +1,33 @@
<?php
if ($device['os'] == 'serveriron') {
echo(" FOUNDRY-SN-AGENT-MIB");
// Chassis temperature (default)
$high_limit = 110;
$high_warn_limit = 95;
$descr = "Chassis Temperature";
$oid = "1.3.6.1.4.1.1991.1.1.1.1.18.0"; // snChasActualTemperature
$warn_oid = "1.3.6.1.4.1.1991.1.1.1.1.19.0"; // snChasWarningTemperature
$high_oid = "1.3.6.1.4.1.1991.1.1.1.1.20.0"; // snChasShutdownTemperature
$value = snmp_get($device, $oid, '-Oqv');
$value_warn = snmp_get($device, $warn_oid, '-Oqv');
if (is_numeric($value_warn)) {
$high_warn_limit = ($value_warn / 2);
}
$value_high = snmp_get($device, $high_oid, '-Oqv');
if (is_numeric($value_high)) {
$high_limit = ($value_high / 2);
}
if (is_numeric($value)) {
$current = ($value / 2);
discover_sensor($valid['sensor'], 'temperature', $device, $oid, 1, 'serveriron-temp', $descr, '2', '1', null, null, $high_warn_limit, $high_limit, $current);
}
}
// EOF

View File

@@ -0,0 +1,7 @@
<?php
// Simple hard-coded poller for Brocade Ironware Dynamic Memory (old style)
// Yes, it really can be this simple.
$mempool['total'] = snmp_get($device, 'snAgGblDynMemTotal.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
$mempool['free'] = snmp_get($device, 'snAgGblDynMemFree.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
$mempool['used'] = ($mempool['total'] - $mempool['free']);

View File

@@ -0,0 +1,6 @@
<?php
$version = trim(snmp_get($device, ".1.3.6.1.4.1.1991.1.1.2.1.11.0", "-Ovq"),'"');
$hardware = trim(snmp_get($device, ".1.3.6.1.4.1.1991.1.1.2.2.1.1.2.1", "-Ovq"),'"');
$serial = trim(snmp_get($device, ".1.3.6.1.4.1.1991.1.1.1.1.2.0", "-Ovq"),'"');