2016-10-13 17:12:37 -04:00
|
|
|
<?php
|
|
|
|
|
|
2017-02-03 12:39:38 +00:00
|
|
|
// Power Status OID (Value : 0 Bad, 1 Good, 2 NotPresent)
|
2019-03-04 17:31:17 +00:00
|
|
|
// Common States - F5 Power supply and FanSpeed State
|
|
|
|
|
$states = [
|
|
|
|
|
['value' => 0, 'generic' => 2, 'graph' => 0, 'descr' => 'Bad'],
|
|
|
|
|
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Good'],
|
|
|
|
|
['value' => 2, 'generic' => 3, 'graph' => 0, 'descr' => 'NotPresent'],
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$temp = snmpwalk_cache_multi_oid($device, 'sysChassisPowerSupplyTable', [], 'F5-BIGIP-SYSTEM-MIB');
|
2017-02-03 12:39:38 +00:00
|
|
|
if (is_array($temp)) {
|
|
|
|
|
echo 'F5 power supply: ';
|
|
|
|
|
//Create State Index
|
|
|
|
|
$state_name = 'sysChassisPowerSupplyStatus';
|
2019-03-04 17:31:17 +00:00
|
|
|
create_state_index($state_name, $states);
|
2017-02-03 12:39:38 +00:00
|
|
|
|
|
|
|
|
foreach ($temp as $index => $data) {
|
|
|
|
|
$descr = "sysChassisPowerSupplyStatus.".$temp[$index]['sysChassisPowerSupplyIndex'];
|
|
|
|
|
$current = $data['sysChassisPowerSupplyStatus'];
|
|
|
|
|
$sensorType = 'f5';
|
|
|
|
|
$oid = '.1.3.6.1.4.1.3375.2.1.3.2.2.2.1.2.'.$index;
|
2019-03-04 17:31:17 +00:00
|
|
|
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $current, 'snmp', $index);
|
|
|
|
|
|
|
|
|
|
//Create Sensor To State Index
|
|
|
|
|
create_sensor_to_state_index($device, $state_name, $index);
|
|
|
|
|
} // End foreach (array_keys($temp) as $index)
|
|
|
|
|
} // End if (is_array($temp))
|
|
|
|
|
|
|
|
|
|
$temp = snmpwalk_cache_multi_oid($device, 'sysChassisFanStatus', [], 'F5-BIGIP-SYSTEM-MIB');
|
|
|
|
|
if (is_array($temp)) {
|
|
|
|
|
echo 'F5 FanSpeed State: ';
|
|
|
|
|
//Create State Index
|
|
|
|
|
$state_name = 'sysChassisFanStatus';
|
|
|
|
|
create_state_index($state_name, $states);
|
|
|
|
|
foreach (array_keys($temp) as $index) {
|
|
|
|
|
$descr = "Fan Speed Status ".$index;
|
|
|
|
|
$current = $temp[$index]['sysChassisFanStatus'];
|
|
|
|
|
$sensorType = 'f5';
|
|
|
|
|
$oid = '.1.3.6.1.4.1.3375.2.1.3.2.1.2.1.2.'.$index;
|
|
|
|
|
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $current, 'snmp', $index);
|
2017-02-03 12:39:38 +00:00
|
|
|
|
|
|
|
|
//Create Sensor To State Index
|
|
|
|
|
create_sensor_to_state_index($device, $state_name, $index);
|
|
|
|
|
} // End foreach (array_keys($temp) as $index)
|
|
|
|
|
} // End if (is_array($temp))
|
|
|
|
|
|
|
|
|
|
|
2019-03-04 17:31:17 +00:00
|
|
|
$temp = snmpwalk_cache_multi_oid($device, 'sysCmFailoverStatus', [], 'F5-BIGIP-SYSTEM-MIB');
|
|
|
|
|
|
|
|
|
|
if (is_array($temp)) {
|
2017-02-03 12:39:38 +00:00
|
|
|
echo 'F5 FailOver State: ';
|
|
|
|
|
//Create State Index
|
|
|
|
|
$state_name = 'sysCmFailoverStatusId';
|
2019-03-04 17:31:17 +00:00
|
|
|
$states = [
|
|
|
|
|
['value' => 0, 'generic' => 3, 'graph' => 0, 'descr' => 'Unknown'],
|
|
|
|
|
['value' => 1, 'generic' => 2, 'graph' => 0, 'descr' => 'OffLine'],
|
|
|
|
|
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'ForcedOffline'],
|
|
|
|
|
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'Standby'],
|
|
|
|
|
['value' => 4, 'generic' => 0, 'graph' => 0, 'descr' => 'Active'],
|
|
|
|
|
];
|
|
|
|
|
create_state_index($state_name, $states);
|
|
|
|
|
|
|
|
|
|
foreach (array_keys($temp) as $index) {
|
|
|
|
|
$descr = "sysCmFailoverStatusId.".$temp[$index]['sysCmFailoverStatusId'];
|
|
|
|
|
$current = $temp[$index]['sysCmFailoverStatusId'];
|
2017-02-03 12:39:38 +00:00
|
|
|
$sensorType = 'f5';
|
|
|
|
|
$oid = '.1.3.6.1.4.1.3375.2.1.14.3.1.'.$index;
|
2019-03-04 17:31:17 +00:00
|
|
|
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $current, 'snmp', $index);
|
2017-02-03 12:39:38 +00:00
|
|
|
|
|
|
|
|
//Create Sensor To State Index
|
|
|
|
|
create_sensor_to_state_index($device, $state_name, $index);
|
2019-03-04 17:31:17 +00:00
|
|
|
} // End foreach (array_keys($temp) as $index)
|
|
|
|
|
} // End if (is_array($temp))
|
2017-02-03 12:39:38 +00:00
|
|
|
|
2019-03-04 17:31:17 +00:00
|
|
|
$temp = snmpwalk_cache_multi_oid($device, 'sysCmSyncStatusId', [], 'F5-BIGIP-SYSTEM-MIB');
|
2017-05-19 22:54:58 +02:00
|
|
|
|
2019-03-04 17:31:17 +00:00
|
|
|
if (is_array($temp)) {
|
2017-05-19 22:54:58 +02:00
|
|
|
echo 'F5 Sync State: ';
|
|
|
|
|
//Create State Index
|
|
|
|
|
$state_name = 'sysCmSyncStatusId';
|
2019-03-04 17:31:17 +00:00
|
|
|
$states = [
|
|
|
|
|
['value' => 0, 'generic' => 3, 'graph' => 0, 'descr' => 'unknown'],
|
|
|
|
|
['value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'syncing'],
|
|
|
|
|
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'needManualSync'],
|
|
|
|
|
['value' => 3, 'generic' => 0, 'graph' => 0, 'descr' => 'inSync'],
|
|
|
|
|
['value' => 4, 'generic' => 1, 'graph' => 0, 'descr' => 'syncFailed'],
|
|
|
|
|
['value' => 5, 'generic' => 2, 'graph' => 0, 'descr' => 'syncDisconnected'],
|
|
|
|
|
['value' => 6, 'generic' => 0, 'graph' => 0, 'descr' => 'standalone'],
|
|
|
|
|
['value' => 7, 'generic' => 1, 'graph' => 0, 'descr' => 'awaitingInitialSync'],
|
|
|
|
|
['value' => 8, 'generic' => 2, 'graph' => 0, 'descr' => 'incompatibleVersion'],
|
|
|
|
|
['value' => 9, 'generic' => 2, 'graph' => 0, 'descr' => 'partialSync'],
|
|
|
|
|
];
|
|
|
|
|
create_state_index($state_name, $states);
|
|
|
|
|
|
|
|
|
|
foreach (array_keys($temp) as $index) {
|
2017-05-19 22:54:58 +02:00
|
|
|
$descr = "sysCmSyncStatusId.".$index;
|
2019-03-04 17:31:17 +00:00
|
|
|
$current = $temp[$index]['sysCmSyncStatusId'];
|
2017-05-19 22:54:58 +02:00
|
|
|
$sensorType = 'f5';
|
|
|
|
|
$oid = '.1.3.6.1.4.1.3375.2.1.14.1.1.'.$index;
|
2019-03-04 17:31:17 +00:00
|
|
|
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $current, 'snmp', $index);
|
2017-05-19 22:54:58 +02:00
|
|
|
|
|
|
|
|
//Create Sensor To State Index
|
|
|
|
|
create_sensor_to_state_index($device, $state_name, $index);
|
2019-03-04 17:31:17 +00:00
|
|
|
} // End foreach (array_keys($temp) as $index)
|
|
|
|
|
} // End if (is_array($temp))
|
2017-02-03 12:39:38 +00:00
|
|
|
|
2019-03-04 17:31:17 +00:00
|
|
|
$temp = snmpwalk_cache_multi_oid($device, 'sysCmFailoverStatusColor', [], 'F5-BIGIP-SYSTEM-MIB');
|
2017-02-03 12:39:38 +00:00
|
|
|
|
2019-03-04 17:31:17 +00:00
|
|
|
if (is_array($temp)) {
|
2017-02-03 12:39:38 +00:00
|
|
|
echo 'F5 FailOver State Color: ';
|
|
|
|
|
//Create State Index
|
|
|
|
|
$state_name = 'sysCmFailoverStatusColor';
|
2019-03-04 17:31:17 +00:00
|
|
|
$states = [
|
|
|
|
|
['value' => 0, 'generic' => 0, 'graph' => 0, 'descr' => 'Green: functioning correctly'],
|
|
|
|
|
['value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'Yellow: functioning suboptimally'],
|
|
|
|
|
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'Red: requires attention to function correctly'],
|
|
|
|
|
['value' => 3, 'generic' => 3, 'graph' => 0, 'descr' => 'Blue: status is unknown'],
|
|
|
|
|
['value' => 4, 'generic' => 0, 'graph' => 0, 'descr' => 'Gray: intentionally not functioning'],
|
|
|
|
|
['value' => 5, 'generic' => 2, 'graph' => 0, 'descr' => 'Black: not connected to any peers'],
|
|
|
|
|
];
|
|
|
|
|
create_state_index($state_name, $states);
|
|
|
|
|
|
|
|
|
|
foreach (array_keys($temp) as $index) {
|
2017-02-03 12:39:38 +00:00
|
|
|
$descr = "sysCmFailoverStatusColor.".$index;
|
2019-03-04 17:31:17 +00:00
|
|
|
$current = $temp[$index]['sysCmFailoverStatusColor'];
|
2017-02-03 12:39:38 +00:00
|
|
|
$sensorType = 'f5';
|
|
|
|
|
$oid = '.1.3.6.1.4.1.3375.2.1.14.3.3.'.$index;
|
2019-03-04 17:31:17 +00:00
|
|
|
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $current, 'snmp', $index);
|
2017-02-03 12:39:38 +00:00
|
|
|
|
|
|
|
|
//Create Sensor To State Index
|
|
|
|
|
create_sensor_to_state_index($device, $state_name, $index);
|
2019-03-04 17:31:17 +00:00
|
|
|
} // End foreach (array_keys($temp) as $index)
|
|
|
|
|
} // End if (is_array($temp))
|