mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Advanced state sensors (#9881)
* refactor: advanced sensor states mark create_state_index($state_name) as E_USER_DEPRECATED? * fix: minor corrections * fix: mib has partialSync(9) and incompatibleVersion(8) * fix: corrected netagent2upsstate - Sleeping(5) * fix: NetAgent2 upsThreePhaseUPSStatusInverterOperating correction * refactor: array() be gone * Refactoring includes/discovery/sensors/state/extendair.inc.php with arrays And tidying up array formatting in other files * fix: minor typo * standardising array item names removed redundant "if ($state_index_id !== null) {" * workaround: procurve & serverscheck a sensor is causing create_state_index($state) to return null. The updated code doesn't allow for this and thus a hybrid is being used. * standardised naming of state info. Caused a typo $state_name instead of $status_name $state_name is the standard * converted compas to square arrays * Converted APC states using preg_match to new create_state_index() call * Update boss.inc.php
This commit is contained in:
@@ -121,14 +121,14 @@ $oids = snmpwalk_group($device, 'ciscoEnvMonSupplyStatusTable', 'CISCO-ENVMON-MI
|
||||
if (!empty($oids)) {
|
||||
//Create State Index
|
||||
$state_name = 'ciscoEnvMonSupplyState';
|
||||
$states = array(
|
||||
array('value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'normal'),
|
||||
array('value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'warning'),
|
||||
array('value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'critical'),
|
||||
array('value' => 4, 'generic' => 3, 'graph' => 0, 'descr' => 'shutdown'),
|
||||
array('value' => 5, 'generic' => 3, 'graph' => 0, 'descr' => 'notPresent'),
|
||||
array('value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'notFunctioning'),
|
||||
);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'normal'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'warning'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'critical'],
|
||||
['value' => 4, 'generic' => 3, 'graph' => 0, 'descr' => 'shutdown'],
|
||||
['value' => 5, 'generic' => 3, 'graph' => 0, 'descr' => 'notPresent'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'notFunctioning'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$num_oid = '.1.3.6.1.4.1.9.9.13.1.5.1.3.';
|
||||
|
@@ -18,7 +18,7 @@ foreach ($pre_cache['junos_ifotn_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['jnxoptIfOTNPMCurrentFECBERMantissa'])) {
|
||||
$index = substr_replace($index, '', -2);
|
||||
$oid = '.1.3.6.1.4.1.2636.3.73.1.3.3.8.1.5.'.$index.'.1';
|
||||
$interface = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id']));
|
||||
$interface = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]);
|
||||
$descr = $interface . ' preFEC BER';
|
||||
|
||||
$limit_low = null;
|
||||
|
@@ -19,7 +19,7 @@ if (!empty($oids)) {
|
||||
$warnlimit = 10;
|
||||
$descr = 'Battery Charge';
|
||||
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $current_oid, $index, $sensorType, $descr, $precision, '1', $lowlimit, $warnlimit, null, $limit, $current_val);
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $current_oid, $index, $sensorType, $descr, $precision, 1, $lowlimit, $warnlimit, null, $limit, $current_val);
|
||||
} else {
|
||||
// Try to just get capacity
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.2.2.1.0', '-OsqnU');
|
||||
@@ -40,6 +40,6 @@ if (!empty($oids)) {
|
||||
$warnlimit = 10;
|
||||
$descr = 'Battery Charge';
|
||||
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $current_oid, $index, $sensorType, $descr, $precision, '1', $lowlimit, $warnlimit, null, $limit, $current_val);
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $current_oid, $index, $sensorType, $descr, $precision, 1, $lowlimit, $warnlimit, null, $limit, $current_val);
|
||||
}
|
||||
}//end if
|
||||
|
@@ -25,5 +25,5 @@ $ups_device_model = str_replace('"', '', snmp_get($device, $ups_device_model
|
||||
$ups_charge_oid = '.1.3.6.1.4.1.6574.4.3.1.1.0';
|
||||
$ups_charge = snmp_get($device, $ups_charge_oid, '-Oqv');
|
||||
if (is_numeric($ups_charge)) {
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $ups_charge_oid, 'UPSChargeValue', $ups_device_manufacturer.' '.$ups_device_model, 'UPS Charge Value', '1', '1', 0, 10, null, 100, $ups_charge);
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $ups_charge_oid, 'UPSChargeValue', $ups_device_manufacturer.' '.$ups_device_model, 'UPS Charge Value', 1, 1, 0, 10, null, 100, $ups_charge);
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ if (preg_match("/(Linux).+(ntc)/", $device['sysDescr'])) {
|
||||
$index = '116.8';
|
||||
$value = snmp_get($device, $oid.$index, '-Oqv');
|
||||
if (is_numeric($value)) {
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $oid.$index, $index, $sensor_type, $descr, '1', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $oid.$index, $index, $sensor_type, $descr, 1, 1, $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,12 +3,12 @@
|
||||
if ($device['os_group'] == 'cisco') {
|
||||
echo ' CISCO-ENTITY-SENSOR: ';
|
||||
|
||||
$oids = array();
|
||||
$oids = [];
|
||||
echo 'Caching OIDs:';
|
||||
|
||||
if (empty($entity_array)) {
|
||||
$tmp_oids = array('entPhysicalDescr', 'entPhysicalName', 'entPhysicalClass', 'entPhysicalContainedIn', 'entPhysicalParentRelPos');
|
||||
$entity_array = array();
|
||||
$tmp_oids = ['entPhysicalDescr', 'entPhysicalName', 'entPhysicalClass', 'entPhysicalContainedIn', 'entPhysicalParentRelPos'];
|
||||
$entity_array = [];
|
||||
foreach ($tmp_oids as $tmp_oid) {
|
||||
echo " $tmp_oid";
|
||||
$entity_array = snmpwalk_cache_multi_oid($device, $tmp_oid, $entity_array, 'ENTITY-MIB:CISCO-ENTITY-SENSOR-MIB');
|
||||
@@ -28,7 +28,7 @@ if ($device['os_group'] == 'cisco') {
|
||||
echo ' entSensorPrecision';
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'entSensorPrecision', $oids, 'CISCO-ENTITY-SENSOR-MIB');
|
||||
|
||||
$t_oids = array();
|
||||
$t_oids = [];
|
||||
echo ' entSensorThresholdSeverity';
|
||||
$t_oids = snmpwalk_cache_twopart_oid($device, 'entSensorThresholdSeverity', $t_oids, 'CISCO-ENTITY-SENSOR-MIB');
|
||||
echo ' entSensorThresholdRelation';
|
||||
|
@@ -21,12 +21,12 @@
|
||||
// ******************************************
|
||||
|
||||
// Define Sensors and Limits
|
||||
$sensors_adva = array
|
||||
(
|
||||
array(
|
||||
'sensor_name' => 'psuOutputCurrent',
|
||||
'sensor_oid' => '.1.3.6.1.4.1.2544.1.12.3.1.4.1.8')
|
||||
);
|
||||
$sensors_adva = [
|
||||
[
|
||||
'sensor_name' => 'psuOutputCurrent',
|
||||
'sensor_oid' => '.1.3.6.1.4.1.2544.1.12.3.1.4.1.8'
|
||||
]
|
||||
];
|
||||
|
||||
$multiplier = 1;
|
||||
$divisor = 1000;
|
||||
|
@@ -18,10 +18,10 @@ $divisor_alarm = 1000000;
|
||||
foreach ($pre_cache['comware_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['hh3cTransceiverBiasCurrent']) && $entry['hh3cTransceiverBiasCurrent'] != 2147483647 && isset($entry['hh3cTransceiverDiagnostic'])) {
|
||||
$oid = '.1.3.6.1.4.1.25506.2.70.1.1.1.17.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", [
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
]);
|
||||
$limit_low = $entry['hh3cTransceiverBiasLoAlarm'] / $divisor_alarm;
|
||||
$warn_limit_low = $entry['hh3cTransceiverBiasLoWarn'] / $divisor_alarm;
|
||||
$limit = $entry['hh3cTransceiverBiasHiAlarm'] / $divisor_alarm;
|
||||
|
@@ -11,5 +11,5 @@ if ($oids) {
|
||||
$type = 'digipower';
|
||||
$descr = 'Input';
|
||||
$current=$current/10;
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, '0', $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 0, $type, $descr, $divisor, 1, null, null, null, null, $current);
|
||||
}
|
||||
|
@@ -10,8 +10,8 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$data = snmpwalk_cache_multi_oid($device, 'outletCurrent', array(), 'EATON-EPDU-MIB');
|
||||
$descr = snmpwalk_cache_multi_oid($device, 'outletName', array(), 'EATON-EPDU-MIB');
|
||||
$data = snmpwalk_cache_multi_oid($device, 'outletCurrent', [], 'EATON-EPDU-MIB');
|
||||
$descr = snmpwalk_cache_multi_oid($device, 'outletName', [], 'EATON-EPDU-MIB');
|
||||
if (is_array($data)) {
|
||||
$cur_oid = '.1.3.6.1.4.1.534.6.6.7.6.4.1.3.';
|
||||
foreach ($data as $index => $entry) {
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
echo 'XUPS-MIB ';
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsBatCurrent', array(), 'XUPS-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsBatCurrent', [], 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $current_id => $data) {
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.2.3.$current_id";
|
||||
@@ -15,7 +15,7 @@ foreach ($oids as $current_id => $data) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsOutputCurrent', array(), 'XUPS-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsOutputCurrent', [], 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $current_id => $data) {
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.4.4.1.3.$current_id";
|
||||
@@ -31,7 +31,7 @@ foreach ($oids as $current_id => $data) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsInputCurrent', array(), 'XUPS-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsInputCurrent', [], 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $current_id => $data) {
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.3.4.1.3.$current_id";
|
||||
|
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
// Output Current
|
||||
$oids = snmpwalk_cache_oid($device, 'outputEntry', array(), 'ICT-DISTRIBUTION-PANEL-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'outputEntry', [], 'ICT-DISTRIBUTION-PANEL-MIB');
|
||||
|
||||
foreach ($oids as $index => $entry) {
|
||||
$output_number = (int)$entry['outputNumber'] + 1;
|
||||
|
@@ -2,8 +2,8 @@
|
||||
|
||||
echo ' IPOMANII-MIB ';
|
||||
|
||||
$oids_in = array();
|
||||
$oids_out = array();
|
||||
$oids_in = [];
|
||||
$oids_out = [];
|
||||
|
||||
d_echo('inletConfigCurrentHigh ');
|
||||
$oids_in = snmpwalk_cache_multi_oid($device, 'inletConfigCurrentHigh', $oids_in, 'IPOMANII-MIB');
|
||||
|
@@ -17,7 +17,7 @@ $divisor = 1000000;
|
||||
foreach ($pre_cache['junos_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['jnxDomCurrentTxLaserBiasCurrent']) && $entry['jnxDomCurrentTxLaserBiasCurrent'] != 0 && $entry['jnxDomCurrentTxLaserBiasCurrentLowAlarmThreshold'] != 0) {
|
||||
$oid = '.1.3.6.1.4.1.2636.3.60.1.1.1.1.6.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Current';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Tx Current';
|
||||
$limit_low = $entry['jnxDomCurrentTxLaserBiasCurrentLowAlarmThreshold'] / $divisor;
|
||||
$warn_limit_low = $entry['jnxDomCurrentTxLaserBiasCurrentLowWarningThreshold'] / $divisor;
|
||||
$limit = $entry['jnxDomCurrentTxLaserBiasCurrentHighAlarmThreshold'] / $divisor;
|
||||
|
@@ -16,7 +16,7 @@ $divisor = 1000000;
|
||||
foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['curr']) && ($entry['curr'] !== '-65535')) {
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.6.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Current';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Current';
|
||||
$limit_low = 8000/$divisor;
|
||||
$warn_limit_low = 8500/$divisor;
|
||||
$limit = 15000/$divisor;
|
||||
|
@@ -5,10 +5,7 @@ $divisor_alarm = 1000000;
|
||||
foreach ($pre_cache['procurve_hpicfXcvrInfoTable'] as $index => $entry) {
|
||||
if (is_numeric($entry['hpicfXcvrBias']) && $entry['hpicfXcvrBias'] != 0) {
|
||||
$oid = '.1.3.6.1.4.1.11.2.14.11.5.1.82.1.1.1.1.13.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", [$index, $device['device_id']]);
|
||||
$limit_low = $entry['hpicfXcvrBiasLoAlarm'] / $divisor_alarm;
|
||||
$warn_limit_low = $entry['hpicfXcvrBiasLoWarn'] / $divisor_alarm;
|
||||
$limit = $entry['hpicfXcvrBiasHiAlarm'] / $divisor_alarm;
|
||||
|
@@ -36,7 +36,7 @@ if (!empty($battery_current) || $battery_current == 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $battery_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.3', array());
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.3', []);
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
@@ -54,7 +54,7 @@ foreach ($oids as $oid => $data) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.3.3.1.4', array());
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.3.3.1.4', []);
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
@@ -23,32 +23,32 @@
|
||||
* @author Neil Lathwood <gh+n@laf.io>
|
||||
*/
|
||||
|
||||
$tpdin_oids = array(
|
||||
array(
|
||||
$tpdin_oids = [
|
||||
[
|
||||
'oid' => '.1.3.6.1.4.1.45621.2.2.9.0',
|
||||
'index' => 'current1',
|
||||
'descr' => 'Current 1',
|
||||
'current' => $pre_cache['tpdin_monitor'][0]['current1'],
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'oid' => '.1.3.6.1.4.1.45621.2.2.10.0',
|
||||
'index' => 'current2',
|
||||
'descr' => 'Current 2',
|
||||
'current' => $pre_cache['tpdin_monitor'][0]['current2'],
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'oid' => '.1.3.6.1.4.1.45621.2.2.11.0',
|
||||
'index' => 'current3',
|
||||
'descr' => 'Current 3',
|
||||
'current' => $pre_cache['tpdin_monitor'][0]['current3'],
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'oid' => '.1.3.6.1.4.1.45621.2.2.12.0',
|
||||
'index' => 'current4',
|
||||
'descr' => 'Current 4',
|
||||
'current' => $pre_cache['tpdin_monitor'][0]['current4'],
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($tpdin_oids as $data) {
|
||||
if ($data['current'] > 0) {
|
||||
|
@@ -17,10 +17,7 @@ $divisor = 100;
|
||||
foreach ($pre_cache['comware_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['hh3cTransceiverCurRXPower']) && $entry['hh3cTransceiverCurRXPower'] != 2147483647 && isset($entry['hh3cTransceiverDiagnostic'])) {
|
||||
$oid = '.1.3.6.1.4.1.25506.2.70.1.1.1.12.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", [$index, $device['device_id']]);
|
||||
$limit_low = round(uw_to_dbm($entry['hh3cTransceiverRcvPwrLoAlarm'] / 10), 2);
|
||||
$warn_limit_low = round(uw_to_dbm($entry['hh3cTransceiverRcvPwrLoWarn'] / 10), 2);
|
||||
$limit = round(uw_to_dbm($entry['hh3cTransceiverRcvPwrHiAlarm'] / 10), 2);
|
||||
@@ -36,10 +33,7 @@ foreach ($pre_cache['comware_oids'] as $index => $entry) {
|
||||
|
||||
if (is_numeric($entry['hh3cTransceiverCurTXPower']) && $entry['hh3cTransceiverCurTXPower'] != 2147483647 && isset($entry['hh3cTransceiverDiagnostic'])) {
|
||||
$oid = '.1.3.6.1.4.1.25506.2.70.1.1.1.9.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", [$index, $device['device_id']]);
|
||||
$limit_low = round(uw_to_dbm($entry['hh3cTransceiverPwrOutLoAlarm'] / 10), 2);
|
||||
$warn_limit_low = round(uw_to_dbm($entry['hh3cTransceiverPwrOutLoWarn'] / 10), 2);
|
||||
$limit = round(uw_to_dbm($entry['hh3cTransceiverPwrOutHiAlarm'] / 10), 2);
|
||||
|
@@ -7,7 +7,7 @@ $divisor = 100;
|
||||
foreach ($pre_cache['datacom_oids'] as $index => $entry) {
|
||||
if (is_numeric(str_replace('dBm', '', $entry['ddTransceiversRxPower']))) {
|
||||
$oid = '.1.3.6.1.4.1.3709.3.5.201.1.28.1.1.4.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Rx Power';
|
||||
/* Basic default values */
|
||||
$limit_low = -30;
|
||||
$warn_limit_low = -12.3;
|
||||
@@ -21,7 +21,7 @@ foreach ($pre_cache['datacom_oids'] as $index => $entry) {
|
||||
|
||||
if (is_numeric(str_replace('dBm', '', $entry['ddTransceiversTxPower']))) {
|
||||
$oid = '.1.3.6.1.4.1.3709.3.5.201.1.28.1.1.5.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Tx Power';
|
||||
/* Basic default values */
|
||||
$limit_low = -30;
|
||||
$warn_limit_low = -12.3;
|
||||
|
@@ -22,7 +22,7 @@ foreach ($pre_cache['ironware_optic_oids'] as $index => $entry) {
|
||||
if (strpos($entry['snIfOpticalMonitoringRxPower'], 'N\/A') !== true) {
|
||||
return_num($entry);
|
||||
$oid = '.1.3.6.1.4.1.1991.1.1.3.3.6.1.3.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Rx Power';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'dbm',
|
||||
@@ -47,7 +47,7 @@ foreach ($pre_cache['ironware_optic_oids'] as $index => $entry) {
|
||||
if (strpos($entry['snIfOpticalMonitoringTxPower'], 'N\/A') !== true) {
|
||||
return_num($entry);
|
||||
$oid = '.1.3.6.1.4.1.1991.1.1.3.3.6.1.2.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Tx Power';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'dbm',
|
||||
|
@@ -17,7 +17,7 @@ $divisor = 100;
|
||||
foreach ($pre_cache['junos_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['jnxDomCurrentRxLaserPower']) && $entry['jnxDomCurrentRxLaserPower'] != 0 && $entry['jnxDomCurrentTxLaserOutputPower'] != 0) {
|
||||
$oid = '.1.3.6.1.4.1.2636.3.60.1.1.1.1.5.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Rx Power';
|
||||
$limit_low = $entry['jnxDomCurrentRxLaserPowerLowAlarmThreshold']/$divisor;
|
||||
$warn_limit_low = $entry['jnxDomCurrentRxLaserPowerLowWarningThreshold']/$divisor;
|
||||
$limit = $entry['jnxDomCurrentRxLaserPowerHighAlarmThreshold']/$divisor;
|
||||
@@ -30,7 +30,7 @@ foreach ($pre_cache['junos_oids'] as $index => $entry) {
|
||||
|
||||
if (is_numeric($entry['jnxDomCurrentTxLaserOutputPower']) && $entry['jnxDomCurrentTxLaserOutputPower'] && $entry['jnxDomCurrentRxLaserPower']) {
|
||||
$oid = '.1.3.6.1.4.1.2636.3.60.1.1.1.1.7.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Tx Power';
|
||||
$limit_low = $entry['jnxDomCurrentTxLaserOutputPowerLowAlarmThreshold']/$divisor;
|
||||
$warn_limit_low = $entry['jnxDomCurrentTxLaserOutputPowerLowWarningThreshold']/$divisor;
|
||||
$limit = $entry['jnxDomCurrentTxLaserOutputPowerHighAlarmThreshold']/$divisor;
|
||||
@@ -45,7 +45,7 @@ foreach ($pre_cache['junos_oids'] as $index => $entry) {
|
||||
$lane = $pre_cache['junos_multilane_oids'][$index.'.'.$x];
|
||||
if (is_numeric($lane['jnxDomCurrentLaneRxLaserPower']) && $lane['jnxDomCurrentLaneRxLaserPower'] != 0 && $lane['jnxDomCurrentLaneTxLaserOutputPower'] != 0) {
|
||||
$oid = '.1.3.6.1.4.1.2636.3.60.1.2.1.1.6.'.$index.'.'.$x;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' lane ' . $x . ' Rx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' lane ' . $x . ' Rx Power';
|
||||
$limit_low = $entry['jnxDomCurrentRxLaserPowerLowAlarmThreshold']/$divisor;
|
||||
$warn_limit_low = $entry['jnxDomCurrentRxLaserPowerLowWarningThreshold']/$divisor;
|
||||
$limit = $entry['jnxDomCurrentRxLaserPowerHighAlarmThreshold']/$divisor;
|
||||
@@ -57,7 +57,7 @@ foreach ($pre_cache['junos_oids'] as $index => $entry) {
|
||||
}
|
||||
if (is_numeric($lane['jnxDomCurrentLaneTxLaserOutputPower']) && $lane['jnxDomCurrentLaneTxLaserOutputPower'] && $lane['jnxDomCurrentLaneRxLaserPower']) {
|
||||
$oid = '.1.3.6.1.4.1.2636.3.60.1.2.1.1.8.'.$index.'.'.$x;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' lane ' . $x . ' Tx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' lane ' . $x . ' Tx Power';
|
||||
$limit_low = $entry['jnxDomCurrentTxLaserOutputPowerLowAlarmThreshold']/$divisor;
|
||||
$warn_limit_low = $entry['jnxDomCurrentTxLaserOutputPowerLowWarningThreshold']/$divisor;
|
||||
$limit = $entry['jnxDomCurrentTxLaserOutputPowerHighAlarmThreshold']/$divisor;
|
||||
|
@@ -20,7 +20,7 @@ $divisor = 1000;
|
||||
foreach ($pre_cache['mrv-od_port-table'] as $index => $entry) {
|
||||
if ($entry['nbsCmmcPortRxPower']) {
|
||||
$oid = '.1.3.6.1.4.1.629.200.8.1.1.32.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifName`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifName`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Rx Power';
|
||||
$currentrx = $entry['nbsCmmcPortRxPower'];
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
@@ -43,7 +43,7 @@ foreach ($pre_cache['mrv-od_port-table'] as $index => $entry) {
|
||||
|
||||
if ($entry['nbsCmmcPortTxPower']) {
|
||||
$oid = '.1.3.6.1.4.1.629.200.8.1.1.31.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifName`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifName`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Tx Power';
|
||||
$currenttx = $entry['nbsCmmcPortTxPower'];
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
|
@@ -16,7 +16,7 @@ $divisor = 1;
|
||||
foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['rxPower']) && ($entry['rxPower'] !== '-65535')) {
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.3.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Rx Power';
|
||||
$limit_low = -30/$divisor;
|
||||
$warn_limit_low = -25/$divisor;
|
||||
$limit = -2/$divisor;
|
||||
@@ -29,7 +29,7 @@ foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
|
||||
if (is_numeric($entry['txPower']) && ($entry['txPower'] !== '-65535')) {
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.2.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power';
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Tx Power';
|
||||
$limit_low = -30/$divisor;
|
||||
$warn_limit_low = -25/$divisor;
|
||||
$limit = -2/$divisor;
|
||||
|
@@ -6,10 +6,7 @@ $divisor = 1000;
|
||||
foreach ($pre_cache['procurve_hpicfXcvrInfoTable'] as $index => $entry) {
|
||||
if (is_numeric($entry['hpicfXcvrRxPower']) && $entry['hpicfXcvrRxPower'] != -99999999 && isset($entry['hpicfXcvrDiagnosticsUpdate'])) {
|
||||
$oid = '.1.3.6.1.4.1.11.2.14.11.5.1.82.1.1.1.1.15.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", [$index, $device['device_id']]);
|
||||
$limit_low = round(uw_to_dbm($entry['hpicfXcvrRcvPwrLoAlarm'] / 10), 2);
|
||||
$warn_limit_low = round(uw_to_dbm($entry['hpicfXcvrRcvPwrLoWarn'] / 10), 2);
|
||||
$limit = round(uw_to_dbm($entry['hpicfXcvrRcvPwrHiAlarm'] / 10), 2);
|
||||
@@ -25,10 +22,7 @@ foreach ($pre_cache['procurve_hpicfXcvrInfoTable'] as $index => $entry) {
|
||||
|
||||
if (is_numeric($entry['hpicfXcvrTxPower']) && $entry['hpicfXcvrTxPower'] != -99999999 && isset($entry['hpicfXcvrDiagnosticsUpdate'])) {
|
||||
$oid = '.1.3.6.1.4.1.11.2.14.11.5.1.82.1.1.1.1.14.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", [$index, $device['device_id']]);
|
||||
$limit_low = round(uw_to_dbm($entry['hpicfXcvrPwrOutLoAlarm'] / 10), 2);
|
||||
$warn_limit_low = round(uw_to_dbm($entry['hpicfXcvrPwrOutLoWarn'] / 10), 2);
|
||||
$limit = round(uw_to_dbm($entry['hpicfXcvrPwrOutHiAlarm'] / 10), 2);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
echo ' ENTITY-SENSOR: ';
|
||||
echo 'Caching OIDs:';
|
||||
if (empty($entity_array)) {
|
||||
$entity_array = array();
|
||||
$entity_array = [];
|
||||
echo ' entPhysicalDescr';
|
||||
$entity_array = snmpwalk_cache_multi_oid($device, 'entPhysicalDescr', $entity_array, 'ENTITY-MIB');
|
||||
if (!empty($entity_array)) {
|
||||
@@ -28,7 +28,7 @@ if (!empty($entity_array)) {
|
||||
}
|
||||
|
||||
if (!empty($entity_oids)) {
|
||||
$entitysensor = array(
|
||||
$entitysensor = [
|
||||
'voltsDC' => 'voltage',
|
||||
'voltsAC' => 'voltage',
|
||||
'amperes' => 'current',
|
||||
@@ -38,7 +38,7 @@ if (!empty($entity_oids)) {
|
||||
'rpm' => 'fanspeed',
|
||||
'celsius' => 'temperature',
|
||||
'dBm' => 'dbm',
|
||||
);
|
||||
];
|
||||
|
||||
foreach ($entity_oids as $index => $entry) {
|
||||
$low_limit = null;
|
||||
@@ -47,7 +47,7 @@ if (!empty($entity_oids)) {
|
||||
$high_limit = null;
|
||||
|
||||
// Fix for Cisco ASR920, 15.5(2)S
|
||||
if ($entry['entPhySensorType'] == 'other' && str_contains($entity_array[$index]['entPhysicalName'], array('Rx Power Sensor', 'Tx Power Sensor'))) {
|
||||
if ($entry['entPhySensorType'] == 'other' && str_contains($entity_array[$index]['entPhysicalName'], ['Rx Power Sensor', 'Tx Power Sensor'])) {
|
||||
$entitysensor['other'] = 'dbm';
|
||||
}
|
||||
if ($entitysensor[$entry['entPhySensorType']] && is_numeric($entry['entPhySensorValue']) && is_numeric($index)) {
|
||||
@@ -138,7 +138,7 @@ if (!empty($entity_oids)) {
|
||||
if ($entry['entPhySensorOperStatus'] === 'unavailable') {
|
||||
$valid_sensor = false;
|
||||
}
|
||||
if ($valid_sensor && dbFetchCell("SELECT COUNT(*) FROM `sensors` WHERE device_id = ? AND `sensor_class` = ? AND `sensor_type` = 'cisco-entity-sensor' AND `sensor_index` = ?", array($device['device_id'], $type, $index)) == '0') {
|
||||
if ($valid_sensor && dbFetchCell("SELECT COUNT(*) FROM `sensors` WHERE device_id = ? AND `sensor_class` = ? AND `sensor_type` = 'cisco-entity-sensor' AND `sensor_index` = ?", [$device['device_id'], $type, $index]) == '0') {
|
||||
// Check to make sure we've not already seen this sensor via cisco's entity sensor mib
|
||||
if ($type == "power" && $device['os'] == "arista_eos" && preg_match("/DOM (R|T)x Power/i", $descr)) {
|
||||
$type = "dbm";
|
||||
|
@@ -10,7 +10,7 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'coolingDeviceTable', array(), 'MIB-Dell-10892');
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'coolingDeviceTable', [], 'MIB-Dell-10892');
|
||||
$cur_oid = '.1.3.6.1.4.1.674.10892.1.700.12.1.6.';
|
||||
|
||||
if (is_array($temp)) {
|
||||
|
@@ -11,12 +11,12 @@
|
||||
*/
|
||||
|
||||
$descr_prefix = 'Blower ';
|
||||
$oids = array(
|
||||
$oids = [
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.20.0', // BLADE-MIB:blower1speedRPM
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.21.0', // BLADE-MIB:blower2speedRPM
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.22.0', // BLADE-MIB:blower3speedRPM
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.23.0', // BLADE-MIB:blower4speedRPM
|
||||
);
|
||||
];
|
||||
|
||||
echo 'BLADE-MIB ';
|
||||
foreach ($oids as $index => $oid) {
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
echo 'Netonix: ';
|
||||
// NETONIX-SWITCH-MIB::fanTable .1.3.6.1.4.1.46242.2
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'fanTable', array(), 'NETONIX-SWITCH-MIB', 'netonix');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'fanTable', [], 'NETONIX-SWITCH-MIB', 'netonix');
|
||||
if (is_array($oids)) {
|
||||
foreach ($oids as $index => $entry) {
|
||||
if (is_numeric($entry['fanSpeed']) && is_numeric($index)) {
|
||||
|
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
echo 'OneFS: ';
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'fanTable', array(), 'ISILON-MIB');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'fanTable', [], 'ISILON-MIB');
|
||||
|
||||
foreach ($oids as $index => $entry) {
|
||||
if (is_numeric($entry['fanSpeed']) && is_numeric($index)) {
|
||||
|
@@ -15,8 +15,8 @@ echo 'QNAP: ';
|
||||
$fan_descr_oid = '.1.3.6.1.4.1.24681.1.2.15.1.2';
|
||||
$fan_speed_oid = '.1.3.6.1.4.1.24681.1.2.15.1.3';
|
||||
|
||||
$fans_descr = snmpwalk_cache_numerical_oid($device, $fan_descr_oid, array(), null, null, '-OQUsn');
|
||||
$fans_speed = snmpwalk_cache_numerical_oid($device, $fan_speed_oid, array(), null, null, '-OQUsn');
|
||||
$fans_descr = snmpwalk_cache_numerical_oid($device, $fan_descr_oid, [], null, null, '-OQUsn');
|
||||
$fans_speed = snmpwalk_cache_numerical_oid($device, $fan_speed_oid, [], null, null, '-OQUsn');
|
||||
|
||||
if (is_array($fans_speed) && !empty($fans_speed)) {
|
||||
foreach ($fans_speed as $index => $entry) {
|
||||
|
@@ -14,7 +14,7 @@ d_echo('Quanta Fan Speeds');
|
||||
$sensor_type = 'quanta_fan';
|
||||
//FASTPATH-BOXSERVICES-PRIVATE-MIB::boxServicesFanSpeed
|
||||
$sensors_id_oid = 'boxServicesFanSpeed';
|
||||
$sensors_values = snmpwalk_cache_multi_oid($device, $sensors_id_oid, array(), 'NETGEAR-BOXSERVICES-PRIVATE-MIB');
|
||||
$sensors_values = snmpwalk_cache_multi_oid($device, $sensors_id_oid, [], 'NETGEAR-BOXSERVICES-PRIVATE-MIB');
|
||||
$numeric_oid_base = '.1.3.6.1.4.1.4413.1.1.43.1.6.1.4';
|
||||
|
||||
foreach ($sensors_values as $index => $entry) {
|
||||
|
@@ -4,7 +4,7 @@ echo(" EXTREME-BASE-MIB ");
|
||||
|
||||
// Fan Speed
|
||||
$oid = ".1.3.6.1.4.1.1916.1.1.1.9.1.4";
|
||||
$oids = snmpwalk_cache_multi_oid($device, $oid, array(), "EXTREME-BASE-MIB");
|
||||
$oids = snmpwalk_cache_multi_oid($device, $oid, [], "EXTREME-BASE-MIB");
|
||||
|
||||
foreach ($oids as $index => $entry) {
|
||||
// fix index to a proper int
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
echo 'EATON-ATS ';
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'ats2InputFrequency', array(), 'EATON-ATS2-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'ats2InputFrequency', [], 'EATON-ATS2-MIB');
|
||||
foreach ($oids as $volt_id => $data) {
|
||||
$source_oid="EATON-ATS2-MIB::ats2InputIndex.".$volt_id;
|
||||
$num_id = snmp_get($device, $source_oid, '-Oqve');
|
||||
|
@@ -3,7 +3,7 @@
|
||||
echo 'XUPS-MIB ';
|
||||
|
||||
// XUPS-MIB::xupsInputFrequency.0 = INTEGER: 500
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsInputFrequency', array(), 'XUPS-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsInputFrequency', [], 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $freq_id => $data) {
|
||||
$freq_oid = ".1.3.6.1.4.1.534.1.3.1.$freq_id";
|
||||
@@ -20,7 +20,7 @@ foreach ($oids as $freq_id => $data) {
|
||||
}
|
||||
|
||||
// XUPS-MIB::xupsOutputFrequency.0 = INTEGER: 500
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsOutputFrequency', array(), 'XUPS-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsOutputFrequency', [], 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $freq_id => $data) {
|
||||
$freq_oid = ".1.3.6.1.4.1.534.1.4.2.$freq_id";
|
||||
@@ -36,7 +36,7 @@ foreach ($oids as $freq_id => $data) {
|
||||
}
|
||||
|
||||
// XUPS-MIB::xupsBypassFrequency.0 = INTEGER: 500
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsBypassFrequency', array(), 'XUPS-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsBypassFrequency', [], 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $freq_id => $data) {
|
||||
$freq_oid = ".1.3.6.1.4.1.534.1.5.1.$freq_id";
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
echo 'IPOMANII-MIB: ';
|
||||
|
||||
$oids = array();
|
||||
$oids = [];
|
||||
|
||||
d_echo('inletConfigFrequencyHigh ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletConfigFrequencyHigh', $oids, 'IPOMANII-MIB');
|
||||
|
@@ -49,7 +49,7 @@ if (!empty($bypass_current) || $bypass_current == 0) {
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $bypass_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.3.3.1.2', array());
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.3.3.1.2', []);
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
@@ -174,14 +174,14 @@ unset($num_oid, $value, $divisor, $descr, $low_limit, $low_warn, $high_warn, $se
|
||||
|
||||
echo 'GW EYDFA PSU State ';
|
||||
|
||||
$oids = array('.1.3.6.1.4.1.17409.1.1.2.1.4.11.1.3.6.1.4.1.17409.1.11.100.0.2', '.1.3.6.1.4.1.17409.1.1.2.1.4.11.1.3.6.1.4.1.17409.1.11.101.0.2');
|
||||
$oids = ['.1.3.6.1.4.1.17409.1.1.2.1.4.11.1.3.6.1.4.1.17409.1.11.100.0.2', '.1.3.6.1.4.1.17409.1.1.2.1.4.11.1.3.6.1.4.1.17409.1.11.101.0.2'];
|
||||
|
||||
$state_name = 'PowerSupplyState';
|
||||
$states = array(
|
||||
array('value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'normal'),
|
||||
array('value' => 7, 'generic' => 1, 'graph' => 0, 'descr' => 'warning'),
|
||||
array('value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'critical'),
|
||||
);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'normal'],
|
||||
['value' => 7, 'generic' => 1, 'graph' => 0, 'descr' => 'warning'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'critical'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
$n = 1;
|
||||
foreach ($oids as $oid) {
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
// Environmental monitoring on UPSes etc
|
||||
// FIXME emConfigProbesTable may also be used? But not filled out on my device...
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'iemConfigProbesTable', array(), 'PowerNet-MIB');
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'iemConfigProbesTable', [], 'PowerNet-MIB');
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'iemStatusProbesTable', $apc_env_data, 'PowerNet-MIB');
|
||||
|
||||
foreach (array_keys($apc_env_data) as $index) {
|
||||
@@ -21,7 +21,7 @@ foreach (array_keys($apc_env_data) as $index) {
|
||||
}
|
||||
}
|
||||
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'emsProbeStatus', array(), 'PowerNet-MIB');
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'emsProbeStatus', [], 'PowerNet-MIB');
|
||||
|
||||
foreach (array_keys($apc_env_data) as $index) {
|
||||
if ($apc_env_data[$index]['emsProbeStatusProbeCommStatus'] != 'commsNeverDiscovered') {
|
||||
|
@@ -23,7 +23,7 @@
|
||||
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||
*/
|
||||
|
||||
$lib_data = snmpwalk_cache_oid($device, 'lgpEnvHumidityEntryRel', array(), 'LIEBERT-GP-ENVIRONMENTAL-MIB');
|
||||
$lib_data = snmpwalk_cache_oid($device, 'lgpEnvHumidityEntryRel', [], 'LIEBERT-GP-ENVIRONMENTAL-MIB');
|
||||
|
||||
foreach ($lib_data as $index => $data) {
|
||||
if (is_numeric($data['lgpEnvHumidityMeasurementRelTenths'])) {
|
||||
|
@@ -4,7 +4,7 @@ echo 'MGE UPS External ';
|
||||
|
||||
// Environmental monitoring on UPSes etc
|
||||
// FIXME upsmgConfigEnvironmentTable and upsmgEnvironmentSensorTable are used but there are others ...
|
||||
$mge_env_data = snmpwalk_cache_oid($device, 'upsmgConfigEnvironmentTable', array(), 'MG-SNMP-UPS-MIB');
|
||||
$mge_env_data = snmpwalk_cache_oid($device, 'upsmgConfigEnvironmentTable', [], 'MG-SNMP-UPS-MIB');
|
||||
$mge_env_data = snmpwalk_cache_oid($device, 'upsmgEnvironmentSensorTable', $mge_env_data, 'MG-SNMP-UPS-MIB');
|
||||
|
||||
/**
|
||||
|
@@ -2,38 +2,38 @@
|
||||
|
||||
echo 'pCOWeb: ';
|
||||
|
||||
$humidities = array(
|
||||
array(
|
||||
$humidities = [
|
||||
[
|
||||
'mib' => 'CAREL-ug40cdz-MIB::roomRH.0',
|
||||
'descr' => 'Room Relative Humidity',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.2.6.0',
|
||||
'precision' => '10',
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'mib' => 'CAREL-ug40cdz-MIB::dehumPband.0',
|
||||
'descr' => 'Dehumidification Prop. Band',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.12.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'mib' => 'CAREL-ug40cdz-MIB::humidPband.0',
|
||||
'descr' => 'Humidification Prop. Band',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.13.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'mib' => 'CAREL-ug40cdz-MIB::dehumSetp.0',
|
||||
'descr' => 'Dehumidification Set Point',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.16.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'mib' => 'CAREL-ug40cdz-MIB::humidSetp.0',
|
||||
'descr' => 'Humidification Set Point',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.17.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($humidities as $humidity) {
|
||||
$current = (snmp_get($device, $humidity['mib'], '-OqvU') / $humidity['precision']);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'tempHumidSensorEntry', array(), 'Sentry3-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'tempHumidSensorEntry', [], 'Sentry3-MIB');
|
||||
$divisor = '1';
|
||||
$multiplier = '1';
|
||||
d_echo($oids);
|
||||
|
@@ -23,13 +23,13 @@
|
||||
* @author Neil Lathwood <gh+n@laf.io>
|
||||
*/
|
||||
|
||||
$serverscheck_oids = array(
|
||||
$serverscheck_oids = [
|
||||
'sensor1Value.0' => '.1.3.6.1.4.1.17095.3.2.0',
|
||||
'sensor2Value.0' => '.1.3.6.1.4.1.17095.3.6.0',
|
||||
'sensor3Value.0' => '.1.3.6.1.4.1.17095.3.10.0',
|
||||
'sensor4Value.0' => '.1.3.6.1.4.1.17095.3.14.0',
|
||||
'sensor5Value.0' => '.1.3.6.1.4.1.17095.3.18.0',
|
||||
);
|
||||
];
|
||||
|
||||
$temp_x = 1;
|
||||
foreach ($pre_cache['serverscheck_control'] as $oid_name => $oid_value) {
|
||||
|
@@ -4,7 +4,7 @@ echo 'APC Load ';
|
||||
|
||||
$phasecount = $phasecount = $pre_cache['apcups_phase_count'];
|
||||
if ($phasecount > 1) {
|
||||
$oids = snmpwalk_cache_oid($device, 'upsPhaseOutputPercentLoad', array(), 'PowerNet-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'upsPhaseOutputPercentLoad', [], 'PowerNet-MIB');
|
||||
d_echo($oids);
|
||||
foreach ($oids as $index => $data) {
|
||||
$type = 'apcUPS';
|
||||
@@ -18,17 +18,17 @@ if ($phasecount > 1) {
|
||||
}
|
||||
unset($oids);
|
||||
} else {
|
||||
$oid_array = array(
|
||||
array(
|
||||
'HighPrecOid' => 'upsHighPrecOutputLoad',
|
||||
'AdvOid' => 'upsAdvOutputLoad',
|
||||
'type' => 'apc',
|
||||
'index' => 0,
|
||||
'descr' => 'Load',
|
||||
'divisor' => 10,
|
||||
'mib' => '+PowerNet-MIB',
|
||||
),
|
||||
);
|
||||
$oid_array = [
|
||||
[
|
||||
'HighPrecOid' => 'upsHighPrecOutputLoad',
|
||||
'AdvOid' => 'upsAdvOutputLoad',
|
||||
'type' => 'apc',
|
||||
'index' => 0,
|
||||
'descr' => 'Load',
|
||||
'divisor' => 10,
|
||||
'mib' => '+PowerNet-MIB',
|
||||
],
|
||||
];
|
||||
foreach ($oid_array as $item) {
|
||||
$oids = snmp_get($device, $item['HighPrecOid'].'.'.$item['index'], '-OsqnU', $item['mib']);
|
||||
if (empty($oids)) {
|
||||
|
@@ -23,7 +23,7 @@
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.5', array());
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.5', []);
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
@@ -5,7 +5,7 @@ echo ' NetScaler ';
|
||||
echo ' Caching OIDs:';
|
||||
|
||||
if (!is_array($ns_sensor_array)) {
|
||||
$ns_sensor_array = array();
|
||||
$ns_sensor_array = [];
|
||||
echo ' sysHealthCounterValue ';
|
||||
$ns_sensor_array = snmpwalk_cache_multi_oid($device, 'sysHealthCounterValue', $ns_sensor_array, 'NS-ROOT-MIB');
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ echo ' OPENBSD-SENSORS-MIB: ';
|
||||
|
||||
echo 'Caching OIDs:';
|
||||
|
||||
$oids = array();
|
||||
$oids = [];
|
||||
echo ' sensorDevice';
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'sensorDevice', $oids, 'OPENBSD-SENSORS-MIB');
|
||||
echo ' sensorDescr';
|
||||
|
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
echo 'CiscoSB: ';
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'rlPethPsePortEntry', array(), 'CISCOSB-POE-MIB');
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'rlPethPsePortEntry', [], 'CISCOSB-POE-MIB');
|
||||
if (is_array($temp)) {
|
||||
$cur_oid = '.1.3.6.1.4.1.9.6.1.101.108.1.1.5.';
|
||||
$divisor = '1000';
|
||||
|
@@ -23,7 +23,7 @@
|
||||
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||
*/
|
||||
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'amperageProbeTableEntry', array(), 'MIB-Dell-10892');
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'amperageProbeTableEntry', [], 'MIB-Dell-10892');
|
||||
$cur_oid = '.1.3.6.1.4.1.674.10892.1.600.30.1.6.1.';
|
||||
|
||||
foreach ((array)$temp as $index => $entry) {
|
||||
|
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
// Power consumption per port
|
||||
$oids = snmpwalk_cache_oid_num($device, '1.3.6.1.4.1.7428.1.2.1.1.1.3.1', array());
|
||||
$oids = snmpwalk_cache_oid_num($device, '1.3.6.1.4.1.7428.1.2.1.1.1.3.1', []);
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
@@ -23,7 +23,7 @@
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.4', array());
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.4', []);
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
@@ -17,4 +17,4 @@
|
||||
**/
|
||||
|
||||
// FSP150CC Series
|
||||
$pre_cache['adva_fsp150'] = snmpwalk_cache_multi_oid($device, 'cmEntityObjects', array(), 'CM-ENTITY-MIB', null, '-OQUbs');
|
||||
$pre_cache['adva_fsp150'] = snmpwalk_cache_multi_oid($device, 'cmEntityObjects', [], 'CM-ENTITY-MIB', null, '-OQUbs');
|
||||
|
@@ -27,4 +27,4 @@ echo 'emsStatusSysTempUnits ';
|
||||
$pre_cache['emu2_temp_scale'] = snmp_get($device, 'emsStatusSysTempUnits.0', '-OQv', 'PowerNet-MIB');
|
||||
|
||||
echo 'emsProbeStatusEntry ';
|
||||
$pre_cache['emu2_temp'] = snmpwalk_cache_oid($device, 'emsProbeStatusEntry', array(), 'PowerNet-MIB');
|
||||
$pre_cache['emu2_temp'] = snmpwalk_cache_oid($device, 'emsProbeStatusEntry', [], 'PowerNet-MIB');
|
||||
|
@@ -23,13 +23,13 @@
|
||||
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||
*/
|
||||
echo 'coolingUnitStatusAnalogEntry ';
|
||||
$pre_cache['cooling_unit_analog'] = snmpwalk_cache_oid($device, 'coolingUnitStatusAnalogEntry', array(), 'PowerNet-MIB');
|
||||
$pre_cache['cooling_unit_analog'] = snmpwalk_cache_oid($device, 'coolingUnitStatusAnalogEntry', [], 'PowerNet-MIB');
|
||||
|
||||
echo 'upsPhaseNumInputPhases ';
|
||||
$pre_cache['apcups_phase_count'] = snmp_get($device, 'upsPhaseNumInputPhases.1', '-OQv', 'PowerNet-MIB');
|
||||
|
||||
echo 'memSensorsStatusTable ';
|
||||
$pre_cache['mem_sensors_status'] = snmpwalk_cache_oid($device, 'memSensorsStatusTable', array(), 'PowerNet-MIB', null, '-OQUse');
|
||||
$pre_cache['mem_sensors_status'] = snmpwalk_cache_oid($device, 'memSensorsStatusTable', [], 'PowerNet-MIB', null, '-OQUse');
|
||||
|
||||
echo 'memSensorsStatusSysTempUnits ';
|
||||
$pre_cache['memSensorsStatusSysTempUnits'] = snmp_get($device, 'memSensorsStatusSysTempUnits.0', '-OQv', 'PowerNet-MIB');
|
||||
|
@@ -25,10 +25,10 @@
|
||||
*/
|
||||
|
||||
echo 'ifName ';
|
||||
$pre_cache['ar-c3_ifName'] = snmpwalk_cache_oid($device, 'ifName', array(), 'DOCS-IF-MIB');
|
||||
$pre_cache['ar-c3_ifName'] = snmpwalk_cache_oid($device, 'ifName', [], 'DOCS-IF-MIB');
|
||||
|
||||
echo 'ifAlias ';
|
||||
$pre_cache['ar-c3_ifAlias'] = snmpwalk_cache_oid($device, 'ifAlias', array(), 'DOCS-IF-MIB');
|
||||
$pre_cache['ar-c3_ifAlias'] = snmpwalk_cache_oid($device, 'ifAlias', [], 'DOCS-IF-MIB');
|
||||
|
||||
echo 'docsIfSignalQualityTable ';
|
||||
$pre_cache['ar-c3_docsIfSignalQualityTable'] = snmpwalk_cache_oid($device, 'docsIfSignalQualityTable', array(), 'DOCS-IF-MIB');
|
||||
$pre_cache['ar-c3_docsIfSignalQualityTable'] = snmpwalk_cache_oid($device, 'docsIfSignalQualityTable', [], 'DOCS-IF-MIB');
|
||||
|
@@ -25,10 +25,10 @@
|
||||
*/
|
||||
|
||||
echo 'ifName ';
|
||||
$pre_cache['ar-c4_ifName'] = snmpwalk_cache_oid($device, 'ifName', array(), 'DOCS-IF-MIB');
|
||||
$pre_cache['ar-c4_ifName'] = snmpwalk_cache_oid($device, 'ifName', [], 'DOCS-IF-MIB');
|
||||
|
||||
echo 'ifAlias ';
|
||||
$pre_cache['ar-c4_ifAlias'] = snmpwalk_cache_oid($device, 'ifAlias', array(), 'DOCS-IF-MIB');
|
||||
$pre_cache['ar-c4_ifAlias'] = snmpwalk_cache_oid($device, 'ifAlias', [], 'DOCS-IF-MIB');
|
||||
|
||||
echo 'docsIfSignalQualityTable ';
|
||||
$pre_cache['ar-c4_docsIfSignalQualityTable'] = snmpwalk_cache_oid($device, 'docsIfSignalQualityTable', array(), 'DOCS-IF-MIB');
|
||||
$pre_cache['ar-c4_docsIfSignalQualityTable'] = snmpwalk_cache_oid($device, 'docsIfSignalQualityTable', [], 'DOCS-IF-MIB');
|
||||
|
@@ -25,13 +25,13 @@
|
||||
|
||||
|
||||
// table name => regex (first group is index, second group is id)
|
||||
$virtual_tables = array(
|
||||
$virtual_tables = [
|
||||
'ra32-analog' => '/\.1\.3\.6\.1\.4\.1\.20916\.1\.8\.1\.1\.5\.((\d+)\.0)/',
|
||||
'ra32-relay' => '/\.1\.3\.6\.1\.4\.1\.20916\.1\.8\.1\.1\.6\.((\d+)\.0)/',
|
||||
'ra32-ext-temp' => '/\.1\.3\.6\.1\.4\.1\.20916\.1\.8\.1\.2\.((\d+)\.1\.0)/',
|
||||
'ra32-switch' => '/\.1\.3\.6\.1\.4\.1\.20916\.1\.8\.1\.3\.((\d+)\.0)/',
|
||||
'ra32-wish-temp' => '/\.1\.3\.6\.1\.4\.1\.20916\.1\.8\.1\.4\.((\d+)\.4\.1\.2\.0)/',
|
||||
);
|
||||
];
|
||||
|
||||
$data = snmp_walk($device, '.1.3.6.1.4.1.20916.1', '-OQn');
|
||||
foreach (explode(PHP_EOL, $data) as $line) {
|
||||
@@ -43,10 +43,7 @@ foreach (explode(PHP_EOL, $data) as $line) {
|
||||
$index = $matches[1];
|
||||
$id = $matches[2];
|
||||
|
||||
$pre_cache[$vt_name][$index] = array(
|
||||
'value' => $value,
|
||||
'id' => $id,
|
||||
);
|
||||
$pre_cache[$vt_name][$index] = ['value' => $value, 'id' => $id];
|
||||
|
||||
$processed = true;
|
||||
break; // skip rest
|
||||
@@ -54,7 +51,7 @@ foreach (explode(PHP_EOL, $data) as $line) {
|
||||
}
|
||||
|
||||
if (!$processed) {
|
||||
$pre_cache[$oid] = array($value);
|
||||
$pre_cache[$oid] = [$value];
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
echo 'docsIfDownstreamChannelTable ';
|
||||
$pre_cache['ciscoepc_docsIfDownstreamChannelTable'] = snmpwalk_cache_oid($device, 'docsIfDownstreamChannelTable', array(), 'DOCS-IF-MIB');
|
||||
$pre_cache['ciscoepc_docsIfDownstreamChannelTable'] = snmpwalk_cache_oid($device, 'docsIfDownstreamChannelTable', [], 'DOCS-IF-MIB');
|
||||
|
||||
echo 'docsIfSignalQualityTable ';
|
||||
$pre_cache['ciscoepc_docsIfSignalQualityTable'] = snmpwalk_cache_oid($device, 'docsIfSignalQualityTable', array(), 'DOCS-IF-MIB');
|
||||
$pre_cache['ciscoepc_docsIfSignalQualityTable'] = snmpwalk_cache_oid($device, 'docsIfSignalQualityTable', [], 'DOCS-IF-MIB');
|
||||
|
@@ -11,4 +11,4 @@
|
||||
*/
|
||||
|
||||
echo 'hh3cTransceiverInfoTable ';
|
||||
$pre_cache['comware_oids'] = snmpwalk_cache_multi_oid($device, 'hh3cTransceiverInfoTable', array(), 'HH3C-TRANSCEIVER-INFO-MIB');
|
||||
$pre_cache['comware_oids'] = snmpwalk_cache_multi_oid($device, 'hh3cTransceiverInfoTable', [], 'HH3C-TRANSCEIVER-INFO-MIB');
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
|
||||
echo 'ddTransceiversEntry ';
|
||||
$pre_cache['datacom_oids'] = snmpwalk_cache_multi_oid($device, 'ddTransceiversEntry', array(), 'DMswitch-MIB');
|
||||
$pre_cache['datacom_oids'] = snmpwalk_cache_multi_oid($device, 'ddTransceiversEntry', [], 'DMswitch-MIB');
|
||||
|
@@ -24,14 +24,14 @@
|
||||
*/
|
||||
|
||||
echo 'pduUnitStatusTable ';
|
||||
$pre_cache['enlogic_pdu_status'] = snmpwalk_cache_oid($device, 'pduUnitStatusTable', array(), 'ENLOGIC-PDU-MIB');
|
||||
$pre_cache['enlogic_pdu_status'] = snmpwalk_cache_oid($device, 'pduUnitStatusTable', [], 'ENLOGIC-PDU-MIB');
|
||||
|
||||
echo 'pduInputPhaseConfigTable ';
|
||||
$pre_cache['enlogic_pdu_input'] = snmpwalk_cache_oid($device, 'pduInputPhaseConfigTable', array(), 'ENLOGIC-PDU-MIB');
|
||||
$pre_cache['enlogic_pdu_input'] = snmpwalk_cache_oid($device, 'pduInputPhaseConfigTable', [], 'ENLOGIC-PDU-MIB');
|
||||
echo 'pduInputPhaseStatusTable ';
|
||||
$pre_cache['enlogic_pdu_input'] = snmpwalk_cache_oid($device, 'pduInputPhaseStatusTable', $pre_cache['enlogic_pdu_input'], 'ENLOGIC-PDU-MIB');
|
||||
|
||||
echo 'pduCircuitBreakerConfigTable ';
|
||||
$pre_cache['enlogic_pdu_circuit'] = snmpwalk_cache_oid($device, 'pduCircuitBreakerConfigTable', array(), 'ENLOGIC-PDU-MIB');
|
||||
$pre_cache['enlogic_pdu_circuit'] = snmpwalk_cache_oid($device, 'pduCircuitBreakerConfigTable', [], 'ENLOGIC-PDU-MIB');
|
||||
echo 'pduCircuitBreakerStatusTable ';
|
||||
$pre_cache['enlogic_pdu_circuit'] = snmpwalk_cache_oid($device, 'pduCircuitBreakerStatusTable', $pre_cache['enlogic_pdu_circuit'], 'ENLOGIC-PDU-MIB');
|
||||
|
@@ -24,4 +24,4 @@
|
||||
*/
|
||||
|
||||
echo 'swSensorEntry ';
|
||||
$pre_cache['fabos_sensors'] = snmpwalk_cache_multi_oid($device, 'swSensorEntry', array(), 'SW-MIB');
|
||||
$pre_cache['fabos_sensors'] = snmpwalk_cache_multi_oid($device, 'swSensorEntry', [], 'SW-MIB');
|
||||
|
@@ -24,4 +24,4 @@
|
||||
*/
|
||||
|
||||
echo 'ctrl3ChIECTable ';
|
||||
$pre_cache['geist_pdu_iec'] = snmpwalk_cache_oid($device, 'ctrl3ChIECTable', array(), 'GEIST-MIB-V3');
|
||||
$pre_cache['geist_pdu_iec'] = snmpwalk_cache_oid($device, 'ctrl3ChIECTable', [], 'GEIST-MIB-V3');
|
||||
|
@@ -13,4 +13,4 @@
|
||||
*/
|
||||
|
||||
echo 'Caching Brocade IronWare Optics';
|
||||
$pre_cache['ironware_optic_oids'] = snmpwalk_cache_multi_oid($device, 'snIfOpticalMonitoringInfoTable', array(), 'FOUNDRY-SN-SWITCH-GROUP-MIB');
|
||||
$pre_cache['ironware_optic_oids'] = snmpwalk_cache_multi_oid($device, 'snIfOpticalMonitoringInfoTable', [], 'FOUNDRY-SN-SWITCH-GROUP-MIB');
|
||||
|
@@ -11,13 +11,13 @@
|
||||
*/
|
||||
|
||||
echo 'JnxDomCurrentEntry ';
|
||||
$pre_cache['junos_oids'] = snmpwalk_cache_multi_oid($device, 'JnxDomCurrentEntry', array(), 'JUNIPER-DOM-MIB', 'junos');
|
||||
$pre_cache['junos_oids'] = snmpwalk_cache_multi_oid($device, 'JnxDomCurrentEntry', [], 'JUNIPER-DOM-MIB', 'junos');
|
||||
|
||||
echo 'JnxDomCurrentLaneEntry ';
|
||||
$pre_cache['junos_multilane_oids'] = snmpwalk_cache_multi_oid($device, 'JnxDomCurrentLaneEntry', array(), 'JUNIPER-DOM-MIB', 'junos');
|
||||
$pre_cache['junos_multilane_oids'] = snmpwalk_cache_multi_oid($device, 'JnxDomCurrentLaneEntry', [], 'JUNIPER-DOM-MIB', 'junos');
|
||||
|
||||
echo 'jnxoptIfOTNPMFECCurrentTable';
|
||||
$pre_cache['junos_ifotn_oids'] = snmpwalk_cache_multi_oid($device, 'jnxoptIfOTNPMFECCurrentTable', array(), 'JNX-OPT-IF-EXT-MIB', 'junos', '-OQUsb');
|
||||
$pre_cache['junos_ifotn_oids'] = snmpwalk_cache_multi_oid($device, 'jnxoptIfOTNPMFECCurrentTable', [], 'JNX-OPT-IF-EXT-MIB', 'junos', '-OQUsb');
|
||||
|
||||
echo 'JnxoptIfOTNPMFECCurrentEntry ';
|
||||
$pre_cache['junos_prefec_oids'] = snmpwalk_cache_multi_oid($device, 'jnxoptIfOTNPMCurrentFECMinBERMantissa', array(), 'JNX-OPT-IF-EXT-MIB', 'junos');
|
||||
$pre_cache['junos_prefec_oids'] = snmpwalk_cache_multi_oid($device, 'jnxoptIfOTNPMCurrentFECMinBERMantissa', [], 'JNX-OPT-IF-EXT-MIB', 'junos');
|
||||
|
@@ -24,4 +24,4 @@
|
||||
*/
|
||||
|
||||
echo 'RaspberryPi ';
|
||||
$pre_cache['raspberry_pi_sensors'] = snmpwalk_cache_oid($device, '.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121', array());
|
||||
$pre_cache['raspberry_pi_sensors'] = snmpwalk_cache_oid($device, '.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121', []);
|
||||
|
@@ -13,5 +13,5 @@
|
||||
*/
|
||||
|
||||
echo 'Caching nbsCmmcPortTable and NbsCmmcChassisEntry for MRV OptiDriver ';
|
||||
$pre_cache['mrv-od_port-table'] = snmpwalk_cache_multi_oid($device, 'nbsCmmcPortTable', array(), 'NBS-CMMC-MIB');
|
||||
$pre_cache['mrv-od_chassis-entry'] = snmpwalk_cache_multi_oid($device, 'NbsCmmcChassisEntry', array(), 'NBS-CMMC-MIB');
|
||||
$pre_cache['mrv-od_port-table'] = snmpwalk_cache_multi_oid($device, 'nbsCmmcPortTable', [], 'NBS-CMMC-MIB');
|
||||
$pre_cache['mrv-od_chassis-entry'] = snmpwalk_cache_multi_oid($device, 'NbsCmmcChassisEntry', [], 'NBS-CMMC-MIB');
|
||||
|
@@ -10,4 +10,4 @@
|
||||
*/
|
||||
|
||||
echo 'ifSfpParameterTable ';
|
||||
$pre_cache['pbn_oids'] = snmpwalk_cache_multi_oid($device, '.1.3.6.1.4.1.11606.10.9.63.1.7', array(), 'NMS-IF-MIB', 'pbn');
|
||||
$pre_cache['pbn_oids'] = snmpwalk_cache_multi_oid($device, '.1.3.6.1.4.1.11606.10.9.63.1.7', [], 'NMS-IF-MIB', 'pbn');
|
||||
|
@@ -24,13 +24,13 @@
|
||||
*/
|
||||
|
||||
echo 'loadCurrentTable ';
|
||||
$pre_cache['powerlogic_loadCurrentTable'] = snmpwalk_cache_index($device, 'loadCurrentTable', array(), 'PM8ECCMIB');
|
||||
$pre_cache['powerlogic_loadCurrentTable'] = snmpwalk_cache_index($device, 'loadCurrentTable', [], 'PM8ECCMIB');
|
||||
|
||||
echo 'powerTable ';
|
||||
$pre_cache['powerlogic_powerTable'] = snmpwalk_cache_index($device, 'powerTable', array(), 'PM8ECCMIB');
|
||||
$pre_cache['powerlogic_powerTable'] = snmpwalk_cache_index($device, 'powerTable', [], 'PM8ECCMIB');
|
||||
|
||||
echo 'voltageTable ';
|
||||
$pre_cache['powerlogic_voltageTable'] = snmpwalk_cache_index($device, 'voltageTable', array(), 'PM8ECCMIB');
|
||||
$pre_cache['powerlogic_voltageTable'] = snmpwalk_cache_index($device, 'voltageTable', [], 'PM8ECCMIB');
|
||||
|
||||
echo 'frequencyTable ';
|
||||
$pre_cache['powerlogic_frequencyTable'] = snmpwalk_cache_index($device, 'frequencyTable', array(), 'PM8ECCMIB');
|
||||
$pre_cache['powerlogic_frequencyTable'] = snmpwalk_cache_index($device, 'frequencyTable', [], 'PM8ECCMIB');
|
||||
|
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
echo 'hpicfSensorTable ';
|
||||
$pre_cache['procurve_hpicfSensorTable'] = snmpwalk_cache_oid($device, 'hpicfSensorTable', array(), 'HP-ICF-CHASSIS', null, '-OeQUs');
|
||||
$pre_cache['procurve_hpicfSensorTable'] = snmpwalk_cache_oid($device, 'hpicfSensorTable', [], 'HP-ICF-CHASSIS', null, '-OeQUs');
|
||||
|
||||
echo 'hpicfXcvrInfoTable ';
|
||||
$pre_cache['procurve_hpicfXcvrInfoTable'] = snmpwalk_cache_oid($device, 'hpicfXcvrInfoTable', array(), 'HP-ICF-TRANSCEIVER-MIB', null, '-OeQUs');
|
||||
$pre_cache['procurve_hpicfXcvrInfoTable'] = snmpwalk_cache_oid($device, 'hpicfXcvrInfoTable', [], 'HP-ICF-TRANSCEIVER-MIB', null, '-OeQUs');
|
||||
|
@@ -30,10 +30,10 @@ echo 'inletPoleTable ';
|
||||
$pre_cache['raritan_inletPoleTable'] = snmpwalk_group($device, 'inletPoleTable', 'PDU-MIB', 2);
|
||||
|
||||
echo 'inletLabel ';
|
||||
$pre_cache['raritan_inletLabel'] = snmpwalk_cache_oid($device, 'inletLabel', array(), 'PDU2-MIB');
|
||||
$pre_cache['raritan_inletLabel'] = snmpwalk_cache_oid($device, 'inletLabel', [], 'PDU2-MIB');
|
||||
|
||||
echo 'externalSensors';
|
||||
$pre_cache['raritan_extSensorConfig'] = snmpwalk_cache_oid($device, 'externalSensorConfigurationTable', array(), 'PDU2-MIB');
|
||||
$pre_cache['raritan_extSensorConfig'] = snmpwalk_cache_oid($device, 'externalSensorConfigurationTable', [], 'PDU2-MIB');
|
||||
|
||||
echo 'externalSensorMeasurementsTable';
|
||||
$pre_cache['raritan_extSensorMeasure'] = snmpwalk_cache_oid($device, 'externalSensorMeasurementsTable', array(), 'PDU2-MIB');
|
||||
$pre_cache['raritan_extSensorMeasure'] = snmpwalk_cache_oid($device, 'externalSensorMeasurementsTable', [], 'PDU2-MIB');
|
||||
|
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
echo 'st4HumidSensorConfigTable ';
|
||||
$pre_cache['sentry4_humid'] = snmpwalk_cache_oid($device, 'st4HumidSensorConfigTable', array(), 'Sentry4-MIB');
|
||||
$pre_cache['sentry4_humid'] = snmpwalk_cache_oid($device, 'st4HumidSensorConfigTable', [], 'Sentry4-MIB');
|
||||
|
||||
echo 'st4HumidSensorMonitorTable ';
|
||||
$pre_cache['sentry4_humid'] = snmpwalk_cache_oid($device, 'st4HumidSensorMonitorTable', $pre_cache['sentry4_humid'], 'Sentry4-MIB');
|
||||
@@ -33,7 +33,7 @@ echo 'st4HumidSensorEventConfigTable ';
|
||||
$pre_cache['sentry4_humid'] = snmpwalk_cache_oid($device, 'st4HumidSensorEventConfigTable', $pre_cache['sentry4_humid'], 'Sentry4-MIB');
|
||||
|
||||
echo 'st4TempSensorConfigTable ';
|
||||
$pre_cache['sentry4_temp'] = snmpwalk_cache_oid($device, 'st4TempSensorConfigTable', array(), 'Sentry4-MIB');
|
||||
$pre_cache['sentry4_temp'] = snmpwalk_cache_oid($device, 'st4TempSensorConfigTable', [], 'Sentry4-MIB');
|
||||
|
||||
echo 'st4TempSensorMonitorTable ';
|
||||
$pre_cache['sentry4_temp'] = snmpwalk_cache_oid($device, 'st4TempSensorMonitorTable', $pre_cache['sentry4_temp'], 'Sentry4-MIB');
|
||||
@@ -42,7 +42,7 @@ echo 'st4TempSensorEventConfigTable ';
|
||||
$pre_cache['sentry4_temp'] = snmpwalk_cache_oid($device, 'st4TempSensorEventConfigTable', $pre_cache['sentry4_temp'], 'Sentry4-MIB');
|
||||
|
||||
echo 'st4InputCordConfigTable ';
|
||||
$pre_cache['sentry4_input'] = snmpwalk_cache_oid($device, 'st4InputCordConfigTable', array(), 'Sentry4-MIB');
|
||||
$pre_cache['sentry4_input'] = snmpwalk_cache_oid($device, 'st4InputCordConfigTable', [], 'Sentry4-MIB');
|
||||
|
||||
echo 'st4InputCordMonitorTable ';
|
||||
$pre_cache['sentry4_input'] = snmpwalk_cache_oid($device, 'st4InputCordMonitorTable', $pre_cache['sentry4_input'], 'Sentry4-MIB');
|
||||
|
@@ -24,4 +24,4 @@
|
||||
*/
|
||||
|
||||
echo 'TPDIN2-MIB::monitor ';
|
||||
$pre_cache['tpdin_monitor'] = snmpwalk_cache_oid($device, 'monitor', array(), 'TPDIN2-MIB');
|
||||
$pre_cache['tpdin_monitor'] = snmpwalk_cache_oid($device, 'monitor', [], 'TPDIN2-MIB');
|
||||
|
@@ -13,4 +13,4 @@
|
||||
*/
|
||||
|
||||
echo 'Caching WIPIPE-MIB';
|
||||
$pre_cache['wipipe_oids'] = snmpwalk_cache_multi_oid($device, 'mdmEntry', array(), 'WIPIPE-MIB');
|
||||
$pre_cache['wipipe_oids'] = snmpwalk_cache_multi_oid($device, 'mdmEntry', [], 'WIPIPE-MIB');
|
||||
|
@@ -35,21 +35,21 @@ foreach ($contacts['emu2_contacts'] as $id => $contact) {
|
||||
$normalstate = $contact['emsInputContactStatusInputContactNormalState'];
|
||||
if (is_array($contacts['emu2_contacts']) && $normalstate == '1') {
|
||||
$state_name = 'emsInputContactNormalState_NC';
|
||||
$states = array(
|
||||
array('value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Closed'),
|
||||
array('value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'Open'),
|
||||
);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Closed'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'Open'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
} elseif (is_array($contacts['emu2_contacts']) && $normalstate == '2') {
|
||||
$state_name = 'emsInputContactNormalState_NO';
|
||||
$states = array(
|
||||
array('value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'Closed'),
|
||||
array('value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'Open'),
|
||||
);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'Closed'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'Open'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $currentstate, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $currentstate, 'snmp', $index);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
@@ -65,21 +65,21 @@ foreach ($relays['emu2_relays'] as $id => $relay) {
|
||||
$normalstate = $relay['emsOutputRelayStatusOutputRelayNormalState'];
|
||||
if (is_array($relays['emu2_relays']) && $normalstate == '1') {
|
||||
$state_name = 'emsOutputRelayNormalState_NC';
|
||||
$states = array(
|
||||
array('value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Closed'),
|
||||
array('value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'Open'),
|
||||
);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Closed'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'Open'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
} elseif (is_array($relays['emu2_relays']) && $normalstate == '2') {
|
||||
$state_name = 'emsOutputRelayNormalState_NO';
|
||||
$states = array(
|
||||
array('value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'Closed'),
|
||||
array('value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'Open'),
|
||||
);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'Closed'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'Open'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $currentstate, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $currentstate, 'snmp', $index);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
@@ -95,20 +95,20 @@ foreach ($outlets['emu2_outlets'] as $id => $outlet) {
|
||||
$normalstate = $outlet['emsOutletStatusOutletNormalState'];
|
||||
if (is_array($outlets['emu2_outlets']) && $normalstate == '1') {
|
||||
$state_name = 'emsOutletNormalState_ON';
|
||||
$states = array(
|
||||
array('value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'On'),
|
||||
array('value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'Off'),
|
||||
);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'On'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'Off'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
} elseif (is_array($outlets['emu2_outlets']) && $normalstate == '2') {
|
||||
$state_name = 'emsOutletNormalState_OFF';
|
||||
$states = array(
|
||||
array('value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'On'),
|
||||
array('value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'Off'),
|
||||
);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'On'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'Off'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $currentstate, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $currentstate, 'snmp', $index);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
@@ -17,121 +17,73 @@ $index = '0';
|
||||
if (is_numeric($temp)) {
|
||||
//Create State Index
|
||||
$state_name = 'upsAdvBatteryReplaceIndicator';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'noBatteryNeedsReplacing',0,1,0) ,
|
||||
array($state_index_id,'batteryNeedsReplacing',0,2,2)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'noBatteryNeedsReplacing'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'batteryNeedsReplacing'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$descr = 'UPS Battery Replacement Status';
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $temp, 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
$cooling_status = snmpwalk_cache_oid($device, 'coolingUnitStatusDiscreteEntry', array(), 'PowerNet-MIB');
|
||||
$cooling_status = snmpwalk_cache_oid($device, 'coolingUnitStatusDiscreteEntry', [], 'PowerNet-MIB');
|
||||
foreach ($cooling_status as $index => $data) {
|
||||
$cur_oid = '.1.3.6.1.4.1.318.1.1.27.1.4.2.2.1.4.' . $index;
|
||||
$state_name = $data['coolingUnitStatusDiscreteDescription'];
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$tmp_states = explode(',', $data['coolingUnitStatusDiscreteIntegerReferenceKey']);
|
||||
$states = array();
|
||||
foreach ($tmp_states as $k => $ref) {
|
||||
preg_match('/([\w]+)\\(([\d]+)\\)/', $ref, $matches);
|
||||
$nagios_state = get_nagios_state($matches[1]);
|
||||
$states[] = array($state_index_id, $matches[1], 0, $matches[2], $nagios_state);
|
||||
}
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
$tmp_states = explode(',', $data['coolingUnitStatusDiscreteIntegerReferenceKey']);
|
||||
$states = [];
|
||||
foreach ($tmp_states as $k => $ref) {
|
||||
preg_match('/([\w]+)\\(([\d]+)\\)/', $ref, $matches);
|
||||
$nagios_state = get_nagios_state($matches[1]);
|
||||
$states[] = ['value' => 0, 'generic' => $nagios_state, 'graph' => 0, $matches[2], 'descr' => $matches[1]];
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $cur_oid, 'apc', $state_name, '1', '1', null, null, null, null, $data['coolingUnitStatusDiscreteValueAsInteger']);
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $cur_oid, 'apc', $state_name, 1, 1, null, null, null, null, $data['coolingUnitStatusDiscreteValueAsInteger']);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
unset($cooling_status);
|
||||
|
||||
$cooling_unit = snmpwalk_cache_oid($device, 'coolingUnitExtendedDiscreteEntry', array(), 'PowerNet-MIB');
|
||||
$cooling_unit = snmpwalk_cache_oid($device, 'coolingUnitExtendedDiscreteEntry', [], 'PowerNet-MIB');
|
||||
foreach ($cooling_unit as $index => $data) {
|
||||
$cur_oid = '.1.3.6.1.4.1.318.1.1.27.1.6.2.2.1.4.' . $index;
|
||||
$state_name = $data['coolingUnitExtendedDiscreteDescription'];
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$tmp_states = explode(',', $data['coolingUnitExtendedDiscreteIntegerReferenceKey']);
|
||||
$states = array();
|
||||
foreach ($tmp_states as $k => $ref) {
|
||||
preg_match('/([\w]+)\\(([\d]+)\\)/', $ref, $matches);
|
||||
$nagios_state = get_nagios_state($matches[1]);
|
||||
$states[] = array($state_index_id, $matches[1], 0, $matches[2], $nagios_state);
|
||||
}
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
$tmp_states = explode(',', $data['coolingUnitExtendedDiscreteIntegerReferenceKey']);
|
||||
$states = [];
|
||||
foreach ($tmp_states as $k => $ref) {
|
||||
preg_match('/([\w]+)\\(([\d]+)\\)/', $ref, $matches);
|
||||
$nagios_state = get_nagios_state($matches[1]);
|
||||
$states[] = ['value' => 0, 'generic' => $nagios_state, 'graph' => 0, $matches[2], 'descr' => $matches[1]];
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $cur_oid, 'apc', $state_name, '1', '1', null, null, null, null, $data['coolingUnitExtendedDiscreteValueAsInteger']);
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $cur_oid, 'apc', $state_name, 1, 1, null, null, null, null, $data['coolingUnitExtendedDiscreteValueAsInteger']);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
unset($cooling_unit);
|
||||
|
||||
$relays = snmpwalk_cache_oid($device, 'emsOutputRelayControlEntry', array(), 'PowerNet-MIB');
|
||||
$relays = snmpwalk_cache_oid($device, 'emsOutputRelayControlEntry', [], 'PowerNet-MIB');
|
||||
foreach ($relays as $index => $data) {
|
||||
$cur_oid = '.1.3.6.1.4.1.318.1.1.10.3.2.1.1.3.' . $index;
|
||||
$state_name = $data['emsOutputRelayControlOutputRelayName'];
|
||||
$state_index_id = create_state_index($state_name);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 2, 'graph' => 0, 'descr' => 'immediateCloseEMS'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'immediateOpenEMS'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'immediateCloseEMS',0,1,2) ,
|
||||
array($state_index_id,'immediateOpenEMS',0,2,0)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$current = apc_relay_state($data['emsOutputRelayControlOutputRelayCommand']);
|
||||
if (is_numeric($current)) {
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $cur_oid, $state_name, $state_name, '1', '1', null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $cur_oid, $state_name, $state_name, 1, 1, null, null, null, null, $current);
|
||||
create_sensor_to_state_index($device, $state_name, $cur_oid);
|
||||
}
|
||||
}
|
||||
@@ -141,31 +93,19 @@ unset(
|
||||
$data
|
||||
);
|
||||
|
||||
$switched = snmpwalk_cache_oid($device, 'emsOutletControlEntry', array(), 'PowerNet-MIB');
|
||||
$switched = snmpwalk_cache_oid($device, 'emsOutletControlEntry', [], 'PowerNet-MIB');
|
||||
foreach ($switched as $index => $data) {
|
||||
$cur_oid = '.1.3.6.1.4.1.318.1.1.10.3.3.1.1.3.' . $index;
|
||||
$state_name = $data['emsOutletControlOutletName'];
|
||||
$state_index_id = create_state_index($state_name);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 2, 'graph' => 0, 'descr' => 'immediateOnEMS'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'immediateOffEMS'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'immediateOnEMS',0,1,2) ,
|
||||
array($state_index_id,'immediateOffEMS',0,2,0)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$current = apc_relay_state($data['emsOutletControlOutletCommand']);
|
||||
if (is_numeric($current)) {
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $cur_oid, $state_name, $state_name, '1', '1', null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $cur_oid, $state_name, $state_name, 1, 1, null, null, null, null, $current);
|
||||
create_sensor_to_state_index($device, $state_name, $cur_oid);
|
||||
}
|
||||
}
|
||||
@@ -179,62 +119,40 @@ foreach ($pre_cache['mem_sensors_status'] as $index => $data) {
|
||||
if ($data['memSensorsCommStatus']) {
|
||||
$cur_oid = '.1.3.6.1.4.1.318.1.1.10.4.2.3.1.7.' . $index;
|
||||
$state_name = 'memSensorsCommStatus';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'notInstalled',0,1,1),
|
||||
array($state_index_id,'commsOK',0,2,0),
|
||||
array($state_index_id,'commsLost',0,3,2),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'notInstalled'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'commsOK'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'commsLost'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$current = $data['memSensorsCommStatus'];
|
||||
}
|
||||
$descr = $data['memSensorsStatusSensorName'] . ' - ' . $data['memSensorsStatusSensorLocation'];
|
||||
$divisor = 1;
|
||||
$multiplier = 1;
|
||||
if (is_numeric($current)) {
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $state_name . '.' . $index, $state_name, $state_name, '1', '1', null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $state_name . '.' . $index, $state_name, $state_name, 1, 1, null, null, null, null, $current);
|
||||
create_sensor_to_state_index($device, $state_name, $state_name . '.' . $index);
|
||||
}
|
||||
|
||||
if ($data['memSensorsAlarmStatus']) {
|
||||
$cur_oid = '.1.3.6.1.4.1.318.1.1.10.4.2.3.1.8.' . $index;
|
||||
$state_name = 'memSensorsAlarmStatus';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'memNormal',0,1,0),
|
||||
array($state_index_id,'memWarning',0,2,1),
|
||||
array($state_index_id,'memCritical',0,3,2),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'memNormal'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'memWarning'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'memCritical'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$current = $data['memSensorsAlarmStatus'];
|
||||
}
|
||||
$descr = $data['memSensorsStatusSensorName'] . ' - ' . $data['memSensorsStatusSensorLocation'];
|
||||
$divisor = 1;
|
||||
$multiplier = 1;
|
||||
if (is_numeric($current)) {
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $state_name . '.' . $index, $state_name, $state_name, '1', '1', null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $state_name . '.' . $index, $state_name, $state_name, 1, 1, null, null, null, null, $current);
|
||||
create_sensor_to_state_index($device, $state_name, $state_name . '.' . $index);
|
||||
}
|
||||
}
|
||||
|
@@ -10,40 +10,26 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'cfwHardwareStatusTable', array(), 'CISCO-FIREWALL-MIB');
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'cfwHardwareStatusTable', [], 'CISCO-FIREWALL-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.9.9.147.1.2.1.1.1.3.';
|
||||
|
||||
if (is_array($temp)) {
|
||||
//Create State Index
|
||||
if (strstr($temp['netInterface']['cfwHardwareStatusDetail'], 'not Configured') == false) {
|
||||
$state_name = 'cfwHardwareStatus';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'other',0,1,2) ,
|
||||
array($state_index_id,'up',0,2,0) ,
|
||||
array($state_index_id,'down',0,3,2) ,
|
||||
array($state_index_id,'error',0,4,2) ,
|
||||
array($state_index_id,'overTemp',0,5,2) ,
|
||||
array($state_index_id,'busy',0,6,2) ,
|
||||
array($state_index_id,'noMedia',0,7,2) ,
|
||||
array($state_index_id,'backup',0,8,2) ,
|
||||
array($state_index_id,'active',0,9,0) ,
|
||||
array($state_index_id,'standby',0,10,0)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 2, 'graph' => 0, 'descr' => 'other'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'up'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'down'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 0, 'descr' => 'error'],
|
||||
['value' => 5, 'generic' => 2, 'graph' => 0, 'descr' => 'overTemp'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'busy'],
|
||||
['value' => 7, 'generic' => 2, 'graph' => 0, 'descr' => 'noMedia'],
|
||||
['value' => 8, 'generic' => 2, 'graph' => 0, 'descr' => 'backup'],
|
||||
['value' => 9, 'generic' => 0, 'graph' => 0, 'descr' => 'active'],
|
||||
['value' => 10, 'generic' => 0, 'graph' => 0, 'descr' => 'standby'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($temp as $index => $entry) {
|
||||
$descr = ucwords(trim(preg_replace('/\s*\([^\s)]*\)/', '', $temp[$index]['cfwHardwareInformation'])));
|
||||
@@ -55,7 +41,7 @@ if (is_array($temp)) {
|
||||
$index = 7;
|
||||
}
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp[$index][' cfwHardwareStatusValue'], 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, 1, 1, null, null, null, null, $temp[$index][' cfwHardwareStatusValue'], 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
|
@@ -3,7 +3,7 @@
|
||||
echo 'AXIS States';
|
||||
|
||||
// Temp Sensor Status
|
||||
$oids_tmp = snmpwalk_cache_multi_oid($device, 'tempSensorTable', array(), 'AXIS-VIDEO-MIB');
|
||||
$oids_tmp = snmpwalk_cache_multi_oid($device, 'tempSensorTable', [], 'AXIS-VIDEO-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.368.4.1.3.1.3.1.';
|
||||
|
||||
// Exclude from $oids content .common string
|
||||
@@ -14,30 +14,16 @@ foreach ($oids_tmp as $key_oids_tmp => $val_oids_tmp) {
|
||||
if (is_array($oids)) {
|
||||
//Create State Index
|
||||
$state_name = 'tempSensorStatusState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Normal',0,1,0) ,
|
||||
array($state_index_id,'Failed',0,2,2) ,
|
||||
array($state_index_id,'Out Of Boundary',0,3,2) ,
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Normal'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'Failed'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'Out Of Boundary'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($oids as $index => $entry) {
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, 'Temperature Sensor '.$index, '1', '1', null, null, null, null, $entry['tempSensorStatus'], 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, 'Temperature Sensor '.$index, 1, 1, null, null, null, null, $entry['tempSensorStatus'], 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
@@ -45,35 +31,21 @@ if (is_array($oids)) {
|
||||
}
|
||||
|
||||
// Storage Status
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'storageTable', array(), 'AXIS-VIDEO-MIB');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'storageTable', [], 'AXIS-VIDEO-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.368.4.1.8.1.3.';
|
||||
|
||||
if (is_array($oids)) {
|
||||
//Create State Index
|
||||
$state_name = 'storageDisruptionDetectedState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Normal',0,1,0) ,
|
||||
array($state_index_id,'Failed',0,2,2) ,
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Normal'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'Failed'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($oids as $index => $entry) {
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, 'Storage Status: ' .$entry['storageName'], '1', '1', null, null, null, null, $entry['storageDisruptionDetected'], 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, 'Storage Status: ' .$entry['storageName'], 1, 1, null, null, null, null, $entry['storageDisruptionDetected'], 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
|
@@ -6,44 +6,30 @@
|
||||
*/
|
||||
|
||||
if ($device['os'] === 'boss') {
|
||||
$oid = snmpwalk_cache_oid($device, 's5ChasComTable', array(), 'S5-CHASSIS-MIB');
|
||||
$oid = snmpwalk_cache_oid($device, 's5ChasComTable', [], 'S5-CHASSIS-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.45.1.6.3.3.1.1.10.';
|
||||
|
||||
if (is_array($oid)) {
|
||||
//get states
|
||||
$state_name = 's5ChasComOperState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'other' ,0,1,3) ,
|
||||
array($state_index_id,'notAvail' ,0,2,3) ,
|
||||
array($state_index_id,'removed' ,0,3,3) ,
|
||||
array($state_index_id,'disabled' ,0,4,3) ,
|
||||
array($state_index_id,'normal' ,0,5,0) ,
|
||||
array($state_index_id,'resetInProg',0,6,1) ,
|
||||
array($state_index_id,'testing' ,0,7,1) ,
|
||||
array($state_index_id,'warning' ,0,8,1) ,
|
||||
array($state_index_id,'nonFatalErr',0,9,1) ,
|
||||
array($state_index_id,'fatalErr' ,0,10,2) ,
|
||||
array($state_index_id,'notConfig' ,0,11,3) ,
|
||||
array($state_index_id,'obsoleted' ,0,12,3)
|
||||
);
|
||||
}
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 3, 'graph' => 0, 'descr' => 'other'],
|
||||
['value' => 2, 'generic' => 3, 'graph' => 0, 'descr' => 'notAvail'],
|
||||
['value' => 3, 'generic' => 3, 'graph' => 0, 'descr' => 'removed'],
|
||||
['value' => 4, 'generic' => 3, 'graph' => 0, 'descr' => 'disabled'],
|
||||
['value' => 5, 'generic' => 0, 'graph' => 0, 'descr' => 'normal'],
|
||||
['value' => 6, 'generic' => 1, 'graph' => 0, 'descr' => 'resetInProg'],
|
||||
['value' => 7, 'generic' => 1, 'graph' => 0, 'descr' => 'testing'],
|
||||
['value' => 8, 'generic' => 1, 'graph' => 0, 'descr' => 'warning'],
|
||||
['value' => 9, 'generic' => 1, 'graph' => 0, 'descr' => 'nonFatalErr'],
|
||||
['value' => 10, 'generic' => 2, 'graph' => 0, 'descr' => 'fatalErr'],
|
||||
['value' => 11, 'generic' => 3, 'graph' => 0, 'descr' => 'notConfig'],
|
||||
['value' => 12, 'generic' => 3, 'graph' => 0, 'descr' => 'obsoleted'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
// get fans (6) and temp (5) sensor only from walk
|
||||
$ers_sensors = array();
|
||||
$ers_sensors = [];
|
||||
foreach ($oid as $key => $value) {
|
||||
if ($key['s5ChasComGrpIndx'] == 5 || $key['s5ChasComGrpIndx'] == 6) {
|
||||
$ers_sensors[$key] = $value;
|
||||
@@ -56,7 +42,7 @@ if ($device['os'] === 'boss') {
|
||||
$unit = floor($unit_array[1]/10);
|
||||
$descr = "Unit $unit: $entry[s5ChasComDescr]";
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, "s5ChasComOperState.$index", $state_name, $descr, '1', '1', null, null, null, null, $entry['s5ChasComOperState']);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, "s5ChasComOperState.$index", $state_name, $descr, 1, 1, null, null, null, null, $entry['s5ChasComOperState']);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, "s5ChasComOperState.$index");
|
||||
}
|
||||
|
@@ -10,149 +10,146 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$role_data = snmpwalk_cache_oid($device, 'cswSwitchRole', array(), 'CISCO-STACKWISE-MIB');
|
||||
$role_data = snmpwalk_cache_oid($device, 'cswSwitchRole', [], 'CISCO-STACKWISE-MIB');
|
||||
$redundant_data = snmp_get($device, "cswRingRedundant.0", "-OQv", "CISCO-STACKWISE-MIB");
|
||||
|
||||
$tables = array(
|
||||
array('ciscoEnvMonVoltageStatusTable','.1.3.6.1.4.1.9.9.13.1.2.1.7.','ciscoEnvMonVoltageState','ciscoEnvMonVoltageStatusDescr', 'CISCO-ENVMON-MIB') ,
|
||||
array('ciscoEnvMonTemperatureStatusTable','.1.3.6.1.4.1.9.9.13.1.3.1.6.','ciscoEnvMonTemperatureState','ciscoEnvMonTemperatureStatusDescr', 'CISCO-ENVMON-MIB') ,
|
||||
array('ciscoEnvMonFanStatusTable','.1.3.6.1.4.1.9.9.13.1.4.1.3.','ciscoEnvMonFanState','ciscoEnvMonFanStatusDescr', 'CISCO-ENVMON-MIB') ,
|
||||
array('ciscoEnvMonSupplyStatusTable','.1.3.6.1.4.1.9.9.13.1.5.1.3.','ciscoEnvMonSupplyState','ciscoEnvMonSupplyStatusDescr', 'CISCO-ENVMON-MIB') ,
|
||||
array('cefcFRUPowerStatusTable','.1.3.6.1.4.1.9.9.117.1.1.2.1.2.','cefcFRUPowerOperStatus','Sensor Name', 'CISCO-ENTITY-FRU-CONTROL-MIB') ,
|
||||
array('cswGlobals','.1.3.6.1.4.1.9.9.500.1.1.3.','cswRingRedundant','Stack Ring - Redundant', 'CISCO-STACKWISE-MIB') ,
|
||||
array('cswSwitchRole','.1.3.6.1.4.1.9.9.500.1.2.1.1.3.','cswSwitchRole','Stack Role - Switch#', 'CISCO-STACKWISE-MIB') ,
|
||||
array('cswSwitchState','.1.3.6.1.4.1.9.9.500.1.2.1.1.6.','cswSwitchState','Stack State - Switch#', 'CISCO-STACKWISE-MIB') ,
|
||||
array('cswStackPortOperStatus','.1.3.6.1.4.1.9.9.500.1.2.2.1.1.','cswStackPortOperStatus','Stack Port Status - ', 'CISCO-STACKWISE-MIB') ,
|
||||
array('cRFCfgRedundancyOperMode','.1.3.6.1.4.1.9.9.176.1.2.14.','cRFCfgRedundancyOperMode','VSS Mode', 'CISCO-RF-MIB') ,
|
||||
array('cRFStatusUnitState','.1.3.6.1.4.1.9.9.176.1.1.2.','cRFStatusUnitState','VSS Device State', 'CISCO-RF-MIB') ,
|
||||
array('cRFStatusPeerUnitState','.1.3.6.1.4.1.9.9.176.1.1.4.','cRFStatusPeerUnitState','VSS Peer State', 'CISCO-RF-MIB')
|
||||
);
|
||||
$tables = [
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.13.1.2.1.7.', 'oid' => 'ciscoEnvMonVoltageStatusTable', 'state_name' => 'ciscoEnvMonVoltageState', 'mib' => 'CISCO-ENVMON-MIB', 'descr' => 'ciscoEnvMonVoltageStatusDescr'],
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.13.1.3.1.6.', 'oid' => 'ciscoEnvMonTemperatureStatusTable', 'state_name' => 'ciscoEnvMonTemperatureState', 'mib' => 'CISCO-ENVMON-MIB', 'descr' => 'ciscoEnvMonTemperatureStatusDescr'],
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.13.1.4.1.3.', 'oid' => 'ciscoEnvMonFanStatusTable', 'state_name' => 'ciscoEnvMonFanState', 'mib' => 'CISCO-ENVMON-MIB', 'descr' => 'ciscoEnvMonFanStatusDescr'],
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.13.1.5.1.3.', 'oid' => 'ciscoEnvMonSupplyStatusTable', 'state_name' => 'ciscoEnvMonSupplyState', 'mib' => 'CISCO-ENVMON-MIB', 'descr' => 'ciscoEnvMonSupplyStatusDescr'],
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.117.1.1.2.1.2.', 'oid' => 'cefcFRUPowerStatusTable', 'state_name' => 'cefcFRUPowerOperStatus', 'mib' => 'CISCO-ENTITY-FRU-CONTROL-MIB', 'descr' => 'Sensor Name'],
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.176.1.1.2.', 'oid' => 'cRFStatusUnitState', 'state_name' => 'cRFStatusUnitState', 'mib' => 'CISCO-RF-MIB', 'descr' => 'VSS Device State'],
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.176.1.1.4.', 'oid' => 'cRFStatusPeerUnitState', 'state_name' => 'cRFStatusPeerUnitState', 'mib' => 'CISCO-RF-MIB', 'descr' => 'VSS Peer State'],
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.176.1.2.14.', 'oid' => 'cRFCfgRedundancyOperMode', 'state_name' => 'cRFCfgRedundancyOperMode', 'mib' => 'CISCO-RF-MIB', 'descr' => 'VSS Mode'],
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.500.1.1.3.', 'oid' => 'cswGlobals', 'state_name' => 'cswRingRedundant', 'mib' => 'CISCO-STACKWISE-MIB', 'descr' => 'Stack Ring - Redundant'],
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.500.1.2.1.1.3.', 'oid' => 'cswSwitchRole', 'state_name' => 'cswSwitchRole', 'mib' => 'CISCO-STACKWISE-MIB', 'descr' => 'Stack Role - Switch#'],
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.500.1.2.1.1.6.', 'oid' => 'cswSwitchState', 'state_name' => 'cswSwitchState', 'mib' => 'CISCO-STACKWISE-MIB', 'descr' => 'Stack State - Switch#'],
|
||||
['num_oid' => '.1.3.6.1.4.1.9.9.500.1.2.2.1.1.', 'oid' => 'cswStackPortOperStatus', 'state_name' => 'cswStackPortOperStatus', 'mib' => 'CISCO-STACKWISE-MIB', 'descr' => 'Stack Port Status - '],
|
||||
];
|
||||
|
||||
foreach ($tables as $tablevalue) {
|
||||
//Some switches on 15.x expose this information regardless if they are stacked or not, we try to mitigate that by doing the following.
|
||||
if (($tablevalue[0] == 'cswGlobals' || $tablevalue[0] == 'cswSwitchRole' || $tablevalue[0] == 'cswSwitchState' || $tablevalue[0] == 'cswStackPortOperStatus') && $redundant_data == 'false' && count($role_data) == 1) {
|
||||
if (($tablevalue['oid'] == 'cswGlobals' || $tablevalue['oid'] == 'cswSwitchRole' || $tablevalue['oid'] == 'cswSwitchState' || $tablevalue['oid'] == 'cswStackPortOperStatus') && $redundant_data == 'false' && count($role_data) == 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$temp = snmpwalk_cache_multi_oid($device, $tablevalue[0], array(), $tablevalue[4]);
|
||||
$cur_oid = $tablevalue[1];
|
||||
$temp = snmpwalk_cache_multi_oid($device, $tablevalue['oid'], [], $tablevalue['mib']);
|
||||
$cur_oid = $tablevalue['num_oid'];
|
||||
|
||||
if (is_array($temp)) {
|
||||
if ($temp[0][$tablevalue[2]] == 'nonRedundant' || $temp[0]['cswMaxSwitchNum'] == '1') {
|
||||
if ($temp[0][$tablevalue['state_name']] == 'nonRedundant' || $temp[0]['cswMaxSwitchNum'] == '1') {
|
||||
break;
|
||||
}
|
||||
|
||||
//Create State Index
|
||||
$state_name = $tablevalue[2];
|
||||
$state_name = $tablevalue['state_name'];
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
if ($state_name == 'cRFStatusUnitState' || $state_name == 'cRFStatusPeerUnitState') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 3, 'graph' => 0, 'descr' => 'notKnown'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'disabled'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'initialization'],
|
||||
['value' => 4, 'generic' => 1, 'graph' => 0, 'descr' => 'negotiation'],
|
||||
['value' => 5, 'generic' => 1, 'graph' => 0, 'descr' => 'standbyCold'],
|
||||
['value' => 6, 'generic' => 1, 'graph' => 0, 'descr' => 'standbyColdConfig'],
|
||||
['value' => 7, 'generic' => 1, 'graph' => 0, 'descr' => 'standbyColdFileSys'],
|
||||
['value' => 8, 'generic' => 1, 'graph' => 0, 'descr' => 'standbyColdBulk'],
|
||||
['value' => 9, 'generic' => 0, 'graph' => 0, 'descr' => 'standbyHot'],
|
||||
['value' => 10, 'generic' => 1, 'graph' => 0, 'descr' => 'activeFast'],
|
||||
['value' => 11, 'generic' => 1, 'graph' => 0, 'descr' => 'activeDrain'],
|
||||
['value' => 12, 'generic' => 1, 'graph' => 0, 'descr' => 'activePreconfig'],
|
||||
['value' => 13, 'generic' => 1, 'graph' => 0, 'descr' => 'activePostconfig'],
|
||||
['value' => 14, 'generic' => 0, 'graph' => 0, 'descr' => 'active'],
|
||||
['value' => 15, 'generic' => 1, 'graph' => 0, 'descr' => 'activeExtraload'],
|
||||
['value' => 16, 'generic' => 1, 'graph' => 0, 'descr' => 'activeHandback']
|
||||
];
|
||||
} elseif ($state_name == 'cRFCfgRedundancyOperMode') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'nonRedundant'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'staticLoadShareNonRedundant'],
|
||||
['value' => 3, 'generic' => 0, 'graph' => 0, 'descr' => 'dynamicLoadShareNonRedundant'],
|
||||
['value' => 4, 'generic' => 0, 'graph' => 0, 'descr' => 'staticLoadShareRedundant'],
|
||||
['value' => 5, 'generic' => 0, 'graph' => 0, 'descr' => 'dynamicLoadShareRedundant'],
|
||||
['value' => 6, 'generic' => 0, 'graph' => 0, 'descr' => 'coldStandbyRedundant'],
|
||||
['value' => 7, 'generic' => 0, 'graph' => 0, 'descr' => 'warmStandbyRedundant'],
|
||||
['value' => 8, 'generic' => 0, 'graph' => 0, 'descr' => 'hotStandbyRedundant']
|
||||
];
|
||||
} elseif ($state_name == 'cswRingRedundant') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'true'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'false']
|
||||
];
|
||||
} elseif ($state_name == 'cswSwitchRole') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'master'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'member'],
|
||||
['value' => 3, 'generic' => 0, 'graph' => 0, 'descr' => 'notMember'],
|
||||
['value' => 4, 'generic' => 0, 'graph' => 0, 'descr' => 'standby']
|
||||
];
|
||||
} elseif ($state_name == 'cswSwitchState') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'waiting'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'progressing'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'added'],
|
||||
['value' => 4, 'generic' => 0, 'graph' => 0, 'descr' => 'ready'],
|
||||
['value' => 5, 'generic' => 2, 'graph' => 0, 'descr' => 'sdmMismatch'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'verMismatch'],
|
||||
['value' => 7, 'generic' => 2, 'graph' => 0, 'descr' => 'featureMismatch'],
|
||||
['value' => 8, 'generic' => 2, 'graph' => 0, 'descr' => 'newMasterInit'],
|
||||
['value' => 9, 'generic' => 1, 'graph' => 0, 'descr' => 'provisioned'],
|
||||
['value' => 10, 'generic' => 2, 'graph' => 0, 'descr' => 'invalid'],
|
||||
['value' => 11, 'generic' => 1, 'graph' => 0, 'descr' => 'removed']
|
||||
];
|
||||
} elseif ($state_name == 'cefcFRUPowerOperStatus') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 2, 'graph' => 0, 'descr' => 'off (other)'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'on'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'off (admin)'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 0, 'descr' => 'off (denied)'],
|
||||
['value' => 5, 'generic' => 2, 'graph' => 0, 'descr' => 'off (environmental)'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'off (temperature)'],
|
||||
['value' => 7, 'generic' => 2, 'graph' => 0, 'descr' => 'off (fan)'],
|
||||
['value' => 8, 'generic' => 2, 'graph' => 0, 'descr' => 'failed'],
|
||||
['value' => 9, 'generic' => 1, 'graph' => 0, 'descr' => 'on (fan failed)'],
|
||||
['value' => 10, 'generic' => 2, 'graph' => 0, 'descr' => 'off (cooling)'],
|
||||
['value' => 11, 'generic' => 2, 'graph' => 0, 'descr' => 'off (connector rating)'],
|
||||
['value' => 12, 'generic' => 1, 'graph' => 0, 'descr' => 'on (no inline power)']
|
||||
];
|
||||
} else {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'normal'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'warning'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'critical'],
|
||||
['value' => 4, 'generic' => 3, 'graph' => 0, 'descr' => 'shutdown'],
|
||||
['value' => 5, 'generic' => 3, 'graph' => 0, 'descr' => 'notPresent'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'notFunctioning']
|
||||
];
|
||||
}
|
||||
|
||||
create_state_index($state_name, $states);
|
||||
if ($state_name == 'cRFStatusUnitState' || $state_name == 'cRFStatusPeerUnitState') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 3, 'graph' => 0, 'descr' => 'notKnown'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'disabled'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'initialization'],
|
||||
['value' => 4, 'generic' => 1, 'graph' => 0, 'descr' => 'negotiation'],
|
||||
['value' => 5, 'generic' => 1, 'graph' => 0, 'descr' => 'standbyCold'],
|
||||
['value' => 6, 'generic' => 1, 'graph' => 0, 'descr' => 'standbyColdConfig'],
|
||||
['value' => 7, 'generic' => 1, 'graph' => 0, 'descr' => 'standbyColdFileSys'],
|
||||
['value' => 8, 'generic' => 1, 'graph' => 0, 'descr' => 'standbyColdBulk'],
|
||||
['value' => 9, 'generic' => 0, 'graph' => 0, 'descr' => 'standbyHot'],
|
||||
['value' => 10, 'generic' => 1, 'graph' => 0, 'descr' => 'activeFast'],
|
||||
['value' => 11, 'generic' => 1, 'graph' => 0, 'descr' => 'activeDrain'],
|
||||
['value' => 12, 'generic' => 1, 'graph' => 0, 'descr' => 'activePreconfig'],
|
||||
['value' => 13, 'generic' => 1, 'graph' => 0, 'descr' => 'activePostconfig'],
|
||||
['value' => 14, 'generic' => 0, 'graph' => 0, 'descr' => 'active'],
|
||||
['value' => 15, 'generic' => 1, 'graph' => 0, 'descr' => 'activeExtraload'],
|
||||
['value' => 16, 'generic' => 1, 'graph' => 0, 'descr' => 'activeHandback']
|
||||
];
|
||||
} elseif ($state_name == 'cRFCfgRedundancyOperMode') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'nonRedundant'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'staticLoadShareNonRedundant'],
|
||||
['value' => 3, 'generic' => 0, 'graph' => 0, 'descr' => 'dynamicLoadShareNonRedundant'],
|
||||
['value' => 4, 'generic' => 0, 'graph' => 0, 'descr' => 'staticLoadShareRedundant'],
|
||||
['value' => 5, 'generic' => 0, 'graph' => 0, 'descr' => 'dynamicLoadShareRedundant'],
|
||||
['value' => 6, 'generic' => 0, 'graph' => 0, 'descr' => 'coldStandbyRedundant'],
|
||||
['value' => 7, 'generic' => 0, 'graph' => 0, 'descr' => 'warmStandbyRedundant'],
|
||||
['value' => 8, 'generic' => 0, 'graph' => 0, 'descr' => 'hotStandbyRedundant']
|
||||
];
|
||||
} elseif ($state_name == 'cswRingRedundant') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'true'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'false']
|
||||
];
|
||||
} elseif ($state_name == 'cswSwitchRole') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'master'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'member'],
|
||||
['value' => 3, 'generic' => 0, 'graph' => 0, 'descr' => 'notMember'],
|
||||
['value' => 4, 'generic' => 0, 'graph' => 0, 'descr' => 'standby']
|
||||
];
|
||||
} elseif ($state_name == 'cswSwitchState') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'waiting'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'progressing'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'added'],
|
||||
['value' => 4, 'generic' => 0, 'graph' => 0, 'descr' => 'ready'],
|
||||
['value' => 5, 'generic' => 2, 'graph' => 0, 'descr' => 'sdmMismatch'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'verMismatch'],
|
||||
['value' => 7, 'generic' => 2, 'graph' => 0, 'descr' => 'featureMismatch'],
|
||||
['value' => 8, 'generic' => 2, 'graph' => 0, 'descr' => 'newMasterInit'],
|
||||
['value' => 9, 'generic' => 1, 'graph' => 0, 'descr' => 'provisioned'],
|
||||
['value' => 10, 'generic' => 2, 'graph' => 0, 'descr' => 'invalid'],
|
||||
['value' => 11, 'generic' => 1, 'graph' => 0, 'descr' => 'removed']
|
||||
];
|
||||
} elseif ($state_name == 'cefcFRUPowerOperStatus') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 2, 'graph' => 0, 'descr' => 'off (other)'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'on'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'off (admin)'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 0, 'descr' => 'off (denied)'],
|
||||
['value' => 5, 'generic' => 2, 'graph' => 0, 'descr' => 'off (environmental)'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'off (temperature)'],
|
||||
['value' => 7, 'generic' => 2, 'graph' => 0, 'descr' => 'off (fan)'],
|
||||
['value' => 8, 'generic' => 2, 'graph' => 0, 'descr' => 'failed'],
|
||||
['value' => 9, 'generic' => 1, 'graph' => 0, 'descr' => 'on (fan failed)'],
|
||||
['value' => 10, 'generic' => 2, 'graph' => 0, 'descr' => 'off (cooling)'],
|
||||
['value' => 11, 'generic' => 2, 'graph' => 0, 'descr' => 'off (connector rating)'],
|
||||
['value' => 12, 'generic' => 1, 'graph' => 0, 'descr' => 'on (no inline power)']
|
||||
];
|
||||
} else {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'normal'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'warning'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'critical'],
|
||||
['value' => 4, 'generic' => 3, 'graph' => 0, 'descr' => 'shutdown'],
|
||||
['value' => 5, 'generic' => 3, 'graph' => 0, 'descr' => 'notPresent'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'notFunctioning']
|
||||
];
|
||||
}
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($temp as $index => $entry) {
|
||||
if ($tablevalue[2] == 'ciscoEnvMonTemperatureState' && (empty($temp[$index][$tablevalue[3]]))) {
|
||||
if ($tablevalue['state_name'] == 'ciscoEnvMonTemperatureState' && (empty($temp[$index][$tablevalue['descr']]))) {
|
||||
d_echo('Invalid sensor, skipping..');
|
||||
} else {
|
||||
//Discover Sensors
|
||||
$descr = ucwords($temp[$index][$tablevalue[3]]);
|
||||
$descr = ucwords($temp[$index][$tablevalue['descr']]);
|
||||
if ($state_name == 'cRFStatusUnitState' || $state_name == 'cRFStatusPeerUnitState' || $state_name == 'cRFCfgRedundancyOperMode' || $state_name == 'cswRingRedundant') {
|
||||
$descr = $tablevalue[3];
|
||||
$descr = $tablevalue['descr'];
|
||||
} elseif ($state_name == 'cswSwitchRole') {
|
||||
$swrolenumber++;
|
||||
$descr = $tablevalue[3] . $swrolenumber;
|
||||
$descr = $tablevalue['descr'] . $swrolenumber;
|
||||
} elseif ($state_name == 'cswSwitchState') {
|
||||
$swstatenumber++;
|
||||
$descr = $tablevalue[3] . $swstatenumber;
|
||||
$descr = $tablevalue['descr'] . $swstatenumber;
|
||||
} elseif ($state_name == 'cswStackPortOperStatus') {
|
||||
$stack_port_descr = get_port_by_index_cache($device['device_id'], $index);
|
||||
$descr = $tablevalue[3] . $stack_port_descr['ifDescr'];
|
||||
$descr = $tablevalue['descr'] . $stack_port_descr['ifDescr'];
|
||||
} elseif ($state_name == 'cefcFRUPowerOperStatus') {
|
||||
$descr = snmp_get($device, 'entPhysicalName.'.$index, '-Oqv', 'ENTITY-MIB');
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp[$index][$tablevalue[2]], 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, 1, 1, null, null, null, null, $temp[$index][$tablevalue['state_name']], 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
|
@@ -10,38 +10,24 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'swIfOperSuspendedStatus', array(), 'CISCOSB-rlInterfaces');
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'swIfOperSuspendedStatus', [], 'CISCOSB-rlInterfaces');
|
||||
$cur_oid = '.1.3.6.1.4.1.9.6.1.101.43.1.1.24.';
|
||||
|
||||
if (is_array($temp)) {
|
||||
//Create State Index
|
||||
$state_name = 'swIfOperSuspendedStatus';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id, 'true', 0, 1, 2),
|
||||
array($state_index_id, 'false', 0, 2, 0),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 2, 'graph' => 0, 'descr' => 'true'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'false'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($temp as $index => $entry) {
|
||||
$port_descr = get_port_by_index_cache($device['device_id'], str_replace('1.', '', $index));
|
||||
$descr = $port_descr['ifDescr'] . ' Suspended Status';
|
||||
if (str_contains($descr, ['ethernet','Ethernet'])) {
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid . $index, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp[$index]['swIfOperSuspendedStatus'], 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid . $index, $index, $state_name, $descr, 1, 1, null, null, null, null, $temp[$index]['swIfOperSuspendedStatus'], 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
|
@@ -24,28 +24,18 @@
|
||||
*/
|
||||
|
||||
$start_oid = '.1.3.6.1.4.1.18642.1.2.4';
|
||||
$state_table = snmpwalk_cache_oid($device, '.1.3.6.1.4.1.18642.1.2.4', array(), 'CCPOWER-MIB');
|
||||
$state_table = snmpwalk_cache_oid($device, '.1.3.6.1.4.1.18642.1.2.4', [], 'CCPOWER-MIB');
|
||||
$x = 1;
|
||||
foreach ($state_table[0] as $state_name => $state_value) {
|
||||
$state_index_id = create_state_index($state_name);
|
||||
//Create State Translation
|
||||
$states = array(
|
||||
array($state_index_id,'inactive',1,1,2),
|
||||
array($state_index_id,'active',1,2,0),
|
||||
);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 2, 'graph' => 1, 'descr' => 'inactive'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 1, 'descr' => 'active'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
$descr = $state_name;
|
||||
discover_sensor($valid['sensor'], 'state', $device, $start_oid.'.'.$x.'.0', $state_name, $state_name, $descr, '1', '1', null, null, null, null, $state_value, 'snmp');
|
||||
discover_sensor($valid['sensor'], 'state', $device, $start_oid.'.'.$x.'.0', $state_name, $state_name, $descr, 1, 1, null, null, null, null, $state_value, 'snmp');
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $state_name);
|
||||
|
@@ -28,18 +28,18 @@ $index = 'es1dc1DataBatBatTestState';
|
||||
if (is_numeric($batteryTestState)) {
|
||||
//Create State Index
|
||||
$state_name = 'es1dc1DataBatBatTestState';
|
||||
$states = array(
|
||||
array('value' => 0, 'generic' => 0, 'graph' => 0, 'descr' => 'Never Tested'),
|
||||
array('value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Success'),
|
||||
array('value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'On Going'),
|
||||
array('value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: Timeout'),
|
||||
array('value' => 4, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: Vbus Too Low'),
|
||||
array('value' => 5, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: Load Too Low'),
|
||||
array('value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'Failed: AC Failure'),
|
||||
array('value' => 7, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: Canceled'),
|
||||
array('value' => 8, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: LVD Opened'),
|
||||
array('value' => 9, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: No Battery'),
|
||||
);
|
||||
$states = [
|
||||
['value' => 0, 'generic' => 0, 'graph' => 0, 'descr' => 'Never Tested'],
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Success'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'On Going'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: Timeout'],
|
||||
['value' => 4, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: Vbus Too Low'],
|
||||
['value' => 5, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: Load Too Low'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'Failed: AC Failure'],
|
||||
['value' => 7, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: Canceled'],
|
||||
['value' => 8, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: LVD Opened'],
|
||||
['value' => 9, 'generic' => 1, 'graph' => 0, 'descr' => 'Failed: No Battery'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$descr = 'Battery Test Status';
|
||||
@@ -54,13 +54,13 @@ $index = 'es1dc1DataSystemDCMode';
|
||||
if (is_numeric($dcMode)) {
|
||||
//Create State Index
|
||||
$state_name = 'es1dc1DataSystemDCMode';
|
||||
$states = array(
|
||||
array('value' => 0, 'generic' => 0, 'graph' => 0, 'descr' => 'Float'),
|
||||
array('value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Equalize'),
|
||||
array('value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'Battery Test'),
|
||||
array('value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'AC Failure'),
|
||||
array('value' => 5, 'generic' => 0, 'graph' => 0, 'descr' => 'Safe'),
|
||||
);
|
||||
$states = [
|
||||
['value' => 0, 'generic' => 0, 'graph' => 0, 'descr' => 'Float'],
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Equalize'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'Battery Test'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'AC Failure'],
|
||||
['value' => 5, 'generic' => 0, 'graph' => 0, 'descr' => 'Safe'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$descr = 'System DC Mode';
|
||||
|
@@ -23,46 +23,46 @@
|
||||
* @author Paul Heinrichs <pdheinrichs@gmail.com>
|
||||
*/
|
||||
|
||||
$states = array(
|
||||
'power' => array(
|
||||
array('value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Power On'),
|
||||
array('value' => 0, 'generic' => 1, 'graph' => 0, 'descr' => 'Power Off'),
|
||||
),
|
||||
'sync' => array(
|
||||
array('value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Sync Enabled'),
|
||||
array('value' => 0, 'generic' => 1, 'graph' => 0, 'descr' => 'Sync Off'),
|
||||
)
|
||||
);
|
||||
$octetSetup = array(
|
||||
array(
|
||||
$states = [
|
||||
'power' => [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Power On'],
|
||||
['value' => 0, 'generic' => 1, 'graph' => 0, 'descr' => 'Power Off'],
|
||||
],
|
||||
'sync' => [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Sync Enabled'],
|
||||
['value' => 0, 'generic' => 1, 'graph' => 0, 'descr' => 'Sync Off'],
|
||||
]
|
||||
];
|
||||
$octetSetup = [
|
||||
[
|
||||
'oid' => 'portOnM.0',
|
||||
'state_name' => 'portOnM',
|
||||
'states' => $states['power'],
|
||||
'name' => 'Master Port Enabled',
|
||||
'num_oid' => '.1.3.6.1.4.1.25868.1.12.0'
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'oid' => 'portSyncM.0',
|
||||
'state_name' => 'portSyncM',
|
||||
'states' => $states['sync'],
|
||||
'name' => 'Master Port Sync Status',
|
||||
'num_oid' => '.1.3.6.1.4.1.25868.1.13.0'
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'oid' => 'portOnS.0',
|
||||
'state_name' => 'portOnS',
|
||||
'states' => $states['power'],
|
||||
'name' => 'Slave Port Enabled',
|
||||
'num_oid' => '.1.3.6.1.4.1.25868.1.29.0'
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'oid' => 'portSyncS.0',
|
||||
'state_name' => 'portSyncS',
|
||||
'states' => $states['sync'],
|
||||
'name' => 'Slave Port Sync Status',
|
||||
'num_oid' => '.1.3.6.1.4.1.25868.1.30.0'
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($octetSetup as $entry) {
|
||||
$octetString = snmp_get($device, $entry['oid'], "-Ovqe", "CTMMIBCUSTOM");
|
||||
|
@@ -10,116 +10,101 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$tables = array(
|
||||
$tables = [
|
||||
// One could add more entrys from deviceGroup, but this will do as a start
|
||||
array('processorDeviceStatusTable','.1.3.6.1.4.1.674.10892.1.1100.32.1.5.','processorDeviceStatusStatus','processorDeviceStatusLocationName','MIB-Dell-10892') ,
|
||||
array('memoryDeviceTable','.1.3.6.1.4.1.674.10892.1.1100.50.1.5.','memoryDeviceStatus','memoryDeviceLocationName','MIB-Dell-10892') ,
|
||||
array('powerSupplyTable','.1.3.6.1.4.1.674.10892.1.600.12.1.5.','powerSupplyStatus','powerSupplyLocationName','MIB-Dell-10892') ,
|
||||
array('intrusionTable','.1.3.6.1.4.1.674.10892.1.300.70.1.5.','intrusionStatus','Intrusion','MIB-Dell-10892') ,
|
||||
array('controllerTable','.1.3.6.1.4.1.674.10893.1.20.130.1.1.5.','controllerState','controllerName','StorageManagement-MIB') ,
|
||||
array('arrayDiskTable','.1.3.6.1.4.1.674.10893.1.20.130.4.1.4.','arrayDiskState','arrayDiskName','StorageManagement-MIB') ,
|
||||
array('virtualDiskTable','.1.3.6.1.4.1.674.10893.1.20.140.1.1.4.','virtualDiskState','virtualDiskDeviceName','StorageManagement-MIB') ,
|
||||
array('batteryTable','.1.3.6.1.4.1.674.10893.1.20.130.15.1.4.','batteryState','batteryName','StorageManagement-MIB') ,
|
||||
);
|
||||
['processorDeviceStatusTable','.1.3.6.1.4.1.674.10892.1.1100.32.1.5.','processorDeviceStatusStatus','processorDeviceStatusLocationName','MIB-Dell-10892'],
|
||||
['memoryDeviceTable','.1.3.6.1.4.1.674.10892.1.1100.50.1.5.','memoryDeviceStatus','memoryDeviceLocationName','MIB-Dell-10892'],
|
||||
['powerSupplyTable','.1.3.6.1.4.1.674.10892.1.600.12.1.5.','powerSupplyStatus','powerSupplyLocationName','MIB-Dell-10892'],
|
||||
['intrusionTable','.1.3.6.1.4.1.674.10892.1.300.70.1.5.','intrusionStatus','Intrusion','MIB-Dell-10892'],
|
||||
['controllerTable','.1.3.6.1.4.1.674.10893.1.20.130.1.1.5.','controllerState','controllerName','StorageManagement-MIB'],
|
||||
['arrayDiskTable','.1.3.6.1.4.1.674.10893.1.20.130.4.1.4.','arrayDiskState','arrayDiskName','StorageManagement-MIB'],
|
||||
['virtualDiskTable','.1.3.6.1.4.1.674.10893.1.20.140.1.1.4.','virtualDiskState','virtualDiskDeviceName','StorageManagement-MIB'],
|
||||
['batteryTable','.1.3.6.1.4.1.674.10893.1.20.130.15.1.4.','batteryState','batteryName','StorageManagement-MIB'],
|
||||
];
|
||||
|
||||
foreach ($tables as $tablevalue) {
|
||||
$temp = snmpwalk_cache_multi_oid($device, $tablevalue[0], array(), $tablevalue[4]);
|
||||
$temp = snmpwalk_cache_multi_oid($device, $tablevalue[0], [], $tablevalue[4]);
|
||||
$cur_oid = $tablevalue[1];
|
||||
|
||||
if (is_array($temp)) {
|
||||
//Create State Index
|
||||
$state_name = $tablevalue[2];
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
if ($state_name == 'processorDeviceStatusStatus' || $state_name == 'memoryDeviceStatus' || $state_name == 'powerSupplyStatus' || $state_name == 'intrusionStatus') {
|
||||
$states = array(
|
||||
array($state_index_id,'other',0,1,3) ,
|
||||
array($state_index_id,'unknown',0,2,3) ,
|
||||
array($state_index_id,'ok',0,3,0) ,
|
||||
array($state_index_id,'nonCritical',0,4,1) ,
|
||||
array($state_index_id,'critical',0,5,2) ,
|
||||
array($state_index_id,'nonRecoverable',0,6,2)
|
||||
);
|
||||
} elseif ($state_name == 'controllerState') {
|
||||
$states = array(
|
||||
array($state_index_id,'ready',0,1,0) ,
|
||||
array($state_index_id,'failed',0,2,2) ,
|
||||
array($state_index_id,'online',0,3,0) ,
|
||||
array($state_index_id,'offline',0,4,1) ,
|
||||
array($state_index_id,'degraded',0,6,2)
|
||||
);
|
||||
} elseif ($state_name == 'arrayDiskState') {
|
||||
$states = array(
|
||||
array($state_index_id,'ready',0,1,0) ,
|
||||
array($state_index_id,'failed',0,2,2) ,
|
||||
array($state_index_id,'online',0,3,0) ,
|
||||
array($state_index_id,'offline',0,4,2) ,
|
||||
array($state_index_id,'degraded',0,5,2) ,
|
||||
array($state_index_id,'recovering',0,6,1) ,
|
||||
array($state_index_id,'removed',0,7,1) ,
|
||||
array($state_index_id,'non-raid',0,8,3) ,
|
||||
array($state_index_id,'notReady',0,9,1) ,
|
||||
array($state_index_id,'resynching',0,10,1) ,
|
||||
array($state_index_id,'replacing',0,11,1) ,
|
||||
array($state_index_id,'spinningDown',0,12,1) ,
|
||||
array($state_index_id,'rebuild',0,13,1) ,
|
||||
array($state_index_id,'noMedia',0,14,1) ,
|
||||
array($state_index_id,'formatting',0,15,1) ,
|
||||
array($state_index_id,'diagnostics',0,16,1) ,
|
||||
array($state_index_id,'predictiveFailure',0,17,2) ,
|
||||
array($state_index_id,'initializing',0,18,1) ,
|
||||
array($state_index_id,'foreign',0,19,1) ,
|
||||
array($state_index_id,'clear',0,20,1) ,
|
||||
array($state_index_id,'unsupported',0,21,2) ,
|
||||
array($state_index_id,'incompatible',0,22,2) ,
|
||||
array($state_index_id,'readOnly',0,23,2)
|
||||
);
|
||||
} elseif ($state_name == 'virtualDiskState') {
|
||||
$states = array(
|
||||
array($state_index_id,'unknown',0,0,3) ,
|
||||
array($state_index_id,'ready',1,1,0) ,
|
||||
array($state_index_id,'failed',1,2,2) ,
|
||||
array($state_index_id,'online',1,3,1) ,
|
||||
array($state_index_id,'offline',1,4,2) ,
|
||||
array($state_index_id,'degraded',1,6,2) ,
|
||||
array($state_index_id,'verifying',1,7,1) ,
|
||||
array($state_index_id,'resynching',1,15,1) ,
|
||||
array($state_index_id,'regenerating',1,16,1) ,
|
||||
array($state_index_id,'failedRedundancy',1,18,2) ,
|
||||
array($state_index_id,'rebuilding',1,24,1) ,
|
||||
array($state_index_id,'formatting',1,26,1) ,
|
||||
array($state_index_id,'reconstructing',1,32,1) ,
|
||||
array($state_index_id,'initializing',1,35,1) ,
|
||||
array($state_index_id,'backgroundInit',1,36,1) ,
|
||||
array($state_index_id,'permanentlyDegraded',1,52,2)
|
||||
);
|
||||
} elseif ($state_name == 'batteryState') {
|
||||
$states = array(
|
||||
array($state_index_id,'ready',0,1,0) ,
|
||||
array($state_index_id,'failed',1,2,2) ,
|
||||
array($state_index_id,'degraded',1,6,2) ,
|
||||
array($state_index_id,'reconditioning',1,7,1) ,
|
||||
array($state_index_id,'high',1,9,1) ,
|
||||
array($state_index_id,'low',1,10,1) ,
|
||||
array($state_index_id,'charging',1,12,1) ,
|
||||
array($state_index_id,'missing',1,21,2) ,
|
||||
array($state_index_id,'learning',1,36,1)
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
if ($state_name == 'processorDeviceStatusStatus' || $state_name == 'memoryDeviceStatus' || $state_name == 'powerSupplyStatus' || $state_name == 'intrusionStatus') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 3, 'graph' => 0, 'descr' => 'other'],
|
||||
['value' => 2, 'generic' => 3, 'graph' => 0, 'descr' => 'unknown'],
|
||||
['value' => 3, 'generic' => 0, 'graph' => 0, 'descr' => 'ok'],
|
||||
['value' => 4, 'generic' => 1, 'graph' => 0, 'descr' => 'nonCritical'],
|
||||
['value' => 5, 'generic' => 2, 'graph' => 0, 'descr' => 'critical'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'nonRecoverable'],
|
||||
];
|
||||
} elseif ($state_name == 'controllerState') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'ready'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'failed'],
|
||||
['value' => 3, 'generic' => 0, 'graph' => 0, 'descr' => 'online'],
|
||||
['value' => 4, 'generic' => 1, 'graph' => 0, 'descr' => 'offline'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 0, 'descr' => 'degraded'],
|
||||
];
|
||||
} elseif ($state_name == 'arrayDiskState') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'ready'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'failed'],
|
||||
['value' => 3, 'generic' => 0, 'graph' => 0, 'descr' => 'online'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 0, 'descr' => 'offline'],
|
||||
['value' => 5, 'generic' => 2, 'graph' => 0, 'descr' => 'degraded'],
|
||||
['value' => 6, 'generic' => 1, 'graph' => 0, 'descr' => 'recovering'],
|
||||
['value' => 7, 'generic' => 1, 'graph' => 0, 'descr' => 'removed'],
|
||||
['value' => 8, 'generic' => 3, 'graph' => 0, 'descr' => 'non-raid'],
|
||||
['value' => 9, 'generic' => 1, 'graph' => 0, 'descr' => 'notReady'],
|
||||
['value' => 10, 'generic' => 1, 'graph' => 0, 'descr' => 'resynching'],
|
||||
['value' => 11, 'generic' => 1, 'graph' => 0, 'descr' => 'replacing'],
|
||||
['value' => 12, 'generic' => 1, 'graph' => 0, 'descr' => 'spinningDown'],
|
||||
['value' => 13, 'generic' => 1, 'graph' => 0, 'descr' => 'rebuild'],
|
||||
['value' => 14, 'generic' => 1, 'graph' => 0, 'descr' => 'noMedia'],
|
||||
['value' => 15, 'generic' => 1, 'graph' => 0, 'descr' => 'formatting'],
|
||||
['value' => 16, 'generic' => 1, 'graph' => 0, 'descr' => 'diagnostics'],
|
||||
['value' => 17, 'generic' => 2, 'graph' => 0, 'descr' => 'predictiveFailure'],
|
||||
['value' => 18, 'generic' => 1, 'graph' => 0, 'descr' => 'initializing'],
|
||||
['value' => 19, 'generic' => 1, 'graph' => 0, 'descr' => 'foreign'],
|
||||
['value' => 20, 'generic' => 1, 'graph' => 0, 'descr' => 'clear'],
|
||||
['value' => 21, 'generic' => 2, 'graph' => 0, 'descr' => 'unsupported'],
|
||||
['value' => 22, 'generic' => 2, 'graph' => 0, 'descr' => 'incompatible'],
|
||||
['value' => 23, 'generic' => 2, 'graph' => 0, 'descr' => 'readOnly'],
|
||||
];
|
||||
} elseif ($state_name == 'virtualDiskState') {
|
||||
$states = [
|
||||
['value' => 0, 'generic' => 3, 'graph' => 0, 'descr' => 'unknown'],
|
||||
['value' => 1, 'generic' => 0, 'graph' => 1, 'descr' => 'ready'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 1, 'descr' => 'failed'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 1, 'descr' => 'online'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 1, 'descr' => 'offline'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 1, 'descr' => 'degraded'],
|
||||
['value' => 7, 'generic' => 1, 'graph' => 1, 'descr' => 'verifying'],
|
||||
['value' => 15, 'generic' => 1, 'graph' => 1, 'descr' => 'resynching'],
|
||||
['value' => 16, 'generic' => 1, 'graph' => 1, 'descr' => 'regenerating'],
|
||||
['value' => 18, 'generic' => 2, 'graph' => 1, 'descr' => 'failedRedundancy'],
|
||||
['value' => 24, 'generic' => 1, 'graph' => 1, 'descr' => 'rebuilding'],
|
||||
['value' => 26, 'generic' => 1, 'graph' => 1, 'descr' => 'formatting'],
|
||||
['value' => 32, 'generic' => 1, 'graph' => 1, 'descr' => 'reconstructing'],
|
||||
['value' => 35, 'generic' => 1, 'graph' => 1, 'descr' => 'initializing'],
|
||||
['value' => 36, 'generic' => 1, 'graph' => 1, 'descr' => 'backgroundInit'],
|
||||
['value' => 52, 'generic' => 2, 'graph' => 1, 'descr' => 'permanentlyDegraded'],
|
||||
];
|
||||
} elseif ($state_name == 'batteryState') {
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'ready'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 1, 'descr' => 'failed'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 1, 'descr' => 'degraded'],
|
||||
['value' => 7, 'generic' => 1, 'graph' => 1, 'descr' => 'reconditioning'],
|
||||
['value' => 9, 'generic' => 1, 'graph' => 1, 'descr' => 'high'],
|
||||
['value' => 10, 'generic' => 1, 'graph' => 1, 'descr' => 'low'],
|
||||
['value' => 12, 'generic' => 1, 'graph' => 1, 'descr' => 'charging'],
|
||||
['value' => 21, 'generic' => 2, 'graph' => 1, 'descr' => 'missing'],
|
||||
['value' => 36, 'generic' => 1, 'graph' => 1, 'descr' => 'learning'],
|
||||
];
|
||||
}
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($temp as $index => $entry) {
|
||||
if (strpos($index, '54.') === false) { //Because Dell is buggy
|
||||
@@ -133,7 +118,7 @@ foreach ($tables as $tablevalue) {
|
||||
$descr = clean($temp[$index][$tablevalue[3]]); // Use clean as virtualDiskDeviceName is user defined
|
||||
}
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp[$index][$tablevalue[2]], 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, 1, 1, null, null, null, null, $temp[$index][$tablevalue[2]], 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
|
@@ -21,7 +21,7 @@ $tables = [
|
||||
|
||||
foreach ($tables as $tablevalue) {
|
||||
list($table_oid, $num_oid, $value_oid, $descr_oid) = $tablevalue;
|
||||
$temp = snmpwalk_cache_multi_oid($device, $table_oid, array(), 'IDRAC-MIB-SMIv2', null, '-OQUse');
|
||||
$temp = snmpwalk_cache_multi_oid($device, $table_oid, [], 'IDRAC-MIB-SMIv2', null, '-OQUse');
|
||||
// '-OQUsetX'
|
||||
|
||||
if (!empty($temp)) {
|
||||
|
@@ -10,28 +10,14 @@ $index = '0';
|
||||
if (is_numeric($state)) {
|
||||
//Create State Index
|
||||
$state_name = 'systemStatusState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Normal',0,1,0) ,
|
||||
array($state_index_id,'Failed',0,2,2) ,
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Normal'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'Failed'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, 'System Status', '1', '1', null, null, null, null, $state, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, 'System Status', 1, 1, null, null, null, null, $state, 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
@@ -45,28 +31,14 @@ $index = '0';
|
||||
if (is_numeric($state)) {
|
||||
//Create State Index
|
||||
$state_name = 'powerStatusState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Normal',0,1,0) ,
|
||||
array($state_index_id,'Failed',0,2,2) ,
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Normal'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'Failed'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, 'Power Status', '1', '1', null, null, null, null, $state, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, 'Power Status', 1, 1, null, null, null, null, $state, 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
@@ -80,29 +52,15 @@ $index = '0';
|
||||
if (is_numeric($state)) {
|
||||
//Create State Index
|
||||
$state_name = 'systemFanStatusState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Normal',0,1,0) ,
|
||||
array($state_index_id,'Failed',0,2,2) ,
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Normal'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'Failed'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, 'System Fan Status', '1', '1', null, null, null, null, $state, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, 'System Fan Status', 1, 1, null, null, null, null, $state, 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
@@ -116,28 +74,14 @@ $index = '0';
|
||||
if (is_numeric($state)) {
|
||||
//Create State Index
|
||||
$state_name = 'cpuFanStatusState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Normal',0,1,0) ,
|
||||
array($state_index_id,'Failed',0,2,2) ,
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Normal'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'Failed'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, 'CPU Fan Status', '1', '1', null, null, null, null, $state, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, 'CPU Fan Status', 1, 1, null, null, null, null, $state, 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
@@ -151,74 +95,48 @@ $index = '0';
|
||||
if (is_numeric($state)) {
|
||||
//Create State Index
|
||||
$state_name = 'upgradeAvailableState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Available',0,1,1) ,
|
||||
array($state_index_id,'Unavailable',0,2,0) ,
|
||||
array($state_index_id,'Connecting',0,3,3) ,
|
||||
array($state_index_id,'Disconnected',0,4,3) ,
|
||||
array($state_index_id,'Others',0,5,3) ,
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'Available'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'Unavailable'],
|
||||
['value' => 3, 'generic' => 3, 'graph' => 0, 'descr' => 'Connecting'],
|
||||
['value' => 4, 'generic' => 3, 'graph' => 0, 'descr' => 'Disconnected'],
|
||||
['value' => 5, 'generic' => 3, 'graph' => 0, 'descr' => 'Others'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, 'Upgrade Availability', '1', '1', null, null, null, null, $state, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, 'Upgrade Availability', 1, 1, null, null, null, null, $state, 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
// RAID Status OID (Value : 1 Normal, 2 Repairing, 3 Migrating, 4 Expanding, 5 Deleting, 6 Creating, 7 RaidSyncing, 8 RaidParityChecking, 9 RaidAssembling, 10 Canceling, 11 Degrade, 12 Crashed)
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'raidTable', array(), 'SYNOLOGY-RAID-MIB');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'raidTable', [], 'SYNOLOGY-RAID-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.6574.3.1.1.3.';
|
||||
|
||||
if (is_array($oids)) {
|
||||
//Create State Index
|
||||
$state_name = 'raidStatusState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Normal'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'Repairing'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'Migrating'],
|
||||
['value' => 4, 'generic' => 1, 'graph' => 0, 'descr' => 'Expanding'],
|
||||
['value' => 5, 'generic' => 1, 'graph' => 0, 'descr' => 'Deleting'],
|
||||
['value' => 6, 'generic' => 1, 'graph' => 0, 'descr' => 'Creating'],
|
||||
['value' => 7, 'generic' => 1, 'graph' => 0, 'descr' => 'RaidSyncing'],
|
||||
['value' => 8, 'generic' => 1, 'graph' => 0, 'descr' => 'RaidParityChecking'],
|
||||
['value' => 9, 'generic' => 1, 'graph' => 0, 'descr' => 'RaidAssembling'],
|
||||
['value' => 10, 'generic' => 1, 'graph' => 0, 'descr' => 'Canceling'],
|
||||
['value' => 11, 'generic' => 2, 'graph' => 0, 'descr' => 'Degrade'],
|
||||
['value' => 12, 'generic' => 2, 'graph' => 0, 'descr' => 'Crashed'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Normal',0,1,0) ,
|
||||
array($state_index_id,'Repairing',0,2,1) ,
|
||||
array($state_index_id,'Migrating',0,3,1) ,
|
||||
array($state_index_id,'Expanding',0,4,1) ,
|
||||
array($state_index_id,'Deleting',0,5,1) ,
|
||||
array($state_index_id,'Creating',0,6,1) ,
|
||||
array($state_index_id,'RaidSyncing',0,7,1) ,
|
||||
array($state_index_id,'RaidParityChecking',0,8,1) ,
|
||||
array($state_index_id,'RaidAssembling',0,9,1) ,
|
||||
array($state_index_id,'Canceling',0,10,1) ,
|
||||
array($state_index_id,'Degrade',0,11,2) ,
|
||||
array($state_index_id,'Crashed',0,12,2) ,
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
foreach ($oids as $index => $entry) {
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, 'RAID Status', '1', '1', null, null, null, null, $entry['raidStatus'], 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, 'RAID Status', 1, 1, null, null, null, null, $entry['raidStatus'], 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
@@ -226,37 +144,24 @@ if (is_array($oids)) {
|
||||
}
|
||||
|
||||
// Disks Status OID (Value : 1 Normal, 2 Initialized, 3 Not Initialized, 4 System Partition Failed, 5 Crashed )
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'diskTable', array(), 'SYNOLOGY-DISK-MIB');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'diskTable', [], 'SYNOLOGY-DISK-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.6574.2.1.1.5.';
|
||||
|
||||
if (is_array($oids)) {
|
||||
//Create State Index
|
||||
$state_name = 'diskStatusState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Normal',0,1,0) ,
|
||||
array($state_index_id,'Initialized',0,2,1) ,
|
||||
array($state_index_id,'Not Initialized',0,3,1) ,
|
||||
array($state_index_id,'System Partition Failed',0,4,2) ,
|
||||
array($state_index_id,'Crashed',0,5,2) ,
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'Normal'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'Initialized'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'Not Initialized'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 0, 'descr' => 'System Partition Failed'],
|
||||
['value' => 5, 'generic' => 2, 'graph' => 0, 'descr' => 'Crashed'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($oids as $index => $entry) {
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, 'Disk Status '.$index, '1', '1', null, null, null, null, $entry['diskStatus'], 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, 'Disk Status '.$index, 1, 1, null, null, null, null, $entry['diskStatus'], 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
|
@@ -24,17 +24,18 @@
|
||||
*/
|
||||
|
||||
// Battery banks symmetry status discovery
|
||||
$symmetry_oid = array('.1.3.6.1.4.1.12148.9.3.19.3.1.3.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.6.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.9.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.12.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.15.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.18.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.21.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.24.0'
|
||||
);
|
||||
$symmetry_oid = [
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.3.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.6.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.9.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.12.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.15.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.18.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.21.0',
|
||||
'.1.3.6.1.4.1.12148.9.3.19.3.1.24.0'
|
||||
];
|
||||
$oid = snmp_get_multi($device, 'batteryBanksSymmetry1enable.0 batteryBanksSymmetry2enable.0 batteryBanksSymmetry3enable.0 batteryBanksSymmetry4enable.0 batteryBanksSymmetry5enable.0 batteryBanksSymmetry6enable.0 batteryBanksSymmetry7enable.0 batteryBanksSymmetry8enable.0 batteryBanksSymmetry1status.0 batteryBanksSymmetry2status.0 batteryBanksSymmetry3status.0 batteryBanksSymmetry4status.0 batteryBanksSymmetry5status.0 batteryBanksSymmetry6status.0 batteryBanksSymmetry7status.0 batteryBanksSymmetry8status.0', '-OQUs', 'ELTEK-DISTRIBUTED-MIB');
|
||||
$count = array(1, 2, 3, 4, 5, 6, 7, 8);
|
||||
$count = [1, 2, 3, 4, 5, 6, 7, 8];
|
||||
foreach ($count as &$countValue) {
|
||||
if ($oid[0]['batteryBanksSymmetry'.$countValue.'enable'] == 'enable') {
|
||||
if ($oid[0]['batteryBanksSymmetry'.$countValue.'status'] == 'ok') {
|
||||
@@ -54,55 +55,22 @@ foreach ($count as &$countValue) {
|
||||
}
|
||||
|
||||
$state_name = 'batteryBanksSymmetry'.$countValue.'status.0';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'ok',0,0,0) ,
|
||||
array($state_index_id,'minorAlarm',0,1,1) ,
|
||||
array($state_index_id,'majorAlarm',0,2,2) ,
|
||||
array($state_index_id,'disabled',0,3,3) ,
|
||||
array($state_index_id,'error',0,4,2)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 0, 'generic' => 0, 'graph' => 0, 'descr' => 'ok'],
|
||||
['value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'minorAlarm'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'majorAlarm'],
|
||||
['value' => 3, 'generic' => 3, 'graph' => 0, 'descr' => 'disabled'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 0, 'descr' => 'error'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$index = 0;
|
||||
$limit = 10;
|
||||
$warnlimit = null;
|
||||
$lowlimit = null;
|
||||
$lowwarnlimit = null;
|
||||
$divisor = 1;
|
||||
$num_oid = $symmetry_oid[$countValue-1];
|
||||
$state = $state_numeric / $divisor;
|
||||
$descr = 'Battery banks symmetry '.$countValue;
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'state',
|
||||
$device,
|
||||
$num_oid,
|
||||
$index,
|
||||
$state_name,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
$warnlimit,
|
||||
$limit,
|
||||
$state
|
||||
);
|
||||
create_sensor_to_state_index(
|
||||
$device,
|
||||
$state_name,
|
||||
$index
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $num_oid, $index, $state_name, $descr, $divisor, '1', null, null, null, $limit, $state);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
}
|
||||
|
@@ -27,33 +27,21 @@ foreach ($pre_cache['enlogic_pdu_status'] as $index => $data) {
|
||||
if (is_array($data)) {
|
||||
$oid = '.1.3.6.1.4.1.38446.1.2.4.1.3.' . $index;
|
||||
$state_name = 'pduUnitStatusLoadState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
$current = $data['pduUnitStatusLoadState'];
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id, 'upperCritical', 1, 1, 2),
|
||||
array($state_index_id, 'upperWarning', 1, 2, 1),
|
||||
array($state_index_id, 'lowerWarning', 1, 3, 1),
|
||||
array($state_index_id, 'lowerCritical', 1, 4, 2),
|
||||
array($state_index_id, 'normal', 1, 5, 0),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 2, 'graph' => 1, 'descr' => 'upperCritical'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 1, 'descr' => 'upperWarning'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 1, 'descr' => 'lowerWarning'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 1, 'descr' => 'lowerCritical'],
|
||||
['value' => 5, 'generic' => 0, 'graph' => 1, 'descr' => 'normal'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$descr = "Load state #$index";
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $current);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
@@ -67,29 +55,17 @@ foreach ($pre_cache['enlogic_pdu_input'] as $index => $data) {
|
||||
$current = $data['pduInputPhaseStatusCurrentState'];
|
||||
$descr = "Current state #$index";
|
||||
if (!is_numeric($current)) {
|
||||
$state_index_id = create_state_index($state_name);
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id, 'upperCritical', 1, 1, 2),
|
||||
array($state_index_id, 'upperWarning', 1, 2, 1),
|
||||
array($state_index_id, 'lowerWarning', 1, 3, 1),
|
||||
array($state_index_id, 'lowerCritical', 1, 4, 2),
|
||||
array($state_index_id, 'normal', 1, 5, 0),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 2, 'graph' => 1, 'descr' => 'upperCritical'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 1, 'descr' => 'upperWarning'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 1, 'descr' => 'lowerWarning'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 1, 'descr' => 'lowerCritical'],
|
||||
['value' => 5, 'generic' => 0, 'graph' => 1, 'descr' => 'normal'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $tmp_index, $state_name, $descr, '1', '1', null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $tmp_index, $state_name, $descr, 1, 1, null, null, null, null, $current);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $tmp_index);
|
||||
}
|
||||
@@ -100,29 +76,17 @@ foreach ($pre_cache['enlogic_pdu_input'] as $index => $data) {
|
||||
$current = $data['pduInputPhaseStatusVoltageState'];
|
||||
$descr = "Voltage state #$index";
|
||||
if (!is_numeric($current)) {
|
||||
$state_index_id = create_state_index($state_name);
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id, 'upperCritical', 1, 1, 2),
|
||||
array($state_index_id, 'upperWarning', 1, 2, 1),
|
||||
array($state_index_id, 'lowerWarning', 1, 3, 1),
|
||||
array($state_index_id, 'lowerCritical', 1, 4, 2),
|
||||
array($state_index_id, 'normal', 1, 5, 0),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 2, 'graph' => 1, 'descr' => 'upperCritical'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 1, 'descr' => 'upperWarning'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 1, 'descr' => 'lowerWarning'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 1, 'descr' => 'lowerCritical'],
|
||||
['value' => 5, 'generic' => 0, 'graph' => 1, 'descr' => 'normal'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $tmp_index, $state_name, $descr, '1', '1', null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $tmp_index, $state_name, $descr, 1, 1, null, null, null, null, $current);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $tmp_index);
|
||||
}
|
||||
@@ -133,34 +97,22 @@ foreach ($pre_cache['enlogic_pdu_circuit'] as $index => $data) {
|
||||
if (is_array($data)) {
|
||||
$oid = '.1.3.6.1.4.1.38446.1.4.4.1.4.' . $index;
|
||||
$state_name = 'pduCircuitBreakerStatusLoadState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
$current = $data['pduCircuitBreakerStatusLoadState'];
|
||||
|
||||
if (!is_numeric($current)) {
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id, 'upperCritical', 1, 1, 2),
|
||||
array($state_index_id, 'upperWarning', 1, 2, 1),
|
||||
array($state_index_id, 'lowerWarning', 1, 3, 1),
|
||||
array($state_index_id, 'lowerCritical', 1, 4, 2),
|
||||
array($state_index_id, 'normal', 1, 5, 0),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 2, 'graph' => 1, 'descr' => 'upperCritical'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 1, 'descr' => 'upperWarning'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 1, 'descr' => 'lowerWarning'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 1, 'descr' => 'lowerCritical'],
|
||||
['value' => 5, 'generic' => 0, 'graph' => 1, 'descr' => 'normal'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$descr = "Circuit breaker state {$data['pduCircuitBreakerLabel']}";
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $current);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
@@ -40,26 +40,13 @@ if (!empty($oids)) {
|
||||
$descr='Health';
|
||||
|
||||
$state_name = 'eqlMemberHealthStatus';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'unknown',0,0,3) ,
|
||||
array($state_index_id,'normal',1,1,0) ,
|
||||
array($state_index_id,'warning',1,2,1) ,
|
||||
array($state_index_id,'critical',1,3,2)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 0, 'generic' => 3, 'graph' => 0, 'descr' => 'unknown'],
|
||||
['value' => 1, 'generic' => 0, 'graph' => 1, 'descr' => 'normal'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 1, 'descr' => 'warning'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 1, 'descr' => 'critical'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
@@ -97,26 +84,13 @@ eqlMemberHealthDetailsPowerSupplyCurrentState
|
||||
failed-or-no-data (3) -- has ac but no dc out or we have no data
|
||||
}
|
||||
*/
|
||||
$state_name1 = 'eqlMemberPowerSupplyCurrentState';
|
||||
$state_index_id1 = create_state_index($state_name1);
|
||||
|
||||
if ($state_index_id1) {
|
||||
$states1 = array(
|
||||
array($state_index_id1,'on-and-operating',1,1,0) ,
|
||||
array($state_index_id1,'no-ac-power',1,2,1) ,
|
||||
array($state_index_id1,'failed-or-no-data',1,3,2)
|
||||
);
|
||||
foreach ($states1 as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$state_name = 'eqlMemberPowerSupplyCurrentState';
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 1, 'descr' => 'on-and-operating'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 1, 'descr' => 'no-ac-power'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 1, 'descr' => 'failed-or-no-data'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach (explode("\n", $oids1) as $data) {
|
||||
$data = trim($data);
|
||||
@@ -135,8 +109,8 @@ eqlMemberHealthDetailsPowerSupplyCurrentState
|
||||
$index = (100 + $index);
|
||||
$low_limit = 0.5;
|
||||
$high_limit = 1.5;
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name1, $descr, 1, 1, $low_limit, $low_limit, $high_limit, $high_limit, $pstatus, 'snmp', $index);
|
||||
create_sensor_to_state_index($device, $state_name1, $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, $low_limit, $low_limit, $high_limit, $high_limit, $pstatus, 'snmp', $index);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
}//end if
|
||||
}//end foreach
|
||||
@@ -151,31 +125,18 @@ d_echo($oids_disks."\n");
|
||||
$disks_base_oid = '.1.3.6.1.4.1.12740.3.1.1.1.8.1.'; // eqlDiskStatus
|
||||
|
||||
if (!empty($oids_disks)) {
|
||||
$disks_state_name = 'eqlDiskStatus';
|
||||
$disks_state_index_id = create_state_index($disks_state_name);
|
||||
|
||||
if ($disks_state_index_id) {
|
||||
$disk_states = array(
|
||||
array($disks_state_index_id,'on-line',1,1,0),
|
||||
array($disks_state_index_id,'spare',1,2,0),
|
||||
array($disks_state_index_id,'failed',1,3,2),
|
||||
array($disks_state_index_id,'off-line',1,4,1),
|
||||
array($disks_state_index_id,'alt-sig',1,5,1),
|
||||
array($disks_state_index_id,'too-small',1,6,2),
|
||||
array($disks_state_index_id,'history-of-failures',1,7,1),
|
||||
array($disks_state_index_id,'unsupported-version',1,8,1),
|
||||
);
|
||||
foreach ($disk_states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$state_name = 'eqlDiskStatus';
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 1, 'descr' => 'on-line'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 1, 'descr' => 'spare'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 1, 'descr' => 'failed'],
|
||||
['value' => 4, 'generic' => 1, 'graph' => 1, 'descr' => 'off-line'],
|
||||
['value' => 5, 'generic' => 1, 'graph' => 1, 'descr' => 'alt-sig'],
|
||||
['value' => 6, 'generic' => 2, 'graph' => 1, 'descr' => 'too-small'],
|
||||
['value' => 7, 'generic' => 0, 'graph' => 1, 'descr' => 'history-of-failures'],
|
||||
['value' => 8, 'generic' => 1, 'graph' => 1, 'descr' => 'unsupported-version'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach (explode("\n", $oids_disks) as $data) {
|
||||
$data = trim($data);
|
||||
@@ -193,8 +154,8 @@ if (!empty($oids_disks)) {
|
||||
$index = 'eqlDiskStatus.'.$disk_index;
|
||||
$low_limit = 0.5;
|
||||
$high_limit = 1.5;
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $disks_state_name, "Disk $disk_index - $descr", 1, 1, $low_limit, $low_limit, $high_limit, $high_limit, $pstatus, 'snmp', $index);
|
||||
create_sensor_to_state_index($device, $disks_state_name, $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, "Disk $disk_index - $descr", 1, 1, $low_limit, $low_limit, $high_limit, $high_limit, $pstatus, 'snmp', $index);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
unset(
|
||||
$index,
|
||||
$low_limit,
|
||||
|
@@ -23,329 +23,42 @@
|
||||
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||
*/
|
||||
|
||||
$temp = snmp_get($device, 'remLinkState.0', "-Ovqe", "ExaltComProducts");
|
||||
$cur_oid = '.1.3.6.1.4.1.25651.1.2.4.2.4.1.1.0';
|
||||
// Common States
|
||||
$states = [
|
||||
['value' => 0, 'generic' => 0, 'graph' => 1, 'descr' => 'almNORMAL'],
|
||||
['value' => 1, 'generic' => 1, 'graph' => 1, 'descr' => 'almMINOR'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 1, 'descr' => 'almMAJOR'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 1, 'descr' => 'almDisable'],
|
||||
['value' => 4, 'generic' => 1, 'graph' => 1, 'descr' => 'almNotAvailable'],
|
||||
['value' => 5, 'generic' => 1, 'graph' => 1, 'descr' => 'almClearChanel'],
|
||||
['value' => 6, 'generic' => 1, 'graph' => 1, 'descr' => 'almNonOccupant'],
|
||||
];
|
||||
|
||||
if (is_numeric($temp)) {
|
||||
$state_name = 'remLinkState';
|
||||
$index = $state_name;
|
||||
$state_index_id = create_state_index($state_name);
|
||||
$sensors = [
|
||||
['num_oid' => '.1.3.6.1.4.1.25651.1.2.4.2.4.1.1.0', 'state_name' => 'remLinkState', 'descr' => 'Link status (far end radio)'],
|
||||
['num_oid' => '.1.3.6.1.4.1.25651.1.2.4.2.3.1.1.0', 'state_name' => 'locLinkState', 'descr' => 'Link status (local radio)'],
|
||||
['num_oid' => '.1.3.6.1.4.1.25651.1.2.4.2.3.1.2.0', 'state_name' => 'locTempAlarm', 'descr' => 'Temperature status (local radio)'],
|
||||
['num_oid' => '.1.3.6.1.4.1.25651.1.2.4.2.4.1.2.0', 'state_name' => 'remTempAlarm', 'descr' => 'Temperature status (far end radio)'],
|
||||
['num_oid' => '.1.3.6.1.4.1.25651.1.2.4.2.4.1.9.0', 'state_name' => 'remLinkSecMismatch', 'descr' => 'Link security status'],
|
||||
['num_oid' => '.1.3.6.1.4.1.25651.1.2.4.2.3.1.15.0', 'state_name' => 'locLinkStateV', 'descr' => 'Vertial link status (local radio)'],
|
||||
['num_oid' => '.1.3.6.1.4.1.25651.1.2.4.2.3.1.16.0', 'state_name' => 'locLinkStateH', 'descr' => 'Horizontal link status (local radio)'],
|
||||
['num_oid' => '.1.3.6.1.4.1.25651.1.2.4.2.4.1.15.0', 'state_name' => 'remLinkStateV', 'descr' => 'Vertial link status (far end radio)'],
|
||||
['num_oid' => '.1.3.6.1.4.1.25651.1.2.4.2.4.1.16.0', 'state_name' => 'remLinkStateH', 'descr' => 'Horizontal link status (far end radio)'],
|
||||
];
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'almNORMAL',1,0,0) ,
|
||||
array($state_index_id,'almMINOR',1,1,1) ,
|
||||
array($state_index_id,'almMAJOR',1,2,2) ,
|
||||
array($state_index_id,'almDisable',1,3,1) ,
|
||||
array($state_index_id,'almNotAvailable',1,4,1),
|
||||
array($state_index_id,'almClearChanel',1,5,1),
|
||||
array($state_index_id,'almNonOccupant',1,6,1),
|
||||
);
|
||||
foreach ($sensors as $sensor) {
|
||||
$temp = snmp_get($device, $sensor['state_name'].'.0', "-Ovqe", "ExaltComProducts");
|
||||
$cur_oid = $sensor['num_oid'];
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
if (is_numeric($temp)) {
|
||||
$state_name = $sensor['state_name'];
|
||||
$index = $state_name;
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$descr = $sensor['descr'];
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $temp);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
$descr = 'Link status (far end radio)';
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
$temp = snmp_get($device, 'locLinkState.0', "-Ovqe", "ExaltComProducts");
|
||||
$cur_oid = '.1.3.6.1.4.1.25651.1.2.4.2.3.1.1.0';
|
||||
|
||||
if (is_numeric($temp)) {
|
||||
$state_name = 'locLinkState';
|
||||
$index = $state_name;
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'almNORMAL',1,0,0) ,
|
||||
array($state_index_id,'almMINOR',1,1,1) ,
|
||||
array($state_index_id,'almMAJOR',1,2,2) ,
|
||||
array($state_index_id,'almDisable',1,3,1) ,
|
||||
array($state_index_id,'almNotAvailable',1,4,1),
|
||||
array($state_index_id,'almClearChanel',1,5,1),
|
||||
array($state_index_id,'almNonOccupant',1,6,1),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
$descr = 'Link status (local radio)';
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
$temp = snmp_get($device, 'locTempAlarm.0', "-Ovqe", "ExaltComProducts");
|
||||
$cur_oid = '.1.3.6.1.4.1.25651.1.2.4.2.3.1.2.0';
|
||||
|
||||
if (is_numeric($temp)) {
|
||||
$state_name = 'locTempAlarm';
|
||||
$index = $state_name;
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'almNORMAL',1,0,0) ,
|
||||
array($state_index_id,'almMINOR',1,1,1) ,
|
||||
array($state_index_id,'almMAJOR',1,2,2) ,
|
||||
array($state_index_id,'almDisable',1,3,1) ,
|
||||
array($state_index_id,'almNotAvailable',1,4,1),
|
||||
array($state_index_id,'almClearChanel',1,5,1),
|
||||
array($state_index_id,'almNonOccupant',1,6,1),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
$descr = 'Temperature status (local radio)';
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
|
||||
$temp = snmp_get($device, 'remTempAlarm.0', "-Ovqe", "ExaltComProducts");
|
||||
$cur_oid = '.1.3.6.1.4.1.25651.1.2.4.2.4.1.2.0';
|
||||
|
||||
if (is_numeric($temp)) {
|
||||
$state_name = 'remTempAlarm';
|
||||
$index = $state_name;
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'almNORMAL',1,0,0) ,
|
||||
array($state_index_id,'almMINOR',1,1,1) ,
|
||||
array($state_index_id,'almMAJOR',1,2,2) ,
|
||||
array($state_index_id,'almDisable',1,3,1) ,
|
||||
array($state_index_id,'almNotAvailable',1,4,1),
|
||||
array($state_index_id,'almClearChanel',1,5,1),
|
||||
array($state_index_id,'almNonOccupant',1,6,1),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
$descr = 'Temperature status (far end radio)';
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
$temp = snmp_get($device, 'remLinkSecMismatch.0', "-Ovqe", "ExaltComProducts");
|
||||
$cur_oid = '.1.3.6.1.4.1.25651.1.2.4.2.4.1.9.0';
|
||||
|
||||
if (is_numeric($temp)) {
|
||||
$state_name = 'remLinkSecMismatch';
|
||||
$index = $state_name;
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'almNORMAL',1,0,0) ,
|
||||
array($state_index_id,'almMINOR',1,1,1) ,
|
||||
array($state_index_id,'almMAJOR',1,2,2) ,
|
||||
array($state_index_id,'almDisable',1,3,1) ,
|
||||
array($state_index_id,'almNotAvailable',1,4,1),
|
||||
array($state_index_id,'almClearChanel',1,5,1),
|
||||
array($state_index_id,'almNonOccupant',1,6,1),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
$descr = 'Link security status';
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
$temp = snmp_get($device, 'locLinkStateV.0', "-Ovqe", "ExaltComProducts");
|
||||
$cur_oid = '.1.3.6.1.4.1.25651.1.2.4.2.3.1.15.0';
|
||||
|
||||
if (is_numeric($temp)) {
|
||||
$state_name = 'locLinkStateV';
|
||||
$index = $state_name;
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'almNORMAL',1,0,0) ,
|
||||
array($state_index_id,'almMINOR',1,1,1) ,
|
||||
array($state_index_id,'almMAJOR',1,2,2) ,
|
||||
array($state_index_id,'almDisable',1,3,1) ,
|
||||
array($state_index_id,'almNotAvailable',1,4,1),
|
||||
array($state_index_id,'almClearChanel',1,5,1),
|
||||
array($state_index_id,'almNonOccupant',1,6,1),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
$descr = 'Vertial link status (local radio)';
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
$temp = snmp_get($device, 'locLinkStateH.0', "-Ovqe", "ExaltComProducts");
|
||||
$cur_oid = '.1.3.6.1.4.1.25651.1.2.4.2.3.1.16.0';
|
||||
|
||||
if (is_numeric($temp)) {
|
||||
$state_name = 'locLinkStateH';
|
||||
$index = $state_name;
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'almNORMAL',1,0,0) ,
|
||||
array($state_index_id,'almMINOR',1,1,1) ,
|
||||
array($state_index_id,'almMAJOR',1,2,2) ,
|
||||
array($state_index_id,'almDisable',1,3,1) ,
|
||||
array($state_index_id,'almNotAvailable',1,4,1),
|
||||
array($state_index_id,'almClearChanel',1,5,1),
|
||||
array($state_index_id,'almNonOccupant',1,6,1),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
$descr = 'Horizontal link status (local radio)';
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
$temp = snmp_get($device, 'remLinkStateV.0', "-Ovqe", "ExaltComProducts");
|
||||
$cur_oid = '.1.3.6.1.4.1.25651.1.2.4.2.4.1.15.0';
|
||||
|
||||
if (is_numeric($temp)) {
|
||||
$state_name = 'remLinkStateV';
|
||||
$index = $state_name;
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'almNORMAL',1,0,0) ,
|
||||
array($state_index_id,'almMINOR',1,1,1) ,
|
||||
array($state_index_id,'almMAJOR',1,2,2) ,
|
||||
array($state_index_id,'almDisable',1,3,1) ,
|
||||
array($state_index_id,'almNotAvailable',1,4,1),
|
||||
array($state_index_id,'almClearChanel',1,5,1),
|
||||
array($state_index_id,'almNonOccupant',1,6,1),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
$descr = 'Vertial link status (far end radio)';
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
$temp = snmp_get($device, 'remLinkStateH.0', "-Ovqe", "ExaltComProducts");
|
||||
$cur_oid = '.1.3.6.1.4.1.25651.1.2.4.2.4.1.16.0';
|
||||
|
||||
if (is_numeric($temp)) {
|
||||
$state_name = 'remLinkStateH';
|
||||
$index = $state_name;
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'almNORMAL',1,0,0) ,
|
||||
array($state_index_id,'almMINOR',1,1,1) ,
|
||||
array($state_index_id,'almMAJOR',1,2,2) ,
|
||||
array($state_index_id,'almDisable',1,3,1) ,
|
||||
array($state_index_id,'almNotAvailable',1,4,1),
|
||||
array($state_index_id,'almClearChanel',1,5,1),
|
||||
array($state_index_id,'almNonOccupant',1,6,1),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
$descr = 'Horizontal link status (far end radio)';
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp);
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
||||
unset(
|
||||
|
@@ -1,209 +1,134 @@
|
||||
<?php
|
||||
|
||||
// Power Status OID (Value : 0 Bad, 1 Good, 2 NotPresent)
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'sysChassisPowerSupplyTable', array(), 'F5-BIGIP-SYSTEM-MIB');
|
||||
// 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');
|
||||
if (is_array($temp)) {
|
||||
echo 'F5 power supply: ';
|
||||
//Create State Index
|
||||
$state_name = 'sysChassisPowerSupplyStatus';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Bad',0,0,2) ,
|
||||
array($state_index_id,'Good',0,1,0) ,
|
||||
array($state_index_id,'NotPresent',0,2,3),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3], // Value polled from device
|
||||
'state_generic_value' => $value[4], // Set value based on the Nagios standard 0=OK, 1=Warning, 2=Critical, 3=Unknown
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
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;
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $current, 'snmp', $index);
|
||||
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))
|
||||
|
||||
$temp1 = snmpwalk_cache_multi_oid($device, 'sysCmFailoverStatus', array(), 'F5-BIGIP-SYSTEM-MIB');
|
||||
|
||||
if (is_array($temp1)) {
|
||||
echo 'F5 FailOver State: ';
|
||||
//Create State Index
|
||||
$state_name = 'sysCmFailoverStatusId';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Unknown',0,0,3),
|
||||
array($state_index_id,'OffLine',0,1,2),
|
||||
array($state_index_id,'ForcedOffline',0,2,2),
|
||||
array($state_index_id,'Standby',0,3,1),
|
||||
array($state_index_id,'Active',0,4,0),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3], // Value polled from device
|
||||
'state_generic_value' => $value[4], // Set value based on the Nagios standard 0=OK, 1=Warning, 2=Critical, 3=Unknown
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
foreach (array_keys($temp1) as $index) {
|
||||
$descr = "sysCmFailoverStatusId.".$temp1[$index]['sysCmFailoverStatusId'];
|
||||
$current = $temp1[$index]['sysCmFailoverStatusId'];
|
||||
$sensorType = 'f5';
|
||||
$oid = '.1.3.6.1.4.1.3375.2.1.14.3.1.'.$index;
|
||||
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($temp1) as $index)
|
||||
} // End if (is_array($temp1))
|
||||
|
||||
$temp1 = snmpwalk_cache_multi_oid($device, 'sysCmSyncStatusId', array(), 'F5-BIGIP-SYSTEM-MIB');
|
||||
|
||||
if (is_array($temp1)) {
|
||||
echo 'F5 Sync State: ';
|
||||
//Create State Index
|
||||
$state_name = 'sysCmSyncStatusId';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'unknown',0,0,3),
|
||||
array($state_index_id,'syncing',0,1,0),
|
||||
array($state_index_id,'needManualSync',0,2,1),
|
||||
array($state_index_id,'inSync',0,3,0),
|
||||
array($state_index_id,'syncFailed',0,4,1),
|
||||
array($state_index_id,'syncDisconnected',0,5,2),
|
||||
array($state_index_id,'standalone',0,6,0),
|
||||
array($state_index_id,'awaitingInitialSync',0,7,1),
|
||||
array($state_index_id,'incompatibleVersion',0,8,2),
|
||||
array($state_index_id,'partialSync',0,8,2),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3], // Value polled from device
|
||||
'state_generic_value' => $value[4], // Set value based on the Nagios standard 0=OK, 1=Warning, 2=Critical, 3=Unknown
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
foreach (array_keys($temp1) as $index) {
|
||||
$descr = "sysCmSyncStatusId.".$index;
|
||||
$current = $temp1[$index]['sysCmSyncStatusId'];
|
||||
$sensorType = 'f5';
|
||||
$oid = '.1.3.6.1.4.1.3375.2.1.14.1.1.'.$index;
|
||||
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($temp1) as $index)
|
||||
} // End if (is_array($temp1))
|
||||
|
||||
$temp1 = snmpwalk_cache_multi_oid($device, 'sysCmFailoverStatusColor', array(), 'F5-BIGIP-SYSTEM-MIB');
|
||||
|
||||
if (is_array($temp1)) {
|
||||
echo 'F5 FailOver State Color: ';
|
||||
//Create State Index
|
||||
$state_name = 'sysCmFailoverStatusColor';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Green: functioning correctly',0,0,0),
|
||||
array($state_index_id,'Yellow: functioning suboptimally',0,1,1),
|
||||
array($state_index_id,'Red: requires attention to function correctly',0,2,2),
|
||||
array($state_index_id,'Blue: status is unknown',0,3,3),
|
||||
array($state_index_id,'Gray: intentionally not functioning',0,4,0),
|
||||
array($state_index_id,'Black: not connected to any peers',0,5,2),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3], // Value polled from device
|
||||
'state_generic_value' => $value[4], // Set value based on the Nagios standard 0=OK, 1=Warning, 2=Critical, 3=Unknown
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
foreach (array_keys($temp1) as $index) {
|
||||
$descr = "sysCmFailoverStatusColor.".$index;
|
||||
$current = $temp1[$index]['sysCmFailoverStatusColor'];
|
||||
$sensorType = 'f5';
|
||||
$oid = '.1.3.6.1.4.1.3375.2.1.14.3.3.'.$index;
|
||||
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($temp1) as $index)
|
||||
} // End if (is_array($temp1))
|
||||
|
||||
$temp3 = snmpwalk_cache_multi_oid($device, 'sysChassisFanStatus', array(), 'F5-BIGIP-SYSTEM-MIB');
|
||||
|
||||
if (is_array($temp3)) {
|
||||
$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';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id,'Bad',0,0,2),
|
||||
array($state_index_id,'Good',0,1,0),
|
||||
array($state_index_id,'NotPresent',0,2,3),
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3], // Value polled from device
|
||||
'state_generic_value' => $value[4], // Set value based on the Nagios standard 0=OK, 1=Warning, 2=Critical, 3=Unknown
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
foreach (array_keys($temp3) as $index) {
|
||||
create_state_index($state_name, $states);
|
||||
foreach (array_keys($temp) as $index) {
|
||||
$descr = "Fan Speed Status ".$index;
|
||||
$current = $temp3[$index]['sysChassisFanStatus'];
|
||||
$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);
|
||||
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($temp3) as $index)
|
||||
} // End if (is_array($temp3))
|
||||
} // End foreach (array_keys($temp) as $index)
|
||||
} // End if (is_array($temp))
|
||||
|
||||
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'sysCmFailoverStatus', [], 'F5-BIGIP-SYSTEM-MIB');
|
||||
|
||||
if (is_array($temp)) {
|
||||
echo 'F5 FailOver State: ';
|
||||
//Create State Index
|
||||
$state_name = 'sysCmFailoverStatusId';
|
||||
$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'];
|
||||
$sensorType = 'f5';
|
||||
$oid = '.1.3.6.1.4.1.3375.2.1.14.3.1.'.$index;
|
||||
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, 'sysCmSyncStatusId', [], 'F5-BIGIP-SYSTEM-MIB');
|
||||
|
||||
if (is_array($temp)) {
|
||||
echo 'F5 Sync State: ';
|
||||
//Create State Index
|
||||
$state_name = 'sysCmSyncStatusId';
|
||||
$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) {
|
||||
$descr = "sysCmSyncStatusId.".$index;
|
||||
$current = $temp[$index]['sysCmSyncStatusId'];
|
||||
$sensorType = 'f5';
|
||||
$oid = '.1.3.6.1.4.1.3375.2.1.14.1.1.'.$index;
|
||||
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, 'sysCmFailoverStatusColor', [], 'F5-BIGIP-SYSTEM-MIB');
|
||||
|
||||
if (is_array($temp)) {
|
||||
echo 'F5 FailOver State Color: ';
|
||||
//Create State Index
|
||||
$state_name = 'sysCmFailoverStatusColor';
|
||||
$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) {
|
||||
$descr = "sysCmFailoverStatusColor.".$index;
|
||||
$current = $temp[$index]['sysCmFailoverStatusColor'];
|
||||
$sensorType = 'f5';
|
||||
$oid = '.1.3.6.1.4.1.3375.2.1.14.3.3.'.$index;
|
||||
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))
|
||||
|
@@ -26,32 +26,20 @@
|
||||
foreach ($pre_cache['fabos_sensors'] as $data) {
|
||||
if (is_numeric($data['swSensorValue']) && $data['swSensorValue'] !== '-2147483648') {
|
||||
$descr = $data['swSensorInfo'];
|
||||
$state_index_id = create_state_index($descr);
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id, 'unknown', 0, 1, 3),
|
||||
array($state_index_id, 'faulty', 1, 2, 2),
|
||||
array($state_index_id, 'below-min', 1, 3, 1),
|
||||
array($state_index_id, 'nominal', 1, 4, 0),
|
||||
array($state_index_id, 'above-max', 1, 5, 1),
|
||||
array($state_index_id, 'absent', 1, 6, 1),
|
||||
);
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 3, 'graph' => 0, 'descr' => 'unknown'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 1, 'descr' => 'faulty'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 1, 'descr' => 'below-min'],
|
||||
['value' => 4, 'generic' => 0, 'graph' => 1, 'descr' => 'nominal'],
|
||||
['value' => 5, 'generic' => 1, 'graph' => 1, 'descr' => 'above-max'],
|
||||
['value' => 6, 'generic' => 1, 'graph' => 1, 'descr' => 'absent'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$index = $data['swSensorIndex'];
|
||||
$oid = '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.3.' . $index;
|
||||
$value = $data['swSensorStatus'];
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $descr, $descr, '1', '1', null, null, null, null, $value);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $descr, $descr, 1, 1, null, null, null, null, $value);
|
||||
create_sensor_to_state_index($device, $descr, $index);
|
||||
}
|
||||
}
|
||||
|
@@ -4,43 +4,39 @@ if ($device['os'] == 'hirschmann') {
|
||||
///////////////////////////
|
||||
/// Power Supply Status ///
|
||||
///////////////////////////
|
||||
$oid = snmpwalk_cache_multi_oid($device, 'hmPSTable', array(), 'HMPRIV-MGMT-SNMP-MIB');
|
||||
$oid = snmpwalk_cache_multi_oid($device, 'hmPSTable', [], 'HMPRIV-MGMT-SNMP-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.248.14.1.2.1.3.';
|
||||
|
||||
if (is_array($oid)) {
|
||||
//Create State Index
|
||||
$state_name = 'hmPowerSupplyStatus';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'ok',0,1,0) ,
|
||||
array($state_index_id,'failed',0,2,2) ,
|
||||
array($state_index_id,'notInstalled',0,3,1) ,
|
||||
array($state_index_id,'unknown',0,4,3)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'ok'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'failed'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'notInstalled'],
|
||||
['value' => 4, 'generic' => 3, 'graph' => 0, 'descr' => 'unknown'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($oid as $index => $entry) {
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, 'hmPowerSupplyStatus'.$index, $state_name, 'Power Supply '.$oid[$index]['hmPSID'], '1', '1', null, null, null, null, $oid[$index]['hmPowerSupplyStatus'], 'snmp', 'hmPowerSupplyStatus'.$index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, 'hmPowerSupplyStatus'.$index, $state_name, 'Power Supply '.$oid[$index]['hmPSID'], 1, 1, null, null, null, null, $oid[$index]['hmPowerSupplyStatus'], 'snmp', 'hmPowerSupplyStatus'.$index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, 'hmPowerSupplyStatus'.$index);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
/// Common LED Status States ///
|
||||
////////////////////////////////
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'off'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'green'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 0, 'descr' => 'yellow'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 0, 'descr' => 'red'],
|
||||
];
|
||||
|
||||
///////////////////////////////
|
||||
/// LED Status Power Supply ///
|
||||
///////////////////////////////
|
||||
@@ -51,31 +47,11 @@ if ($device['os'] == 'hirschmann') {
|
||||
if (is_numeric($temp)) {
|
||||
//Create State Index
|
||||
$state_name = 'hmLEDRSPowerSupply';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'off',0,1,0) ,
|
||||
array($state_index_id,'green',0,2,0) ,
|
||||
array($state_index_id,'yellow',0,3,1) ,
|
||||
array($state_index_id,'red',0,4,2)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$descr = 'LED Status Power Supply';
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, 'hmLEDRSPowerSupply.'.$index, $state_name, $descr, '1', '1', null, null, null, null, $temp, 'snmp', 'hmLEDRSPowerSupply.'.$index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, 'hmLEDRSPowerSupply.'.$index, $state_name, $descr, 1, 1, null, null, null, null, $temp, 'snmp', 'hmLEDRSPowerSupply.'.$index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, 'hmLEDRSPowerSupply.'.$index);
|
||||
@@ -91,31 +67,11 @@ if ($device['os'] == 'hirschmann') {
|
||||
if (is_numeric($temp)) {
|
||||
//Create State Index
|
||||
$state_name = 'hmLEDRStandby';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'off',0,1,0) ,
|
||||
array($state_index_id,'green',0,2,0) ,
|
||||
array($state_index_id,'yellow',0,3,1) ,
|
||||
array($state_index_id,'red',0,4,2)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$descr = 'LED Status Standby';
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, 'hmLEDRStandby.'.$index, $state_name, $descr, '1', '1', null, null, null, null, $temp, 'snmp', 'hmLEDRStandby.'.$index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, 'hmLEDRStandby.'.$index, $state_name, $descr, 1, 1, null, null, null, null, $temp, 'snmp', 'hmLEDRStandby.'.$index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, 'hmLEDRStandby.'.$index);
|
||||
@@ -131,31 +87,11 @@ if ($device['os'] == 'hirschmann') {
|
||||
if (is_numeric($temp)) {
|
||||
//Create State Index
|
||||
$state_name = 'hmLEDRSRedundancyManager';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'off',0,1,0) ,
|
||||
array($state_index_id,'green',0,2,0) ,
|
||||
array($state_index_id,'yellow',0,3,1) ,
|
||||
array($state_index_id,'red',0,4,2)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$descr = 'LED Status Redundancy Manager';
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, 'hmLEDRSRedundancyManager.'.$index, $state_name, $descr, '1', '1', null, null, null, null, $temp, 'snmp', 'hmLEDRSRedundancyManager.'.$index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, 'hmLEDRSRedundancyManager.'.$index, $state_name, $descr, 1, 1, null, null, null, null, $temp, 'snmp', 'hmLEDRSRedundancyManager.'.$index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, 'hmLEDRSRedundancyManager.'.$index);
|
||||
@@ -171,31 +107,11 @@ if ($device['os'] == 'hirschmann') {
|
||||
if (is_numeric($temp)) {
|
||||
//Create State Index
|
||||
$state_name = 'hmLEDRSFault';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'off',0,1,0) ,
|
||||
array($state_index_id,'green',0,2,0) ,
|
||||
array($state_index_id,'yellow',0,3,1) ,
|
||||
array($state_index_id,'red',0,4,2)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
$descr = 'LED Status Fault';
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, 'hmLEDRSFault.'.$index, $state_name, $descr, '1', '1', null, null, null, null, $temp, 'snmp', 'hmLEDRSFault.'.$index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid, 'hmLEDRSFault.'.$index, $state_name, $descr, 1, 1, null, null, null, null, $temp, 'snmp', 'hmLEDRSFault.'.$index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, 'hmLEDRSFault.'.$index);
|
||||
|
@@ -18,28 +18,15 @@ foreach (explode("\n", $fans) as $fan) {
|
||||
$descr = $fan_state_descr.$current_id;
|
||||
$state = snmp_get($device, $current_oid, '-Oqv');
|
||||
if (!empty($state)) {
|
||||
$state_index_id = create_state_index($fan_state_name);
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id, 'other', 0, 1, 3),
|
||||
array($state_index_id, 'ok', 1, 2, 0),
|
||||
array($state_index_id, 'degraded', 1, 3, 1),
|
||||
array($state_index_id, 'failed', 1, 4, 2),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 3, 'graph' => 0, 'descr' => 'other'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 1, 'descr' => 'ok'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 1, 'descr' => 'degraded'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 1, 'descr' => 'failed'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'state', $device, $current_oid, $current_id, $fan_state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $current_id);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $current_oid, $current_id, $fan_state_name, $descr, 1, 1, null, null, null, null, $state, 'snmp', $current_id);
|
||||
create_sensor_to_state_index($device, $fan_state_name, $current_id);
|
||||
}
|
||||
}
|
||||
@@ -63,28 +50,15 @@ foreach (explode("\n", $psus) as $psu) {
|
||||
$descr = $psu_state_descr.$current_id;
|
||||
$state = snmp_get($device, $current_oid, '-Oqv');
|
||||
if (!empty($state)) {
|
||||
$state_index_id = create_state_index($psu_state_name);
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id, 'other', 0, 1, 3),
|
||||
array($state_index_id, 'ok', 1, 2, 0),
|
||||
array($state_index_id, 'degraded', 1, 3, 1),
|
||||
array($state_index_id, 'failed', 1, 4, 2),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 3, 'graph' => 0, 'descr' => 'other'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 1, 'descr' => 'ok'],
|
||||
['value' => 3, 'generic' => 1, 'graph' => 1, 'descr' => 'degraded'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 1, 'descr' => 'failed'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'state', $device, $current_oid, $current_id, $psu_state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $current_id);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $current_oid, $current_id, $psu_state_name, $descr, 1, 1, null, null, null, null, $state, 'snmp', $current_id);
|
||||
create_sensor_to_state_index($device, $psu_state_name, $current_id);
|
||||
}
|
||||
}
|
||||
|
@@ -13,12 +13,12 @@
|
||||
$index = 1;
|
||||
$state_name = 'ibm-amm_BlowerState';
|
||||
$state_descr = 'Blower ';
|
||||
$oids = array(
|
||||
$oids = [
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.10.0', // BLADE-MIB::blower1State.0
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.11.0', // BLADE-MIB::blower2State.0
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.12.0', // BLADE-MIB::blower3State.0
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.13.0', // BLADE-MIB::blower4State.0
|
||||
);
|
||||
];
|
||||
/* BLADE-MIB: blower1State
|
||||
* unknown(0),
|
||||
* good(1),
|
||||
@@ -31,29 +31,15 @@ foreach ($oids as $oid) {
|
||||
$descr = $state_descr . $index;
|
||||
|
||||
if (!empty($state)) {
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id, 'unknown', 0, 0, 3),
|
||||
array($state_index_id, 'good', 1, 1, 0),
|
||||
array($state_index_id, 'warning', 1, 2, 1),
|
||||
array($state_index_id, 'bad', 1, 3, 2),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}//end foreach
|
||||
}//end if
|
||||
$states = [
|
||||
['value' => 0, 'generic' => 3, 'graph' => 0, 'descr' => 'unknown'],
|
||||
['value' => 1, 'generic' => 0, 'graph' => 1, 'descr' => 'good'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 1, 'descr' => 'warning'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 1, 'descr' => 'bad'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $state, 'snmp', $index);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
$index++;
|
||||
@@ -63,12 +49,12 @@ foreach ($oids as $oid) {
|
||||
$index = 1;
|
||||
$state_name = 'ibm-amm_BlowerControllerState';
|
||||
$state_descr = 'Blower Controller ';
|
||||
$oids = array(
|
||||
$oids = [
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.30.0', // BLADE-MIB::blower1ControllerState.0
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.31.0', // BLADE-MIB::blower2ControllerState.0
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.32.0', // BLADE-MIB::blower3ControllerState.0
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.33.0', // BLADE-MIB::blower4ControllerState.0
|
||||
);
|
||||
];
|
||||
|
||||
/* BLADE-MIB: blower1ControllerState
|
||||
* operational(0),
|
||||
@@ -82,30 +68,16 @@ foreach ($oids as $oid) {
|
||||
$descr = $state_descr . $index;
|
||||
|
||||
if (is_numeric($state) && $state != 2) {
|
||||
$state_index_id = create_state_index($state_name);
|
||||
$states = [
|
||||
['value' => 0, 'generic' => 0, 'graph' => 1, 'descr' => 'operational'],
|
||||
['value' => 1, 'generic' => 1, 'graph' => 1, 'descr' => 'flashing'],
|
||||
['value' => 2, 'generic' => -1, 'graph' => 1, 'descr' => 'notPresent'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 1, 'descr' => 'communicationError'],
|
||||
['value' => 255, 'generic' => 3, 'graph' => 0, 'descr' => 'unknown'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id, 'operational', 1, 0, 0),
|
||||
array($state_index_id, 'flashing', 1, 1, 1),
|
||||
array($state_index_id, 'notPresent', 1, 2, -1),
|
||||
array($state_index_id, 'communicationError', 1, 3, 2),
|
||||
array($state_index_id, 'unknown', 0, 255, 3),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}//end foreach
|
||||
}//end if
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $state, 'snmp', $index);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
$index++;
|
||||
@@ -116,7 +88,7 @@ $index = 1;
|
||||
$state_name = 'ibm-amm_PowerModuleState';
|
||||
$state_descr = 'Power Module ';
|
||||
$powerModuleStateOid= '.1.3.6.1.4.1.2.3.51.2.2.4.1.1.3'; // BLADE-MIB::powerModuleState
|
||||
$data = snmpwalk_cache_oid_num($device, $powerModuleStateOid, array());
|
||||
$data = snmpwalk_cache_oid_num($device, $powerModuleStateOid, []);
|
||||
|
||||
/* BLADE-MIB: powerModuleState
|
||||
* unknown(0),
|
||||
@@ -130,30 +102,16 @@ foreach ($data as $oid => $array) {
|
||||
$descr = $state_descr . $index;
|
||||
|
||||
if (is_numeric($state) && $state != 3) {
|
||||
$state_index_id = create_state_index($state_name);
|
||||
$states = [
|
||||
['value' => 0, 'generic' => 3, 'graph' => 0, 'descr' => 'unknown'],
|
||||
['value' => 1, 'generic' => 0, 'graph' => 1, 'descr' => 'good'],
|
||||
['value' => 2, 'generic' => 1, 'graph' => 1, 'descr' => 'warning'],
|
||||
['value' => 3, 'generic' => -1, 'graph' => 1, 'descr' => 'notAvailable'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 1, 'descr' => 'critical'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id, 'unknown', 0, 0, 3),
|
||||
array($state_index_id, 'good', 1, 1, 0),
|
||||
array($state_index_id, 'warning', 1, 2, 1),
|
||||
array($state_index_id, 'notAvailable', 1, 3, -1),
|
||||
array($state_index_id, 'critical', 1, 4, 2),
|
||||
);
|
||||
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}//end foreach
|
||||
}//end if
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $state, 'snmp', $index);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
$index++;
|
||||
|
@@ -23,28 +23,15 @@
|
||||
* @author Lorenzo Zafra<zafra@ualberta.ca>
|
||||
*/
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'outputEntry', array(), 'ICT-DISTRIBUTION-PANEL-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'outputEntry', [], 'ICT-DISTRIBUTION-PANEL-MIB');
|
||||
|
||||
if (is_array($oids)) {
|
||||
$state_name = 'outputFuseStatus';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id) {
|
||||
$states = array(
|
||||
array($state_index_id, 'OK', 0, 1, 0) ,
|
||||
array($state_index_id, 'OPEN', 0, 2, 2)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'OK'],
|
||||
['value' => 2, 'generic' => 2, 'graph' => 0, 'descr' => 'OPEN'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($oids as $index => $entry) {
|
||||
$fuse_state_oid = '.1.3.6.1.4.1.39145.10.8.1.4.' . $index;
|
||||
@@ -58,7 +45,7 @@ if (is_array($oids)) {
|
||||
$current_value = 2;
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $fuse_state_oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $current_value, 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $fuse_state_oid, $index, $state_name, $descr, 1, 1, null, null, null, null, $current_value, 'snmp', $index);
|
||||
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
|
@@ -10,32 +10,18 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'snChasPwrSupplyTable', array(), 'FOUNDRY-SN-AGENT-MIB');
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'snChasPwrSupplyTable', [], 'FOUNDRY-SN-AGENT-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.1991.1.1.1.2.1.1.3.';
|
||||
|
||||
if (is_array($temp)) {
|
||||
//Create State Index
|
||||
$state_name = 'snChasPwrSupplyOperStatus';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'other',0,1,3) ,
|
||||
array($state_index_id,'normal',0,2,0) ,
|
||||
array($state_index_id,'failure',0,3,2)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 3, 'graph' => 0, 'descr' => 'other'],
|
||||
['value' => 2, 'generic' => 0, 'graph' => 0, 'descr' => 'normal'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'failure'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($temp as $index => $entry) {
|
||||
//Discover Sensors
|
||||
@@ -43,7 +29,7 @@ if (is_array($temp)) {
|
||||
if (empty($descr)) {
|
||||
$descr = "Power Supply " . $index;
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp[$index]['snChasPwrSupplyOperStatus'], 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, 1, 1, null, null, null, null, $temp[$index]['snChasPwrSupplyOperStatus'], 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
|
@@ -10,39 +10,25 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'trpzSysPowerSupplyTable', array(), 'TRAPEZE-NETWORKS-SYSTEM-MIB');
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'trpzSysPowerSupplyTable', [], 'TRAPEZE-NETWORKS-SYSTEM-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.14525.4.8.1.1.13.1.2.1.2.';
|
||||
|
||||
if (is_array($temp)) {
|
||||
//Create State Index
|
||||
$state_name = 'trpzSysPowerSupplyStatus';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id, 'other', 0, 1, 1),
|
||||
array($state_index_id, 'unknown', 0, 2, 3),
|
||||
array($state_index_id, 'ac-failed', 0, 3, 2),
|
||||
array($state_index_id, 'dc-failed', 0, 4, 2),
|
||||
array($state_index_id, 'ac-ok-dc-ok', 0, 5, 0)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
$states = [
|
||||
['value' => 1, 'generic' => 1, 'graph' => 0, 'descr' => 'other'],
|
||||
['value' => 2, 'generic' => 3, 'graph' => 0, 'descr' => 'unknown'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 0, 'descr' => 'ac-failed'],
|
||||
['value' => 4, 'generic' => 2, 'graph' => 0, 'descr' => 'dc-failed'],
|
||||
['value' => 5, 'generic' => 0, 'graph' => 0, 'descr' => 'ac-ok-dc-ok'],
|
||||
];
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
foreach ($temp as $index => $entry) {
|
||||
$descr = $temp[$index]['trpzSysPowerSupplyDescr'];
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid . $index, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp[$index]['trpzSysPowerSupplyStatus'], 'snmp', $index);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid . $index, $index, $state_name, $descr, 1, 1, null, null, null, null, $temp[$index]['trpzSysPowerSupplyStatus'], 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user