mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Sensors remove reliance on global variable (#16344)
* Sensors remove reliance on global variable * Apply fixes from StyleCI * Clear the instance instead of reset. Remove $valid['sensors'] from docs --------- Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
This commit is contained in:
@@ -197,10 +197,8 @@ function discover_device(&$device, $force_module = false)
|
||||
//end discover_device()
|
||||
|
||||
// Discover sensors
|
||||
function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr, $divisor = 1, $multiplier = 1, $low_limit = null, $low_warn_limit = null, $warn_limit = null, $high_limit = null, $current = null, $poller_type = 'snmp', $entPhysicalIndex = null, $entPhysicalIndex_measured = null, $user_func = null, $group = null, $rrd_type = 'GAUGE')
|
||||
function discover_sensor($unused, $class, $device, $oid, $index, $type, $descr, $divisor = 1, $multiplier = 1, $low_limit = null, $low_warn_limit = null, $warn_limit = null, $high_limit = null, $current = null, $poller_type = 'snmp', $entPhysicalIndex = null, $entPhysicalIndex_measured = null, $user_func = null, $group = null, $rrd_type = 'GAUGE'): bool
|
||||
{
|
||||
$guess_limits = Config::get('sensors.guess_limits', true);
|
||||
|
||||
$low_limit = set_null($low_limit);
|
||||
$low_warn_limit = set_null($low_warn_limit);
|
||||
$warn_limit = set_null($warn_limit);
|
||||
@@ -216,257 +214,31 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
|
||||
|
||||
d_echo("Discover sensor: $oid, $index, $type, $descr, $poller_type, $divisor, $multiplier, $entPhysicalIndex, $current, (limits: LL: $low_limit, LW: $low_warn_limit, W: $warn_limit, H: $high_limit), rrd_type = $rrd_type \n");
|
||||
|
||||
if (isset($warn_limit, $low_warn_limit) && $low_warn_limit > $warn_limit) {
|
||||
// Fix high/low thresholds (i.e. on negative numbers)
|
||||
[$warn_limit, $low_warn_limit] = [$low_warn_limit, $warn_limit];
|
||||
}
|
||||
app('sensor-discovery')->discover(new \App\Models\Sensor([
|
||||
'poller_type' => $poller_type,
|
||||
'sensor_class' => $class,
|
||||
'device_id' => $device['device_id'],
|
||||
'sensor_oid' => $oid,
|
||||
'sensor_index' => $index,
|
||||
'sensor_type' => $type,
|
||||
'sensor_descr' => $descr,
|
||||
'sensor_divisor' => $divisor,
|
||||
'sensor_multiplier' => $multiplier,
|
||||
'sensor_limit' => $high_limit,
|
||||
'sensor_limit_warn' => $warn_limit,
|
||||
'sensor_limit_low' => $low_limit,
|
||||
'sensor_limit_low_warn' => $low_warn_limit,
|
||||
'sensor_current' => $current,
|
||||
'entPhysicalIndex' => $entPhysicalIndex,
|
||||
'entPhysicalIndex_measured' => $entPhysicalIndex_measured,
|
||||
'user_func' => $user_func,
|
||||
'group' => $group,
|
||||
'rrd_type' => $rrd_type,
|
||||
]));
|
||||
|
||||
if (dbFetchCell('SELECT COUNT(sensor_id) FROM `sensors` WHERE `poller_type`= ? AND `sensor_class` = ? AND `device_id` = ? AND sensor_type = ? AND `sensor_index` = ?', [$poller_type, $class, $device['device_id'], $type, (string) $index]) == '0') {
|
||||
if ($guess_limits && is_null($high_limit)) {
|
||||
$high_limit = sensor_limit($class, $current);
|
||||
}
|
||||
|
||||
if ($guess_limits && is_null($low_limit)) {
|
||||
$low_limit = sensor_low_limit($class, $current);
|
||||
}
|
||||
|
||||
if (! is_null($high_limit) && $low_limit > $high_limit) {
|
||||
// Fix high/low thresholds (i.e. on negative numbers)
|
||||
[$high_limit, $low_limit] = [$low_limit, $high_limit];
|
||||
}
|
||||
|
||||
$insert = [
|
||||
'poller_type' => $poller_type,
|
||||
'sensor_class' => $class,
|
||||
'device_id' => $device['device_id'],
|
||||
'sensor_oid' => $oid,
|
||||
'sensor_index' => $index,
|
||||
'sensor_type' => $type,
|
||||
'sensor_descr' => $descr,
|
||||
'sensor_divisor' => $divisor,
|
||||
'sensor_multiplier' => $multiplier,
|
||||
'sensor_limit' => $high_limit,
|
||||
'sensor_limit_warn' => $warn_limit,
|
||||
'sensor_limit_low' => $low_limit,
|
||||
'sensor_limit_low_warn' => $low_warn_limit,
|
||||
'sensor_current' => $current,
|
||||
'entPhysicalIndex' => $entPhysicalIndex,
|
||||
'entPhysicalIndex_measured' => $entPhysicalIndex_measured,
|
||||
'user_func' => $user_func,
|
||||
'group' => $group,
|
||||
'rrd_type' => $rrd_type,
|
||||
];
|
||||
|
||||
$inserted = dbInsert($insert, 'sensors');
|
||||
|
||||
d_echo("( $inserted inserted )\n");
|
||||
|
||||
echo '+';
|
||||
log_event('Sensor Added: ' . $class . ' ' . $type . ' ' . $index . ' ' . $descr, $device, 'sensor', 3, $inserted);
|
||||
} else {
|
||||
$sensor_entry = dbFetchRow('SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ? AND `sensor_type` = ? AND `sensor_index` = ?', [$class, $device['device_id'], $type, (string) $index]);
|
||||
|
||||
if (! isset($high_limit)) {
|
||||
if ($guess_limits && ! $sensor_entry['sensor_limit']) {
|
||||
// Calculate a reasonable limit
|
||||
$high_limit = sensor_limit($class, $current);
|
||||
} else {
|
||||
// Use existing limit
|
||||
$high_limit = $sensor_entry['sensor_limit'];
|
||||
}
|
||||
}
|
||||
|
||||
if (! isset($low_limit)) {
|
||||
if ($guess_limits && ! $sensor_entry['sensor_limit_low']) {
|
||||
// Calculate a reasonable limit
|
||||
$low_limit = sensor_low_limit($class, $current);
|
||||
} else {
|
||||
// Use existing limit
|
||||
$low_limit = $sensor_entry['sensor_limit_low'];
|
||||
}
|
||||
}
|
||||
|
||||
// Fix high/low thresholds (i.e. on negative numbers)
|
||||
if (isset($high_limit) && $low_limit > $high_limit) {
|
||||
[$high_limit, $low_limit] = [$low_limit, $high_limit];
|
||||
}
|
||||
|
||||
if ((string) $high_limit != (string) $sensor_entry['sensor_limit'] && $sensor_entry['sensor_custom'] == 'No') {
|
||||
$update = ['sensor_limit' => $high_limit];
|
||||
$updated = dbUpdate($update, 'sensors', '`sensor_id` = ?', [$sensor_entry['sensor_id']]);
|
||||
d_echo("( $updated updated )\n");
|
||||
|
||||
echo 'H';
|
||||
log_event('Sensor High Limit Updated: ' . $class . ' ' . $type . ' ' . $index . ' ' . $descr . ' (' . $high_limit . ')', $device, 'sensor', 3, $sensor_entry['sensor_id']);
|
||||
}
|
||||
|
||||
if ((string) $sensor_entry['sensor_limit_low'] != (string) $low_limit && $sensor_entry['sensor_custom'] == 'No') {
|
||||
$update = ['sensor_limit_low' => $low_limit];
|
||||
$updated = dbUpdate($update, 'sensors', '`sensor_id` = ?', [$sensor_entry['sensor_id']]);
|
||||
d_echo("( $updated updated )\n");
|
||||
|
||||
echo 'L';
|
||||
log_event('Sensor Low Limit Updated: ' . $class . ' ' . $type . ' ' . $index . ' ' . $descr . ' (' . $low_limit . ')', $device, 'sensor', 3, $sensor_entry['sensor_id']);
|
||||
}
|
||||
|
||||
if ((string) $warn_limit != (string) $sensor_entry['sensor_limit_warn'] && $sensor_entry['sensor_custom'] == 'No') {
|
||||
$update = ['sensor_limit_warn' => $warn_limit];
|
||||
$updated = dbUpdate($update, 'sensors', '`sensor_id` = ?', [$sensor_entry['sensor_id']]);
|
||||
d_echo("( $updated updated )\n");
|
||||
|
||||
echo 'WH';
|
||||
log_event('Sensor Warn High Limit Updated: ' . $class . ' ' . $type . ' ' . $index . ' ' . $descr . ' (' . $warn_limit . ')', $device, 'sensor', 3, $sensor_entry['sensor_id']);
|
||||
}
|
||||
|
||||
if ((string) $sensor_entry['sensor_limit_low_warn'] != (string) $low_warn_limit && $sensor_entry['sensor_custom'] == 'No') {
|
||||
$update = ['sensor_limit_low_warn' => $low_warn_limit];
|
||||
$updated = dbUpdate($update, 'sensors', '`sensor_id` = ?', [$sensor_entry['sensor_id']]);
|
||||
d_echo("( $updated updated )\n");
|
||||
|
||||
echo 'WL';
|
||||
log_event('Sensor Warn Low Limit Updated: ' . $class . ' ' . $type . ' ' . $index . ' ' . $descr . ' (' . $low_warn_limit . ')', $device, 'sensor', 3, $sensor_entry['sensor_id']);
|
||||
}
|
||||
|
||||
if ($oid == $sensor_entry['sensor_oid'] &&
|
||||
$descr == $sensor_entry['sensor_descr'] &&
|
||||
$multiplier == $sensor_entry['sensor_multiplier'] &&
|
||||
$divisor == $sensor_entry['sensor_divisor'] &&
|
||||
$entPhysicalIndex_measured == $sensor_entry['entPhysicalIndex_measured'] &&
|
||||
$entPhysicalIndex == $sensor_entry['entPhysicalIndex'] &&
|
||||
$user_func == $sensor_entry['user_func'] &&
|
||||
$group == $sensor_entry['group']
|
||||
|
||||
) {
|
||||
echo '.';
|
||||
} else {
|
||||
$update = [
|
||||
'sensor_oid' => $oid,
|
||||
'sensor_descr' => $descr,
|
||||
'sensor_multiplier' => $multiplier,
|
||||
'sensor_divisor' => $divisor,
|
||||
'entPhysicalIndex' => $entPhysicalIndex,
|
||||
'entPhysicalIndex_measured' => $entPhysicalIndex_measured,
|
||||
'user_func' => $user_func,
|
||||
'group' => $group,
|
||||
];
|
||||
$updated = dbUpdate($update, 'sensors', '`sensor_id` = ?', [$sensor_entry['sensor_id']]);
|
||||
echo 'U';
|
||||
log_event('Sensor Updated: ' . $class . ' ' . $type . ' ' . $index . ' ' . $descr, $device, 'sensor', 3, $sensor_entry['sensor_id']);
|
||||
d_echo("( $updated updated )\n");
|
||||
}
|
||||
}//end if
|
||||
$valid[$class][$type][$index] = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
//end discover_sensor()
|
||||
|
||||
function sensor_low_limit($class, $current)
|
||||
{
|
||||
// matching an empty case executes code until a break is reached
|
||||
switch ($class) {
|
||||
case 'temperature':
|
||||
$limit = $current - 10;
|
||||
break;
|
||||
case 'voltage':
|
||||
$limit = $current * 0.85;
|
||||
break;
|
||||
case 'humidity':
|
||||
$limit = 30;
|
||||
break;
|
||||
case 'fanspeed':
|
||||
$limit = $current * 0.80;
|
||||
break;
|
||||
case 'power_factor':
|
||||
$limit = -1;
|
||||
break;
|
||||
case 'signal':
|
||||
$limit = -80;
|
||||
break;
|
||||
case 'airflow':
|
||||
case 'snr':
|
||||
case 'frequency':
|
||||
case 'pressure':
|
||||
case 'cooling':
|
||||
$limit = $current * 0.95;
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}//end switch
|
||||
|
||||
return round($limit, 11);
|
||||
}
|
||||
|
||||
//end sensor_low_limit()
|
||||
|
||||
function sensor_limit($class, $current)
|
||||
{
|
||||
// matching an empty case executes code until a break is reached
|
||||
switch ($class) {
|
||||
case 'temperature':
|
||||
$limit = $current + 20;
|
||||
break;
|
||||
case 'voltage':
|
||||
$limit = $current * 1.15;
|
||||
break;
|
||||
case 'humidity':
|
||||
$limit = 70;
|
||||
break;
|
||||
case 'fanspeed':
|
||||
$limit = $current * 1.80;
|
||||
break;
|
||||
case 'power_factor':
|
||||
$limit = 1;
|
||||
break;
|
||||
case 'signal':
|
||||
$limit = -30;
|
||||
break;
|
||||
case 'load':
|
||||
$limit = 80;
|
||||
break;
|
||||
case 'airflow':
|
||||
case 'snr':
|
||||
case 'frequency':
|
||||
case 'pressure':
|
||||
case 'cooling':
|
||||
$limit = $current * 1.05;
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}//end switch
|
||||
|
||||
return round($limit, 11);
|
||||
}
|
||||
|
||||
//end sensor_limit()
|
||||
|
||||
function check_valid_sensors($device, $class, $valid, $poller_type = 'snmp')
|
||||
{
|
||||
$entries = dbFetchRows('SELECT * FROM sensors AS S, devices AS D WHERE S.sensor_class=? AND S.device_id = D.device_id AND D.device_id = ? AND S.poller_type = ?', [$class, $device['device_id'], $poller_type]);
|
||||
|
||||
if (count($entries)) {
|
||||
foreach ($entries as $entry) {
|
||||
$index = $entry['sensor_index'];
|
||||
$type = $entry['sensor_type'];
|
||||
$class = $entry['sensor_class'];
|
||||
d_echo($index . ' -> ' . $type . "\n");
|
||||
|
||||
if (! $valid[$class][$type][$index]) {
|
||||
echo '-';
|
||||
if ($class == 'state') {
|
||||
dbDelete('sensors_to_state_indexes', '`sensor_id` = ?', [$entry['sensor_id']]);
|
||||
}
|
||||
dbDelete('sensors', '`sensor_id` = ?', [$entry['sensor_id']]);
|
||||
log_event('Sensor Deleted: ' . $entry['sensor_class'] . ' ' . $entry['sensor_type'] . ' ' . $entry['sensor_index'] . ' ' . $entry['sensor_descr'], $device, 'sensor', 3, $entry['sensor_id']);
|
||||
}
|
||||
|
||||
unset($oid);
|
||||
unset($type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//end check_valid_sensors()
|
||||
|
||||
function discover_juniAtmVp(&$valid, $device, $port_id, $vp_id, $vp_descr)
|
||||
{
|
||||
d_echo("Discover Juniper ATM VP: $port_id, $vp_id, $vp_descr\n");
|
||||
@@ -854,12 +626,11 @@ function ignore_storage($os, $descr)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $valid
|
||||
* @param OS $os
|
||||
* @param $sensor_type
|
||||
* @param $pre_cache
|
||||
*/
|
||||
function discovery_process(&$valid, $os, $sensor_class, $pre_cache)
|
||||
function discovery_process($os, $sensor_class, $pre_cache)
|
||||
{
|
||||
$discovery = $os->getDiscovery('sensors');
|
||||
$device = $os->getDeviceArray();
|
||||
@@ -998,7 +769,7 @@ function discovery_process(&$valid, $os, $sensor_class, $pre_cache)
|
||||
}
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], $sensor_class, $device, $oid, $uindex, $sensor_name, $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured, $user_function, $group, $data['rrd_type'] ?? 'GAUGE');
|
||||
discover_sensor(null, $sensor_class, $device, $oid, $uindex, $sensor_name, $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured, $user_function, $group, $data['rrd_type'] ?? 'GAUGE');
|
||||
|
||||
if ($sensor_class === 'state') {
|
||||
create_sensor_to_state_index($device, $sensor_name, $uindex);
|
||||
@@ -1014,7 +785,7 @@ function discovery_process(&$valid, $os, $sensor_class, $pre_cache)
|
||||
* @param OS $os
|
||||
* @param array $pre_cache
|
||||
*/
|
||||
function sensors($types, $os, $valid, $pre_cache = [])
|
||||
function sensors($types, $os, $pre_cache = [])
|
||||
{
|
||||
$device = &$os->getDeviceArray();
|
||||
foreach ((array) $types as $sensor_class) {
|
||||
@@ -1032,9 +803,8 @@ function sensors($types, $os, $valid, $pre_cache = [])
|
||||
include $dir . '/rfc1628.inc.php';
|
||||
}
|
||||
}
|
||||
discovery_process($valid, $os, $sensor_class, $pre_cache);
|
||||
d_echo($valid['sensor'][$sensor_class] ?? []);
|
||||
check_valid_sensors($device, $sensor_class, $valid['sensor']);
|
||||
discovery_process($os, $sensor_class, $pre_cache);
|
||||
app('sensor-discovery')->sync(sensor_class: $sensor_class, poller_type: 'snmp');
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
@@ -3,8 +3,6 @@
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\OS;
|
||||
|
||||
$valid['sensor'] = [];
|
||||
|
||||
/** @var OS $os */
|
||||
$pre_cache = $os->preCache();
|
||||
|
||||
@@ -84,7 +82,7 @@ $run_sensors = [
|
||||
// filter submodules
|
||||
$run_sensors = array_intersect($run_sensors, Config::get('discovery_submodules.sensors', $run_sensors));
|
||||
|
||||
sensors($run_sensors, $os, $valid, $pre_cache);
|
||||
sensors($run_sensors, $os, $pre_cache);
|
||||
unset(
|
||||
$pre_cache,
|
||||
$run_sensors,
|
||||
|
@@ -28,6 +28,6 @@ foreach ($pre_cache['cooling_unit_analog'] as $index => $data) {
|
||||
$scale = $data['coolingUnitStatusAnalogScale'] ?? null;
|
||||
$value = $data['coolingUnitStatusAnalogValue'] ?? null;
|
||||
if (preg_match('/Airflow/', $descr) && $data['coolingUnitStatusAnalogUnits'] == 'CFM' && $value >= 0) {
|
||||
discover_sensor($valid['sensor'], 'airflow', $device, $cur_oid, $cur_oid, 'apc', $descr, $scale, 1, null, null, null, null, $value);
|
||||
discover_sensor(null, 'airflow', $device, $cur_oid, $cur_oid, 'apc', $descr, $scale, 1, null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
@@ -26,5 +26,5 @@ $value = snmp_get($device, 'climateAirflow', '-Oqv', 'GEIST-MIB-V3');
|
||||
$current_oid = '.1.3.6.1.4.1.21239.2.2.1.9.1';
|
||||
$descr = 'Airflow';
|
||||
if (is_numeric($value)) {
|
||||
discover_sensor($valid['sensor'], 'airflow', $device, $current_oid, 'climateAirflow', 'geist-watchdog', $descr, 1, 1, null, null, null, null, $value);
|
||||
discover_sensor(null, 'airflow', $device, $current_oid, 'climateAirflow', 'geist-watchdog', $descr, 1, 1, null, null, null, null, $value);
|
||||
}
|
||||
|
@@ -30,6 +30,6 @@ foreach ($pre_cache['infineragroove_portTable'] as $index => $data) {
|
||||
$oid = '.1.3.6.1.4.1.42229.1.2.4.1.19.1.1.26.' . $index;
|
||||
$value = $data['ochOsPreFecBer'];
|
||||
$divisor = 1;
|
||||
discover_sensor($valid['sensor'], 'ber', $device, $oid, 'ochOsPreFecBer.' . $index, 'infinera-groove', $descr, $divisor, '1', null, null, null, null, $value);
|
||||
discover_sensor(null, 'ber', $device, $oid, 'ochOsPreFecBer.' . $index, 'infinera-groove', $descr, $divisor, '1', null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
@@ -67,7 +67,7 @@ if (is_array($pre_cache['transfer'])) {
|
||||
$limitwarn = $defrate * 0.8; //80%
|
||||
$lowlimit = 0;
|
||||
$lowwarnlimit = $defrate * 0.1; //10%
|
||||
discover_sensor($valid['sensor'], 'bitrate', $device, $oid, $key, $type, $descr, $divisor, 1, $lowlimit, $lowwarnlimit, $limitwarn, $limit, $value, 'snmp', null, null, null, $group);
|
||||
discover_sensor(null, 'bitrate', $device, $oid, $key, $type, $descr, $divisor, 1, $lowlimit, $lowwarnlimit, $limitwarn, $limit, $value, 'snmp', null, null, null, $group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ if (is_array($pre_cache['sdi410cstatus'])) {
|
||||
$value = $br * $multiplier;
|
||||
$group = 'Streams';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'bitrate',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -42,7 +42,7 @@ if (is_array($pre_cache['sdi480status'])) {
|
||||
$value = $br * $multiplier;
|
||||
$group = 'Inputs';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'bitrate',
|
||||
$device,
|
||||
$oid,
|
||||
@@ -75,7 +75,7 @@ if (is_array($pre_cache['sdi480status'])) {
|
||||
$value = $br * $multiplier;
|
||||
$group = 'Streams';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'bitrate',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -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(null, '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(null, 'charge', $device, $current_oid, $index, $sensorType, $descr, $precision, 1, $lowlimit, $warnlimit, null, $limit, $current_val);
|
||||
}
|
||||
}//end if
|
||||
|
@@ -28,5 +28,5 @@ $index = 0;
|
||||
if (is_numeric($chargeCapacity)) {
|
||||
$sensorType = 'compas';
|
||||
$descr = 'Battery Charge';
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $curOID, $index, $sensorType, $descr, '1', '1', null, null, null, null, $chargeCapacity);
|
||||
discover_sensor(null, 'charge', $device, $curOID, $index, $sensorType, $descr, '1', '1', null, null, null, null, $chargeCapacity);
|
||||
}
|
||||
|
@@ -24,5 +24,5 @@ $ups_device_model = str_replace('"', '', snmp_get($device, $ups_device_model_oid
|
||||
$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(null, 'charge', $device, $ups_charge_oid, 'UPSChargeValue', $ups_device_manufacturer . ' ' . $ups_device_model, 'UPS Charge Value', 1, 1, 0, 10, null, 100, $ups_charge);
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ if (! empty($charge)) {
|
||||
$descr = 'Battery Charge';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'charge',
|
||||
$device,
|
||||
$charge_oid,
|
||||
|
@@ -40,7 +40,7 @@ if ($oids) {
|
||||
$lowwarnlimit = 10;
|
||||
$descr = 'Battery Charge';
|
||||
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $oid, $index, $type, $descr, 1, 1, $lowlimit, $lowwarnlimit, $limitwarn, $limit, $value);
|
||||
discover_sensor(null, 'charge', $device, $oid, $index, $type, $descr, 1, 1, $lowlimit, $lowwarnlimit, $limitwarn, $limit, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -11,6 +11,6 @@ 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(null, 'charge', $device, $oid . $index, $index, $sensor_type, $descr, 1, 1, $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
|
||||
}
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ if (! empty($charge)) {
|
||||
$descr = 'Battery Charge';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'charge',
|
||||
$device,
|
||||
$charge_oid,
|
||||
|
@@ -7,7 +7,7 @@ $value = snmp_get($device, 'upsEstimatedChargeRemaining.0', '-OvqU', 'UPS-MIB');
|
||||
|
||||
if (is_numeric($value)) {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'charge',
|
||||
$device,
|
||||
'.1.3.6.1.2.1.33.1.2.4.0',
|
||||
|
@@ -34,7 +34,7 @@ if (! empty($charge)) {
|
||||
$descr = 'Battery Charge';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'charge',
|
||||
$device,
|
||||
$charge_oid,
|
||||
|
@@ -36,7 +36,7 @@ if (! empty($snmpData)) {
|
||||
if (! empty($value)) {
|
||||
$oid = Oid::toNumeric('NET-SNMP-EXTEND-MIB::nsExtendOutLine."ups-nut".' . $index);
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'charge',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -27,6 +27,6 @@ foreach ($pre_cache['infineragroove_portTable'] as $index => $data) {
|
||||
$descr = $data['portAlias'] . ' CD';
|
||||
$oid = '.1.3.6.1.4.1.42229.1.2.4.1.19.1.1.23.' . $index;
|
||||
$value = $data['ochOsCD'];
|
||||
discover_sensor($valid['sensor'], 'chromatic_dispersion', $device, $oid, 'ochOsCD.' . $index, 'infinera-groove', $descr, null, '1', null, null, null, null, $value);
|
||||
discover_sensor(null, 'chromatic_dispersion', $device, $oid, 'ochOsCD.' . $index, 'infinera-groove', $descr, null, '1', null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
@@ -222,7 +222,7 @@ if ($device['os_group'] == 'cisco') {
|
||||
}
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], $type, $device, $oid, $index, 'cisco-entity-sensor', ucwords($descr), $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entry['entSensorMeasuredEntity'], null);
|
||||
discover_sensor(null, $type, $device, $oid, $index, 'cisco-entity-sensor', ucwords($descr), $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entry['entSensorMeasuredEntity'], null);
|
||||
//Cisco IOS-XR : add a fake sensor to graph as dbm
|
||||
if ($type == 'power' and $device['os'] == 'iosxr' and (preg_match('/power (R|T)x/i', $descr) or preg_match('/(R|T)x Power/i', $descr) or preg_match('/(R|T)x Lane/i', $descr))) {
|
||||
// convert Watts to dbm
|
||||
@@ -235,7 +235,7 @@ if ($device['os_group'] == 'cisco') {
|
||||
$limit = isset($limit_low) ? round(mw_to_dbm($limit * $multiplier), 3) : null;
|
||||
$current = mw_to_dbm($current * $multiplier);
|
||||
//echo("\n".$valid['sensor'].", $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, $user_func");
|
||||
discover_sensor($valid['sensor'], $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entry['entSensorMeasuredEntity'], $user_func);
|
||||
discover_sensor(null, $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entry['entSensorMeasuredEntity'], $user_func);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,4 +247,8 @@ if ($device['os_group'] == 'cisco') {
|
||||
unset(
|
||||
$entity_array
|
||||
);
|
||||
|
||||
foreach (array_flip($entitysensor) as $type) {
|
||||
app('sensor-discovery')->sync(sensor_class: $type, poller_type: 'snmp');
|
||||
}
|
||||
}//end if
|
||||
|
@@ -19,7 +19,7 @@ use Illuminate\Support\Str;
|
||||
|
||||
if (Str::startsWith($device['sysObjectID'], '.1.3.6.1.4.1.25766')) {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'count',
|
||||
$device,
|
||||
'.1.3.6.1.4.1.25766.1.12.1.1.3.5.1.6.1',
|
||||
|
@@ -31,6 +31,6 @@ foreach ($tables as $tablevalue) {
|
||||
} else {
|
||||
$descr = ucwords($temp[$index][$tablevalue['descr']]);
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'count', $device, $cur_oid . $index, $index, $state_name, $descr, 1, 1, null, null, null, null, $temp[$index][$tablevalue['state_name']], 'snmp', $index);
|
||||
discover_sensor(null, 'count', $device, $cur_oid . $index, $index, $state_name, $descr, 1, 1, null, null, null, null, $temp[$index][$tablevalue['state_name']], 'snmp', $index);
|
||||
}
|
||||
}
|
||||
|
@@ -69,7 +69,7 @@ foreach ($oids as $index => $entry) {
|
||||
|
||||
if (! empty($current) && $current !== 'FULL:0') {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
$class,
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -19,7 +19,7 @@ use Illuminate\Support\Str;
|
||||
|
||||
if (Str::startsWith($device['sysObjectID'], '.1.3.6.1.4.1.1248.4.1')) {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'count',
|
||||
$device,
|
||||
'.1.3.6.1.4.1.1248.4.1.1.1.1.0',
|
||||
|
@@ -24,7 +24,7 @@ if (! empty($licenseOids)) {
|
||||
$descr = $entry['fgLicContractDesc'];
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'count',
|
||||
$device,
|
||||
'.1.3.6.1.4.1.12356.101.4.6.3.1.2.1.2.' . $index,
|
||||
@@ -64,7 +64,7 @@ foreach ($session_rate as $descr => $oid) {
|
||||
$result = str_replace(' Sessions Per Second', '', $result);
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'count',
|
||||
$device,
|
||||
$oid_num . '.0',
|
||||
@@ -97,7 +97,7 @@ if ($systemMode == 'activePassive' || $systemMode == 'activeActive') {
|
||||
|
||||
// Create a count sensor and set warning to current cluster count
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'count',
|
||||
$device,
|
||||
$fgHaStatsIndex_num,
|
||||
|
@@ -15,7 +15,7 @@ $walk = snmpwalk_cache_oid($device, 'prtMarkerTable', [], 'Printer-MIB');
|
||||
|
||||
foreach ($walk as $index => $data) {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'count',
|
||||
$device,
|
||||
'.1.3.6.1.2.1.43.10.2.1.4.' . $index, // Printer-MIB::prtMarkerLifeCount.1.1
|
||||
@@ -32,7 +32,7 @@ foreach ($walk as $index => $data) {
|
||||
);
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'count',
|
||||
$device,
|
||||
'.1.3.6.1.2.1.43.10.2.1.5.' . $index, // Printer-MIB::prtMarkerPowerOnCount.1.1
|
||||
@@ -68,7 +68,7 @@ if ($device['os'] == 'konica') {
|
||||
$oidArray = explode('.', $oid);
|
||||
$maxKey = max(array_keys($oidArray));
|
||||
$index = str_replace(' ', '', ucwords($cntName)) . '.' . $oidArray[$maxKey - 1] . '.' . $oidArray[$maxKey];
|
||||
discover_sensor($valid['sensor'], 'count', $device, $oid, $index, $device['os'], $cntName, 1, 1, null, null, null, null, $value, 'snmp', null, null, null, 'Konica MIB');
|
||||
discover_sensor(null, 'count', $device, $oid, $index, $device['os'], $cntName, 1, 1, null, null, null, null, $value, 'snmp', null, null, null, 'Konica MIB');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ if (Str::startsWith($device['sysObjectID'], '.1.3.6.1.4.1.8741.6')) {
|
||||
$current = snmp_get($device, '.1.3.6.1.4.1.8741.6.2.1.9.0', '-Ovq');
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'count',
|
||||
$device,
|
||||
'.1.3.6.1.4.1.8741.6.2.1.9.0', // SNWL-SSLVPN-MIB::activeUserLicense.0
|
||||
|
@@ -42,7 +42,7 @@ foreach ($prefixes as $prefix => $numOidPrefix) {
|
||||
if ($oid[$prefix . 'Units']) {
|
||||
$descr .= '(' . $oid[$prefix . 'Units'] . ')';
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'count', $device, $num_oid, $prefix . 'LiveRaw.' . $index, 'webmon', $descr, '1', '1', $lowLimit, $lowWarnLimit, $highWarnLimit, $highLimit, $value, 'snmp', null, null, null, $group);
|
||||
discover_sensor(null, 'count', $device, $num_oid, $prefix . 'LiveRaw.' . $index, 'webmon', $descr, '1', '1', $lowLimit, $lowWarnLimit, $highWarnLimit, $highLimit, $value, 'snmp', null, null, null, $group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ foreach (array_keys($pre_cache['adva_fsp150']) as $index) {
|
||||
$current = $pre_cache['adva_fsp150'][$index][$entry['sensor_name']] / $divisor;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
@@ -73,7 +73,7 @@ foreach ($pre_cache['adva_fsp150_ports'] as $index => $entry) {
|
||||
$descr = ($pre_cache['adva_fsp150_ifName'][$entry['cmEthernetNetPortIfIndex']]['ifName'] ?? 'ifIndex ' . $entry['cmEthernetNetPortIfIndex']) . ' BIAS';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
@@ -102,7 +102,7 @@ foreach ($pre_cache['adva_fsp150_ports'] as $index => $entry) {
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
$descr = ($pre_cache['adva_fsp150_ifName'][$entry['cmEthernetAccPortIfIndex']]['ifName'] ?? 'ifIndex ' . $entry['cmEthernetAccPortIfIndex']) . ' BIAS';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
@@ -132,7 +132,7 @@ foreach ($pre_cache['adva_fsp150_ports'] as $index => $entry) {
|
||||
$descr = ($pre_cache['adva_fsp150_ifName'][$entry['cmEthernetTrafficPortIfIndex']]['ifName'] ?? 'ifIndex ' . $entry['cmEthernetTrafficPortIfIndex']) . ' BIAS';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -31,7 +31,7 @@ if (is_array($pre_cache['adva_fsp3kr7_Card'])) {
|
||||
$current = $pre_cache['adva_fsp3kr7_Card'][$index]['eqptPhysInstValuePsuAmpere'] / $divisor;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -39,7 +39,7 @@ if (isset($oids) && $oids) {
|
||||
} else {
|
||||
$descr = 'Output';
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ if (isset($oids) && $oids) {
|
||||
} else {
|
||||
$descr = 'Output';
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ if (isset($oids) && $oids) {
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, '-Oqv', '');
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, '-Oqv', '');
|
||||
if ($limit != -1 && $lowlimit != -1 && $warnlimit != -1) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,7 +177,7 @@ if (isset($oids) && $oids) {
|
||||
}
|
||||
|
||||
$descr = 'Outlet ' . $index . ' - ' . snmp_get($device, $name_oid, '-Oqv', '');
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,7 +209,7 @@ if (isset($oids) && $oids) {
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
$descr = 'Output Feed';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
unset($oids);
|
||||
|
||||
@@ -231,10 +231,10 @@ if (isset($in_oids)) {
|
||||
$in_index = '3.1.4.' . $index;
|
||||
if (substr($index, 0, 1) == 2 && $data['upsPhaseInputCurrent'] != -1) {
|
||||
$descr = 'Phase ' . substr($index, -1) . ' Bypass Input';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $in_index, $type, $descr, $divisor, 0, null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $in_index, $type, $descr, $divisor, 0, null, null, null, null, $current);
|
||||
} elseif (substr($index, 0, 1) == 1) {
|
||||
$descr = 'Phase ' . substr($index, -1) . ' Input';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $in_index, $type, $descr, $divisor, 0, null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $in_index, $type, $descr, $divisor, 0, null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,7 +253,7 @@ foreach ($oids as $index => $data) {
|
||||
$current = $data['upsPhaseOutputCurrent'] / $divisor;
|
||||
}
|
||||
if ($current >= -1) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, 1, null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, $divisor, 1, null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
unset($index);
|
||||
|
@@ -15,7 +15,7 @@ if ($pre_cache['awplus-sfpddm']) {
|
||||
$descr = $tmp['ifName'];
|
||||
$oid = '.1.3.6.1.4.1.207.8.4.4.3.28.1.3.1.3.' . $index;
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -27,7 +27,7 @@ foreach ($pre_cache['ciscosb_rlPhyTestGetResult'] as $index => $ciscosb_data) {
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
if (is_numeric($current)) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, $index, $sensor_type, $descr, $divisor, $multiplier, null, null, null, null, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'current', $device, $oid, $index, $sensor_type, $descr, $divisor, $multiplier, null, null, null, null, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ $oid = '.1.3.6.1.4.1.18642.1.2.2.1.0';
|
||||
$descr = 'Battery current';
|
||||
$divisor = 1;
|
||||
$multiplier = 1;
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 'batteryCurrent', 'commander-plus', $descr, $divisor, $multiplier, null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $oid, 'batteryCurrent', 'commander-plus', $descr, $divisor, $multiplier, null, null, null, null, $current);
|
||||
|
||||
$current = snmp_get($device, 'rectifierLoadCurrent.0', '-Oqv', 'CCPOWER-MIB');
|
||||
$oid = '.1.3.6.1.4.1.18642.1.2.1.2.0';
|
||||
@@ -36,4 +36,4 @@ $divisor = 1;
|
||||
$multiplier = 1;
|
||||
$limit_low = 0;
|
||||
$limit = 5000;
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 'rectifierLoadCurrent', 'commander-plus', $descr, $divisor, $multiplier, $limit_low, null, null, $limit, $current);
|
||||
discover_sensor(null, 'current', $device, $oid, 'rectifierLoadCurrent', 'commander-plus', $descr, $divisor, $multiplier, $limit_low, null, null, $limit, $current);
|
||||
|
@@ -29,7 +29,7 @@ $index = 'es1dc1DataRectifiersRectifiersOutCurrent';
|
||||
if (is_numeric($rectifiersOutputCurrent) && is_numeric($rectifiersOutputCurrentMax)) {
|
||||
$sensorType = 'compas';
|
||||
$descr = 'Output Current';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $curOID, $index, $sensorType, $descr, '1', '1', null, null, null, $rectifiersOutputCurrentMax, $rectifiersOutputCurrent);
|
||||
discover_sensor(null, 'current', $device, $curOID, $index, $sensorType, $descr, '1', '1', null, null, null, $rectifiersOutputCurrentMax, $rectifiersOutputCurrent);
|
||||
}
|
||||
$loadCurrent = snmp_get($device, 'es1dc1DataLoadLoadCurrent.0', '-Ovqe', 'SITE-MONITORING-MIB');
|
||||
$curOID = '.1.3.6.1.4.1.26854.3.2.1.20.1.20.1.13.3.52.0';
|
||||
@@ -37,7 +37,7 @@ $index = 'es1dc1DataLoadLoadCurrent';
|
||||
if (is_numeric($loadCurrent)) {
|
||||
$sensorType = 'compas';
|
||||
$descr = 'Load Current';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $curOID, $index, $sensorType, $descr, '1', '1', null, null, null, null, $loadCurrent);
|
||||
discover_sensor(null, 'current', $device, $curOID, $index, $sensorType, $descr, '1', '1', null, null, null, null, $loadCurrent);
|
||||
}
|
||||
$batteryInputCurrent = snmp_get($device, 'es1dc1DataBatBatInputCurrent.0', '-Ovqe', 'SITE-MONITORING-MIB');
|
||||
$curOID = '.1.3.6.1.4.1.26854.3.2.1.20.1.20.1.13.3.61.0';
|
||||
@@ -45,5 +45,5 @@ $index = 'es1dc1DataBatBatInputCurrent';
|
||||
if (is_numeric($batteryInputCurrent)) {
|
||||
$sensorType = 'compas';
|
||||
$descr = 'Battery Input Current';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $curOID, $index, $sensorType, $descr, '1', '1', null, null, null, null, $batteryInputCurrent);
|
||||
discover_sensor(null, 'current', $device, $curOID, $index, $sensorType, $descr, '1', '1', null, null, null, null, $batteryInputCurrent);
|
||||
}
|
||||
|
@@ -33,6 +33,6 @@ foreach ($pre_cache['comware_oids'] as $index => $entry) {
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
|
||||
$descr = makeshortif($interface['ifDescr']) . ' Bias Current';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 'bias-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'current', $device, $oid, 'bias-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
|
@@ -11,5 +11,5 @@ if ($oids) {
|
||||
$type = 'cyberpower';
|
||||
$descr = 'Input';
|
||||
$current = $current / 10;
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, '0', $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $oid, '0', $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
@@ -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(null, 'current', $device, $oid, 0, $type, $descr, $divisor, 1, null, null, null, null, $current);
|
||||
}
|
||||
|
@@ -16,6 +16,6 @@ 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) {
|
||||
$i++;
|
||||
discover_sensor($valid['sensor'], 'current', $device, $cur_oid . $index, $i, 'eatonpdu', $descr[$index]['outletName'], '1000', '1', null, null, null, null, $data[$index]['outletCurrent'], 'snmp', $index);
|
||||
discover_sensor(null, 'current', $device, $cur_oid . $index, $i, 'eatonpdu', $descr[$index]['outletName'], '1000', '1', null, null, null, null, $data[$index]['outletCurrent'], 'snmp', $index);
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ foreach ($oids as $current_id => $data) {
|
||||
$type = 'xups';
|
||||
$index = '1.2.3.' . $current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsOutputCurrent', [], 'XUPS-MIB');
|
||||
@@ -28,7 +28,7 @@ foreach ($oids as $current_id => $data) {
|
||||
$divisor = 1;
|
||||
$index = '4.4.1.3.' . $current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsInputCurrent', [], 'XUPS-MIB');
|
||||
@@ -44,5 +44,5 @@ foreach ($oids as $current_id => $data) {
|
||||
$divisor = 1;
|
||||
$index = '3.4.1.3.' . $current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ if ($oids) {
|
||||
$tmp = get_port_by_index_cache($device['device_id'], $ifIndex);
|
||||
$descr = $tmp['ifName'];
|
||||
discover_sensor(
|
||||
$valid['sensor'], 'current', $device, $split, 'txbias' . $ifIndex, 'rlPhyTestTableTxBias', 'SfpTxBias-' . $descr, $divisor, '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $value
|
||||
null, 'current', $device, $split, 'txbias' . $ifIndex, 'rlPhyTestTableTxBias', 'SfpTxBias-' . $descr, $divisor, '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ if ($pre_cache['eltex-mes23xx-sfp']) {
|
||||
$descr = $tmp['ifName'];
|
||||
$oid = '.1.3.6.1.4.1.89.90.1.2.1.3.' . $ifIndex . '.7';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -46,7 +46,7 @@ if (! empty($eltexPhyTransceiverDiagnosticTable['txBiasCurrent'])) {
|
||||
$descr = get_port_by_index_cache($device['device_id'], $ifIndex)['ifName'];
|
||||
$oid = Oid::toNumeric('ELTEX-PHY-MIB::eltexPhyTransceiverDiagnosticCurrentValue.' . $ifIndex . '.3.1');
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -35,7 +35,7 @@ foreach ($pre_cache['enlogic_pdu_input'] as $index => $data) {
|
||||
$high_warn = $data['pduInputPhaseConfigCurrentUpperWarningThreshold'];
|
||||
$current = $data['pduInputPhaseStatusCurrent'];
|
||||
if ($current > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, $tmp_index, $type, $descr, $divisor, '1', $low_limit, $low_warn, $high_warn, $high_limit, $current);
|
||||
discover_sensor(null, 'current', $device, $oid, $tmp_index, $type, $descr, $divisor, '1', $low_limit, $low_warn, $high_warn, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ foreach ($pre_cache['enlogic_pdu_circuit'] as $index => $data) {
|
||||
$high_warn = $data['pduCircuitBreakerConfigUpperWarningThreshold'];
|
||||
$current = $data['pduCircuitBreakerStatusCurrent'];
|
||||
if ($current > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, $tmp_index, $type, $descr, $divisor, '1', $low_limit, $low_warn, $high_warn, $high_limit, $current);
|
||||
discover_sensor(null, 'current', $device, $oid, $tmp_index, $type, $descr, $divisor, '1', $low_limit, $low_warn, $high_warn, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -25,5 +25,5 @@
|
||||
$oid = '.1.3.6.1.4.1.30966.10.3.2.4.0';
|
||||
$current = snmp_get($device, $oid, '-Oqv') / 10;
|
||||
if ($current > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 0, 'PDU L1', 'Current', 10, 1, null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $oid, 0, 'PDU L1', 'Current', 10, 1, null, null, null, null, $current);
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ for ($i = 1; $i <= 3; $i++) {
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, null, null, null, $current);
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
@@ -25,5 +25,5 @@ for ($i = 1; $i <= 3; $i++) {
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, null, null, null, $current);
|
||||
}
|
||||
|
@@ -29,7 +29,7 @@ foreach ($pre_cache['geist_pdu_iec'] as $index => $data) {
|
||||
$descr = $data['ctrl3ChIECName'] . ' Phase A';
|
||||
$oid = $current_oid . $index;
|
||||
if ($value > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 'ctrl3ChIECDeciAmpsA', 'geist-pdu', $descr, $divisor, 1, null, null, null, null, $value);
|
||||
discover_sensor(null, 'current', $device, $oid, 'ctrl3ChIECDeciAmpsA', 'geist-pdu', $descr, $divisor, 1, null, null, null, null, $value);
|
||||
}
|
||||
|
||||
$divisor = 10;
|
||||
@@ -38,7 +38,7 @@ foreach ($pre_cache['geist_pdu_iec'] as $index => $data) {
|
||||
$descr = $data['ctrl3ChIECName'] . ' Phase B';
|
||||
$oid = $current_oid . $index;
|
||||
if ($value > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 'ctrl3ChIECDeciAmpsB', 'geist-pdu', $descr, $divisor, 1, null, null, null, null, $value);
|
||||
discover_sensor(null, 'current', $device, $oid, 'ctrl3ChIECDeciAmpsB', 'geist-pdu', $descr, $divisor, 1, null, null, null, null, $value);
|
||||
}
|
||||
|
||||
$divisor = 10;
|
||||
@@ -47,6 +47,6 @@ foreach ($pre_cache['geist_pdu_iec'] as $index => $data) {
|
||||
$descr = $data['ctrl3ChIECName'] . ' Phase C';
|
||||
$oid = $current_oid . $index;
|
||||
if ($value > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 'ctrl3ChIECDeciAmpsC', 'geist-pdu', $descr, $divisor, 1, null, null, null, null, $value);
|
||||
discover_sensor(null, 'current', $device, $oid, 'ctrl3ChIECDeciAmpsC', 'geist-pdu', $descr, $divisor, 1, null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ foreach ($oids as $index => $entry) {
|
||||
$type = 'ict-pdu';
|
||||
$current = (float) $entry['outputCurrent'] / $divisor;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
// System Current
|
||||
@@ -52,5 +52,5 @@ if (! empty($systemCurrent)) {
|
||||
$oid = '.1.3.6.1.4.1.39145.10.7.0';
|
||||
$current = $systemCurrent / $divisor;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
@@ -35,5 +35,5 @@ if (! empty($outputCurrent)) {
|
||||
$type = 'ict-psu';
|
||||
$currentValue = $outputCurrent / $divisor;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $currentValue);
|
||||
discover_sensor(null, 'current', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $currentValue);
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ if (is_array($oids_in)) {
|
||||
$current = ($entry['inletStatusCurrent'] / $divisor);
|
||||
$high_limit = ($entry['inletConfigCurrentHigh'] / 10);
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $cur_oid, '1.3.1.3.' . $index, 'ipoman', $descr, $divisor, '1', null, null, null, $high_limit, $current);
|
||||
discover_sensor(null, 'current', $device, $cur_oid, '1.3.1.3.' . $index, 'ipoman', $descr, $divisor, '1', null, null, null, $high_limit, $current);
|
||||
// FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,6 @@ if (is_array($oids_out)) {
|
||||
$current = ($entry['outletStatusCurrent'] / $divisor);
|
||||
$high_limit = ($entry['outletConfigCurrentHigh'] / 10);
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $cur_oid, '2.3.1.3.' . $index, 'ipoman', $descr, $divisor, '1', null, null, null, $high_limit, $current);
|
||||
discover_sensor(null, 'current', $device, $cur_oid, '2.3.1.3.' . $index, 'ipoman', $descr, $divisor, '1', null, null, null, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ foreach (array_keys($psline_data) as $index) {
|
||||
$current = $psline_data[$index]['lgpPduPsLineEntryEcHundredths'];
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
$class,
|
||||
$device,
|
||||
$oid,
|
||||
@@ -94,7 +94,7 @@ foreach (array_keys($ps_data) as $index) {
|
||||
$current = $ps_data[$index]['lgpPduPsEntryEcNeutral'];
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
$class,
|
||||
$device,
|
||||
$oid,
|
||||
@@ -139,7 +139,7 @@ foreach (array_keys($rb_data) as $index) {
|
||||
$group = 'Line to Neutral';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
$class,
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -11,18 +11,18 @@ if (preg_match('/(Linux).+(ntc)/', $device['sysDescr'])) {
|
||||
$current = '116.3';
|
||||
$value = snmp_get($device, $oid . $current, '-Oqv');
|
||||
if (is_numeric($value)) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid . $current, $current, $sensor_type, $descr, '1', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
|
||||
discover_sensor(null, 'current', $device, $oid . $current, $current, $sensor_type, $descr, '1', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
|
||||
}
|
||||
$descr = 'VBUS current';
|
||||
$current = '116.5';
|
||||
$value = snmp_get($device, $oid . $current, '-Oqv');
|
||||
if (is_numeric($value)) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid . $current, $current, $sensor_type, $descr, '1', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
|
||||
discover_sensor(null, 'current', $device, $oid . $current, $current, $sensor_type, $descr, '1', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
|
||||
}
|
||||
$descr = 'Battery current';
|
||||
$current = '116.7';
|
||||
$value = snmp_get($device, $oid . $current, '-Oqv');
|
||||
if (is_numeric($value)) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid . $current, $current, $sensor_type, $descr, '1', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
|
||||
discover_sensor(null, 'current', $device, $oid . $current, $current, $sensor_type, $descr, '1', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
|
||||
}
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$limit = null;
|
||||
$lowwarnlimit = null;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
|
||||
}//end for
|
||||
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.4.1.705.1.6.2.1.6', '-OsqnU')); // OID: mginputCurrent
|
||||
@@ -58,5 +58,5 @@ for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$limit = null;
|
||||
$lowwarnlimit = null;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
|
||||
}//end for
|
||||
|
@@ -37,7 +37,7 @@ if (! empty($battery_current) || $battery_current == 0) {
|
||||
$descr = 'Battery Current';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$battery_current_oid,
|
||||
|
@@ -30,5 +30,5 @@ $descr = 'DC Input Current';
|
||||
$divisor = 10;
|
||||
|
||||
if (is_numeric($dcinput_value) && $dcinput_value > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $dcinput_oid, 0, $device['os'], $descr, $divisor, 1, null, null, null, null, $dcinput_value / $divisor);
|
||||
discover_sensor(null, 'current', $device, $dcinput_oid, 0, $device['os'], $descr, $divisor, 1, null, null, null, null, $dcinput_value / $divisor);
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ for ($i = 1; $i <= 3; $i++) {
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, null, null, $current);
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
@@ -25,5 +25,5 @@ for ($i = 1; $i <= 3; $i++) {
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, null, null, $current);
|
||||
}
|
||||
|
@@ -26,6 +26,6 @@ foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
$value = $entry['curr'] / $divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, '' . $index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'current', $device, $oid, '' . $index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
|
@@ -29,7 +29,7 @@ if (is_numeric($data['lcIa'][1])) {
|
||||
$index = 'lcIa';
|
||||
$descr = 'Phase A';
|
||||
$current = $data['lcIa'][1];
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
|
||||
}
|
||||
|
||||
if (is_numeric($data['lcIb'][1])) {
|
||||
@@ -37,7 +37,7 @@ if (is_numeric($data['lcIb'][1])) {
|
||||
$index = 'lcIb';
|
||||
$descr = 'Phase B';
|
||||
$current = $data['lcIb'][1];
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
|
||||
}
|
||||
|
||||
if (is_numeric($data['lcIc'][1])) {
|
||||
@@ -45,7 +45,7 @@ if (is_numeric($data['lcIc'][1])) {
|
||||
$index = 'lcIc';
|
||||
$descr = 'Phase C';
|
||||
$current = $data['lcIc'][1];
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, 'powerlogic', $descr, 1, 1, null, null, null, null, $current);
|
||||
}
|
||||
|
||||
unset($data);
|
||||
|
@@ -16,7 +16,7 @@ foreach ($pre_cache['procurve_hpicfXcvrInfoTable'] as $index => $entry) {
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
foreach ($dbquery as $dbindex => $dbresult) {
|
||||
$descr = makeshortif($dbresult['ifDescr']) . ' Port Bias Current';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 'hpicfXcvrBias.' . $index, 'procurve', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'current', $device, $oid, 'hpicfXcvrBias.' . $index, 'procurve', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ if ($inlet_oids) {
|
||||
$inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.rmsCurrent", '-Ovq', 'PDU2-MIB'));
|
||||
$inlet_current = (snmp_get($device, "measurementsInletSensorValue.$inlet_index.1", '-Ovq', 'PDU2-MIB') / $inlet_divisor);
|
||||
if ($inlet_current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, $multiplier, null, null, null, null, $inlet_current);
|
||||
discover_sensor(null, 'current', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, $multiplier, null, null, null, null, $inlet_current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ if ($outlet_oids) {
|
||||
$outlet_high_limit = snmp_get($device, "outletCurrentUpperCritical.$outletsuffix", '-Ovq', 'PDU-MIB') / $divisor;
|
||||
$outlet_current = snmp_get($device, "outletCurrent.$outletsuffix", '-Ovq', 'PDU-MIB') / $divisor;
|
||||
if ($outlet_current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $outlet_oid, $outlet_insert_index, 'raritan', $outlet_descr, $divisor, $multiplier, $outlet_low_limit, $outlet_low_warn_limit, $outlet_high_warn_limit, $outlet_high_limit, $outlet_current);
|
||||
discover_sensor(null, 'current', $device, $outlet_oid, $outlet_insert_index, 'raritan', $outlet_descr, $divisor, $multiplier, $outlet_low_limit, $outlet_low_warn_limit, $outlet_high_warn_limit, $outlet_high_limit, $outlet_current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ if ($outlet_oids) {
|
||||
$outlet_divisor = pow(10, snmp_get($device, "outletSensorDecimalDigits.1.$outlet_index.rmsCurrent", '-Ovq', 'PDU2-MIB'));
|
||||
$outlet_power = (snmp_get($device, "measurementsOutletSensorValue.1.$outlet_index.1", '-Ovq', 'PDU2-MIB') / $outlet_divisor);
|
||||
if ($outlet_power >= 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $outlet_oid, $outlet_insert_index, 'raritan', $outlet_descr, $outlet_divisor, $multiplier, $outlet_low_limit, $outlet_low_warn_limit, $outlet_high_warn_limit, $outlet_high_limit, $outlet_power);
|
||||
discover_sensor(null, 'current', $device, $outlet_oid, $outlet_insert_index, 'raritan', $outlet_descr, $outlet_divisor, $multiplier, $outlet_low_limit, $outlet_low_warn_limit, $outlet_high_warn_limit, $outlet_high_limit, $outlet_power);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,6 +118,6 @@ foreach ($pre_cache['raritan_inletTable'] as $index => $raritan_data) {
|
||||
$warn_limit = $raritan_data['inletCurrentLowerWarning'] / $divisor;
|
||||
$high_limit = $raritan_data['inletCurrentLowerCritical'] / $divisor;
|
||||
$current = $pre_cache['raritan_inletPoleTable'][$index][$x]['inletPoleCurrent'] / $divisor;
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, $tmp_index, 'raritan', $descr, $divisor, 1, $low_limit, $low_limit, $warn_limit, $high_limit, $current);
|
||||
discover_sensor(null, 'current', $device, $oid, $tmp_index, 'raritan', $descr, $divisor, 1, $low_limit, $low_limit, $warn_limit, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ if (is_numeric($battery_current)) {
|
||||
$divisor = get_device_divisor($device, $pre_cache['poweralert_serial'] ?? '', 'current', $oid);
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
@@ -43,7 +43,7 @@ foreach ($output_current as $index => $data) {
|
||||
$data['upsOutputCurrent'] = Number::cast($data['upsOutputCurrent']);
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
@@ -75,7 +75,7 @@ foreach ($input_current as $index => $data) {
|
||||
$data['upsInputCurrent'] = Number::cast($data['upsInputCurrent']);
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
@@ -107,7 +107,7 @@ foreach ($bypass_current as $index => $data) {
|
||||
$data['upsBypassCurrent'] = Number::cast($data['upsBypassCurrent']);
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -16,7 +16,7 @@ foreach ($pre_cache['sdbMgmtCtrlDevUnitAddress'] ?? [] as $sdbMgmtCtrlDevUnitAdd
|
||||
// See includes/discovery/entity-physical/schleifenbauer.inc.php for an explanation why we set this as the entPhysicalIndex.
|
||||
$entPhysicalIndex = $sdbMgmtCtrlDevUnitAddress * 1000000 + 100000 + $sdbDevInIndex * 1000 + 120;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $serial_input, 'schleifenbauer', $descr, $divisor, '1', null, null, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $serial_input, 'schleifenbauer', $descr, $divisor, '1', null, null, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,5 +33,5 @@ foreach ($pre_cache['sdbDevOutMtActualCurrent'] ?? [] as $sdbDevOutMtIndex => $s
|
||||
// See includes/discovery/entity-physical/schleifenbauer.inc.php for an explanation why we set this as the entPhysicalIndex.
|
||||
$entPhysicalIndex = $sdbMgmtCtrlDevUnitAddress * 1000000 + 200000 + $sdbDevOutMtIndex * 1000 + 120;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $serial_output, 'schleifenbauer', $descr, $divisor, '1', null, null, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $serial_output, 'schleifenbauer', $descr, $divisor, '1', null, null, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex);
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ if (! empty($battery_current) || $battery_current == 0) {
|
||||
$type = 'sinetica';
|
||||
$index = '2.6.0';
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $battery_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor(null, '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', []);
|
||||
@@ -50,7 +50,7 @@ foreach ($oids as $oid => $data) {
|
||||
$type = 'sinetica';
|
||||
$index = '4.4.1.3.' . $current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor(null, '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', []);
|
||||
@@ -68,5 +68,5 @@ foreach ($oids as $oid => $data) {
|
||||
$type = 'sinetica';
|
||||
$index = '3.3.1.3.' . $current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
@@ -25,5 +25,5 @@
|
||||
$oid = '.1.3.6.1.4.1.32050.2.1.27.5.4';
|
||||
$current = (snmp_get($device, $oid, '-Oqv') / 10);
|
||||
if ($current > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 0, 'sitemonitor', 'Current', 10, 1, null, null, null, null, $current);
|
||||
discover_sensor(null, 'current', $device, $oid, 0, 'sitemonitor', 'Current', 10, 1, null, null, null, null, $current);
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ $tpdin_oids = [
|
||||
|
||||
foreach ($tpdin_oids as $data) {
|
||||
if ($data['current'] > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $data['oid'], $data['index'], $device['os'], $data['descr'], 10, '1', null, null, null, null, $data['current']);
|
||||
discover_sensor(null, 'current', $device, $data['oid'], $data['index'], $device['os'], $data['descr'], 10, '1', null, null, null, null, $data['current']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -50,7 +50,7 @@ foreach ($pre_cache['adva_fsp150_ports'] as $index => $entry) {
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
$descrRx = ($pre_cache['adva_fsp150_ifName'][$entry['cmEthernetNetPortIfIndex']]['ifName'] ?? 'ifIndex ' . $entry['cmEthernetNetPortIfIndex']) . ' Rx Power';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oidRx,
|
||||
@@ -72,7 +72,7 @@ foreach ($pre_cache['adva_fsp150_ports'] as $index => $entry) {
|
||||
// Discover transmit power level
|
||||
$descrTx = ($pre_cache['adva_fsp150_ifName'][$entry['cmEthernetNetPortIfIndex']]['ifName'] ?? 'ifIndex ' . $entry['cmEthernetNetPortIfIndex']) . ' Tx Power';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oidTx,
|
||||
@@ -107,7 +107,7 @@ foreach ($pre_cache['adva_fsp150_ports'] as $index => $entry) {
|
||||
$descrRx = ($pre_cache['adva_fsp150_ifName'][$entry['cmEthernetAccPortIfIndex']]['ifName'] ?? 'ifIndex ' . $entry['cmEthernetAccPortIfIndex']) . ' Rx Power';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oidRx,
|
||||
@@ -129,7 +129,7 @@ foreach ($pre_cache['adva_fsp150_ports'] as $index => $entry) {
|
||||
$descrTx = ($pre_cache['adva_fsp150_ifName'][$entry['cmEthernetAccPortIfIndex']]['ifName'] ?? 'ifIndex ' . $entry['cmEthernetAccPortIfIndex']) . ' Tx Power';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oidTx,
|
||||
@@ -163,7 +163,7 @@ foreach ($pre_cache['adva_fsp150_ports'] as $index => $entry) {
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
$descrRx = ($pre_cache['adva_fsp150_ifName'][$entry['cmEthernetTrafficPortIfIndex']]['ifName'] ?? 'ifIndex ' . $entry['cmEthernetTrafficPortIfIndex']) . ' Rx Power';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oidRx,
|
||||
@@ -184,7 +184,7 @@ foreach ($pre_cache['adva_fsp150_ports'] as $index => $entry) {
|
||||
|
||||
$descrTx = ($pre_cache['adva_fsp150_ifName'][$entry['cmEthernetTrafficPortIfIndex']]['ifName'] ?? 'ifIndex ' . $entry['cmEthernetTrafficPortIfIndex']) . ' Tx Power';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oidTx,
|
||||
|
@@ -29,7 +29,7 @@ foreach ($pre_cache['adva_fsp3kr7'] as $index => $entry) {
|
||||
$descr = $entry['entityFacilityAidString'] . ' RX';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oidRX,
|
||||
@@ -52,7 +52,7 @@ foreach ($pre_cache['adva_fsp3kr7'] as $index => $entry) {
|
||||
$currentTX = $entry['pmSnapshotCurrentOutputPower'] / $divisor;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oidTX,
|
||||
|
@@ -15,7 +15,7 @@ if ($pre_cache['awplus-sfpddm']) {
|
||||
$descr = $tmp['ifName'];
|
||||
$oid = '.1.3.6.1.4.1.207.8.4.4.3.28.1.4.1.3.' . $index;
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid,
|
||||
@@ -51,7 +51,7 @@ if ($pre_cache['awplus-sfpddm']) {
|
||||
$descr = $tmp['ifName'];
|
||||
$oid = '.1.3.6.1.4.1.207.8.4.4.3.28.1.5.1.3.' . $index;
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -28,6 +28,6 @@ foreach ($pre_cache['ciscoepc_docsIfDownstreamChannelTable'] as $index => $data)
|
||||
$oid = '.1.3.6.1.2.1.10.127.1.1.1.1.6.' . $index;
|
||||
$divisor = 10;
|
||||
$value = $data['docsIfDownChannelPower'];
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'docsIfDownChannelPower.' . $index, 'ciscoepc', $descr, $divisor, '1', null, null, null, null, $value);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'docsIfDownChannelPower.' . $index, 'ciscoepc', $descr, $divisor, '1', null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ foreach ($pre_cache['ciscosb_rlPhyTestGetResult'] as $index => $ciscosb_data) {
|
||||
$dbm = $value['rlPhyTestTableTxOutput'] / $divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-' . $index, $sensor_type, $descr, $divisor, $multiplier, null, null, null, null, $dbm, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'tx-' . $index, $sensor_type, $descr, $divisor, $multiplier, null, null, null, null, $dbm, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
if (isset($value['rlPhyTestTableRxOpticalPower']) && is_numeric($value['rlPhyTestTableRxOpticalPower']) && ($value['rlPhyTestTableTxOutput'] != 0)) {
|
||||
$oid = '.1.3.6.1.4.1.9.6.1.101.90.1.2.1.3.' . $index . '.9';
|
||||
@@ -34,7 +34,7 @@ foreach ($pre_cache['ciscosb_rlPhyTestGetResult'] as $index => $ciscosb_data) {
|
||||
$dbm = $value['rlPhyTestTableRxOpticalPower'] / $divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-' . $index, $sensor_type, $descr, $divisor, $multiplier, null, null, null, null, $dbm, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'rx-' . $index, $sensor_type, $descr, $divisor, $multiplier, null, null, null, null, $dbm, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ foreach ($pre_cache['comware_oids'] as $index => $entry) {
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
$descr = makeshortif($interface['ifDescr']) . ' Receive Power';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'rx-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
|
||||
if (is_numeric($entry['hh3cTransceiverCurTXPower']) && $entry['hh3cTransceiverCurTXPower'] != 2147483647 && isset($entry['hh3cTransceiverDiagnostic'])) {
|
||||
@@ -46,7 +46,7 @@ foreach ($pre_cache['comware_oids'] as $index => $entry) {
|
||||
$interface = get_port_by_index_cache($device['device_id'], $index);
|
||||
if ($interface['ifAdminStatus'] == 'up') {
|
||||
$descr = makeshortif($interface['ifDescr']) . ' Transmit Power';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'tx-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ foreach ($pre_cache['datacom_oids'] as $index => $entry) {
|
||||
$current = $entry['ddTransceiversRxPower'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-' . $index, 'datacom', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'rx-' . $index, 'datacom', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
|
||||
if (is_numeric(str_replace('dBm', '', $entry['ddTransceiversTxPower']))) {
|
||||
@@ -30,6 +30,6 @@ foreach ($pre_cache['datacom_oids'] as $index => $entry) {
|
||||
$current = $entry['ddTransceiversTxPower'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-' . $index, 'datacom', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'tx-' . $index, 'datacom', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ if ($oids) {
|
||||
$tmp = get_port_by_index_cache($device['device_id'], $ifIndex);
|
||||
$descr = $tmp['ifName'];
|
||||
discover_sensor(
|
||||
$valid['sensor'], 'dbm', $device, $split, 'txdbm' . $ifIndex, 'rlPhyTestTableTxOutput', 'SfpTxdBm-' . $descr, $divisor, '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $value
|
||||
null, 'dbm', $device, $split, 'txdbm' . $ifIndex, 'rlPhyTestTableTxOutput', 'SfpTxdBm-' . $descr, $divisor, '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $value
|
||||
);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ if ($oids) {
|
||||
$tmp = get_port_by_index_cache($device['device_id'], $ifIndex);
|
||||
$descr = $tmp['ifName'];
|
||||
discover_sensor(
|
||||
$valid['sensor'], 'dbm', $device, $split, 'rxdbm' . $ifIndex, 'rlPhyTestTableRxOpticalPower', 'SfpRxdBm-' . $descr, $divisor, '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $value
|
||||
null, 'dbm', $device, $split, 'rxdbm' . $ifIndex, 'rlPhyTestTableRxOpticalPower', 'SfpRxdBm-' . $descr, $divisor, '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ if ($pre_cache['eltex-mes23xx-sfp']) {
|
||||
$descr = $tmp['ifName'];
|
||||
$oid = '.1.3.6.1.4.1.89.90.1.2.1.3.' . $ifIndex . '.8';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid,
|
||||
@@ -72,7 +72,7 @@ if ($pre_cache['eltex-mes23xx-sfp']) {
|
||||
$descr = $tmp['ifName'];
|
||||
$oid = '.1.3.6.1.4.1.89.90.1.2.1.3.' . $ifIndex . '.9';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -47,7 +47,7 @@ if (! empty($eltexPhyTransceiverDiagnosticTable['txOpticalPower'])) {
|
||||
$descr = get_port_by_index_cache($device['device_id'], $ifIndex)['ifName'];
|
||||
$oid = Oid::toNumeric('ELTEX-PHY-MIB::eltexPhyTransceiverDiagnosticCurrentValue.' . $ifIndex . '.4.1');
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid,
|
||||
@@ -82,7 +82,7 @@ if (! empty($eltexPhyTransceiverDiagnosticTable['rxOpticalPower'])) {
|
||||
$descr = get_port_by_index_cache($device['device_id'], $ifIndex)['ifName'];
|
||||
$oid = Oid::toNumeric('ELTEX-PHY-MIB::eltexPhyTransceiverDiagnosticCurrentValue.' . $ifIndex . '.5.1');
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -13,7 +13,7 @@ foreach ($fabosSfpRxPower as $oid => $entry) {
|
||||
$ifIndex = $index + 1073741823;
|
||||
if ($ifAdminStatus[$ifIndex] == '1') {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
".$oid.$index",
|
||||
@@ -44,7 +44,7 @@ foreach ($fabosSfpTxPower as $oid => $entry) {
|
||||
$ifIndex = $index + 1073741823;
|
||||
if ($ifAdminStatus[$ifIndex] == '1') {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
".$oid.$index",
|
||||
|
@@ -72,7 +72,7 @@ if (is_numeric($a1_tx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_a1_tx,
|
||||
@@ -97,7 +97,7 @@ if (is_numeric($a1_rx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_a1_rx,
|
||||
@@ -122,7 +122,7 @@ if (is_numeric($a2_tx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_a2_tx,
|
||||
@@ -147,7 +147,7 @@ if (is_numeric($a2_rx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_a2_rx,
|
||||
@@ -170,7 +170,7 @@ if (is_numeric($b1_tx)) {
|
||||
$descr = 'B1 Tx Power';
|
||||
$index = 'vSFPB1TxPower.0';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_b1_tx,
|
||||
@@ -195,7 +195,7 @@ if (is_numeric($b1_rx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_b1_rx,
|
||||
@@ -220,7 +220,7 @@ if (is_numeric($b2_tx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_b2_tx,
|
||||
@@ -245,7 +245,7 @@ if (is_numeric($b2_rx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_b2_rx,
|
||||
@@ -270,7 +270,7 @@ if (is_numeric($c1_tx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_c1_tx,
|
||||
@@ -295,7 +295,7 @@ if (is_numeric($c1_rx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_c1_rx,
|
||||
@@ -320,7 +320,7 @@ if (is_numeric($c2_tx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_c2_tx,
|
||||
@@ -345,7 +345,7 @@ if (is_numeric($c2_rx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_c2_rx,
|
||||
@@ -368,7 +368,7 @@ if (is_numeric($d1_tx)) {
|
||||
$descr = 'D1 Tx Power';
|
||||
$index = 'vSFPD1TxPower.0';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_d1_tx,
|
||||
@@ -393,7 +393,7 @@ if (is_numeric($d1_rx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_d1_rx,
|
||||
@@ -418,7 +418,7 @@ if (is_numeric($d2_tx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_d2_tx,
|
||||
@@ -443,7 +443,7 @@ if (is_numeric($d2_rx)) {
|
||||
$divisor = '100';
|
||||
$multiplier = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid_d2_rx,
|
||||
|
@@ -27,6 +27,6 @@ foreach ($pre_cache['infineragroove_portTable'] as $index => $data) {
|
||||
$descr = $data['portAlias'] . ' Receive Power';
|
||||
$oid = '.1.3.6.1.4.1.42229.1.2.3.6.1.1.4.' . $index;
|
||||
$value = $data['portRxOpticalPower'];
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'portRxOpticalPower.' . $index, 'infinera-groove', $descr, null, '1', null, null, null, null, $value);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'portRxOpticalPower.' . $index, 'infinera-groove', $descr, null, '1', null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ foreach ($pre_cache['nokiaIsamSfpPort'] as $slotId => $slot) {
|
||||
$limit = ($port['sfpDiagRSSIRxPowerAlmHigh'] / $divisor) ?: -3;
|
||||
$warn_limit = ($port['sfpDiagRSSIRxPowerWarnHigh'] / $divisor) ?: -5;
|
||||
$value = $port['sfpDiagRxPower'] / $divisor;
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, $portName . '-rx', 'nokia-isam', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, $portName . '-rx', 'nokia-isam', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
if (is_numeric($port['sfpDiagTxPower'])) {
|
||||
$oid = '.1.3.6.1.4.1.637.61.1.56.5.1.6.' . $slotId . '.' . $portId;
|
||||
@@ -24,7 +24,7 @@ foreach ($pre_cache['nokiaIsamSfpPort'] as $slotId => $slot) {
|
||||
$limit = ($port['sfpDiagRSSITxPowerAlmHigh'] / $divisor) ?: -3;
|
||||
$warn_limit = ($port['sfpDiagRSSITxPowerWarnHigh'] / $divisor) ?: -4;
|
||||
$value = $port['sfpDiagTxPower'] / $divisor;
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, $portName . '-tx', 'nokia-isam', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, $portName . '-tx', 'nokia-isam', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
$value = $entry['rxPower'] / $divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-' . $index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'rx-' . $index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
|
||||
if (is_numeric($entry['txPower']) && ($entry['txPower'] !== '-65535')) {
|
||||
@@ -40,6 +40,6 @@ foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
$value = $entry['txPower'] / $divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-' . $index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'tx-' . $index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ foreach ($pre_cache['procurve_hpicfXcvrInfoTable'] as $index => $entry) {
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
foreach ($dbquery as $dbindex => $dbresult) {
|
||||
$descr = makeshortif($dbresult['ifDescr']) . ' Port Receive Power';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'hpicfXcvrRxPower.' . $index, 'procurve', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'hpicfXcvrRxPower.' . $index, 'procurve', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ foreach ($pre_cache['procurve_hpicfXcvrInfoTable'] as $index => $entry) {
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
foreach ($dbquery as $dbindex => $dbresult) {
|
||||
$descr = makeshortif($dbresult['ifDescr']) . ' Port Transmit Power';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'hpicfXcvrTxPower.-' . $index, 'procurve', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'hpicfXcvrTxPower.-' . $index, 'procurve', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ foreach ($pre_cache['rosMgmtOpticalTransceiverDDMTable'] as $index => $data) {
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
if ($port['ifAdminStatus'] == 'up') {
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-' . $index, $sensor_type, $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'tx-' . $index, $sensor_type, $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
if (($key == 'rxPower') && is_numeric($value['rosMgmtOpticalTransceiverParameterValue']) && ($value['rosMgmtOpticalTransceiverDDMValidStatus'] != 0)) {
|
||||
@@ -35,7 +35,7 @@ foreach ($pre_cache['rosMgmtOpticalTransceiverDDMTable'] as $index => $data) {
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
if ($port['ifAdminStatus'] == 'up') {
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-' . $index, $sensor_type, $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'rx-' . $index, $sensor_type, $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ foreach ($pre_cache['raisecomOpticalTransceiverDDMTable'] as $index => $data) {
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
if ($port['ifAdminStatus'] == 'up') {
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-' . $index, $sensor_type, $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'tx-' . $index, $sensor_type, $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
if (($key == 'rxPower') && is_numeric($value['raisecomOpticalTransceiverParameterValue']) && ($value['raisecomOpticalTransceiverDDMValidStatus'] != 0)) {
|
||||
@@ -35,7 +35,7 @@ foreach ($pre_cache['raisecomOpticalTransceiverDDMTable'] as $index => $data) {
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
if ($port['ifAdminStatus'] == 'up') {
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-' . $index, $sensor_type, $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'rx-' . $index, $sensor_type, $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ foreach ($pre_cache['timos_oids'] as $index => $entry) {
|
||||
$port_descr = get_port_by_index_cache($device['device_id'], str_replace('1.', '', $index));
|
||||
$descr = $port_descr['ifName'] . ' RX Power ' . $int_ext;
|
||||
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-' . $index, 'timos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured, $user_func);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'rx-' . $index, 'timos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured, $user_func);
|
||||
}
|
||||
if (is_numeric($entry['tmnxDDMTxOutputPower']) && $entry['tmnxDDMTxOutputPower'] != 0 && $entry['tmnxDDMRxOpticalPower'] != 0) {
|
||||
$oid = '.1.3.6.1.4.1.6527.3.1.2.2.4.31.1.16.' . $index;
|
||||
@@ -44,6 +44,6 @@ foreach ($pre_cache['timos_oids'] as $index => $entry) {
|
||||
$port_descr = get_port_by_index_cache($device['device_id'], str_replace('1.', '', $index));
|
||||
$descr = $port_descr['ifName'] . ' TX Power';
|
||||
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-' . $index, 'timos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured, $user_func);
|
||||
discover_sensor(null, 'dbm', $device, $oid, 'tx-' . $index, 'timos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured, $user_func);
|
||||
}
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ foreach ($pre_cache['wipipe_oids'] as $index => $entry) {
|
||||
$currentsignal = $entry['mdmSignalStrength'];
|
||||
// Discover Sensor
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
null,
|
||||
'dbm',
|
||||
$device,
|
||||
$oid,
|
||||
|
@@ -30,6 +30,6 @@ foreach ($pre_cache['infineragroove_portTable'] as $index => $data) {
|
||||
$oid = '.1.3.6.1.4.1.42229.1.2.4.1.19.1.1.22.' . $index;
|
||||
$value = $data['ochOsDGD'];
|
||||
$divisor = 1000000000000;
|
||||
discover_sensor($valid['sensor'], 'delay', $device, $oid, 'ochOsOSNR.' . $index, 'infinera-groove', $descr, $divisor, '1', null, null, null, null, $value);
|
||||
discover_sensor(null, 'delay', $device, $oid, 'ochOsOSNR.' . $index, 'infinera-groove', $descr, $divisor, '1', null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
@@ -256,7 +256,7 @@ if (! empty($entity_oids)) {
|
||||
// End grouping sensors
|
||||
}
|
||||
$descr = trim($descr);
|
||||
discover_sensor($valid['sensor'], $type, $device, $oid, $index, 'entity-sensor', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex, $entry['entSensorMeasuredEntity'] ?? null, null, $group);
|
||||
discover_sensor(null, $type, $device, $oid, $index, 'entity-sensor', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $current, 'snmp', $entPhysicalIndex, $entry['entSensorMeasuredEntity'] ?? null, null, $group);
|
||||
}
|
||||
}//end if
|
||||
}//end foreach
|
||||
|
@@ -28,6 +28,6 @@ foreach ($pre_cache['cooling_unit_analog'] as $index => $data) {
|
||||
$scale = $data['coolingUnitStatusAnalogScale'] ?? null;
|
||||
$value = $data['coolingUnitStatusAnalogValue'] ?? null;
|
||||
if (preg_match('/Fan Speed/', $descr) && $data['coolingUnitStatusAnalogUnits'] == '%' && $value >= 0) {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $cur_oid, $cur_oid, 'apc', $descr, $scale, 1, null, null, null, null, $value);
|
||||
discover_sensor(null, 'fanspeed', $device, $cur_oid, $cur_oid, 'apc', $descr, $scale, 1, null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
@@ -16,6 +16,6 @@ foreach (explode("\n", $oids) as $data) {
|
||||
$oid = '.1.3.6.1.4.1.18928.1.2.2.1.9.1.3.' . $index;
|
||||
$current = snmp_get($device, $oid, '-Oqv', '');
|
||||
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'areca', trim($descr, '"'), '1', '1', null, null, null, null, $current);
|
||||
discover_sensor(null, 'fanspeed', $device, $oid, $index, 'areca', trim($descr, '"'), '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
@@ -14,6 +14,6 @@ for ($index = 4; $index <= 9; $index++) { //Benu Fans are index 4 thru 9
|
||||
$sensor_oid = ".1.3.6.1.4.1.39406.1.1.1.4.1.1.5.1.$index";
|
||||
$descr = $data["1.$index"]['benuSensorName'] ?? null;
|
||||
$current = $data["1.$index"]['benuSensorValue'] ?? null;
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $sensor_oid, $sensor_index, 'benuos', $descr, '1', '1', null, null, null, null, $current);
|
||||
discover_sensor(null, 'fanspeed', $device, $sensor_oid, $sensor_index, 'benuos', $descr, '1', '1', null, null, null, null, $current);
|
||||
$sensor_index++;
|
||||
}//end loop
|
||||
|
@@ -22,6 +22,6 @@ if (is_array($temp)) {
|
||||
$warnlimit = $temp[$index]['coolingDeviceUpperNonCriticalThreshold'];
|
||||
$limit = $temp[$index]['coolingDeviceUpperCriticalThreshold'];
|
||||
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $cur_oid . $index, $index, 'dell', $descr, '0', '1', $lowlimit, $low_warn_limit, $warnlimit, $limit, $value, 'snmp', $index);
|
||||
discover_sensor(null, 'fanspeed', $device, $cur_oid . $index, $index, 'dell', $descr, '0', '1', $lowlimit, $low_warn_limit, $warnlimit, $limit, $value, 'snmp', $index);
|
||||
}
|
||||
}
|
||||
|
@@ -22,6 +22,6 @@ foreach (explode("\n", $oids) as $data) {
|
||||
$current = snmp_get($device, $fan_oid, '-Oqv', 'IDRAC-MIB-SMIv2');
|
||||
$low_limit = snmp_get($device, $limit_oid, '-Oqv', 'IDRAC-MIB-SMIv2');
|
||||
$divisor = '1';
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $fan_oid, $index, 'drac', $descr, $divisor, '1', $low_limit, null, null, null, $current);
|
||||
discover_sensor(null, 'fanspeed', $device, $fan_oid, $index, 'drac', $descr, $divisor, '1', $low_limit, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ if ($tmp_eltex['.1.3.6.1.4.1.35265.1.22.1.10.6.0']) {
|
||||
$descr = 'Fan 0';
|
||||
$divisor = 1;
|
||||
$fanspeed = $tmp_eltex[$oid];
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, $type, $descr, $divisor, '1', $min_eltex, null, null, $max_eltex, $fanspeed);
|
||||
discover_sensor(null, 'fanspeed', $device, $oid, $index, $type, $descr, $divisor, '1', $min_eltex, null, null, $max_eltex, $fanspeed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ if ($tmp_eltex['.1.3.6.1.4.1.35265.1.22.1.10.8.0']) {
|
||||
$descr = 'Fan 1';
|
||||
$divisor = 1;
|
||||
$fanspeed = $tmp_eltex[$oid];
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, $type, $descr, $divisor, '1', $min_eltex, null, null, $max_eltex, $fanspeed);
|
||||
discover_sensor(null, 'fanspeed', $device, $oid, $index, $type, $descr, $divisor, '1', $min_eltex, null, null, $max_eltex, $fanspeed);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -33,7 +33,7 @@ if (! empty($oids)) {
|
||||
$index = (100 + $index);
|
||||
|
||||
if ($extra[$keys[0]]['eqlMemberHealthDetailsFanCurrentState'] != 'unknown') {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'snmp', $descr, 1, 1, $low_limit, $low_warn, $high_limit, $high_warn, $temperature);
|
||||
discover_sensor(null, 'fanspeed', $device, $oid, $index, 'snmp', $descr, 1, 1, $low_limit, $low_warn, $high_limit, $high_warn, $temperature);
|
||||
}
|
||||
}//end if
|
||||
}//end foreach
|
||||
|
@@ -20,7 +20,7 @@ if ($oids) {
|
||||
$oid = '.1.3.6.1.4.1.3375.2.1.3.2.1.2.1.3.' . $index;
|
||||
$fanspeed = $fanspeed / $divisor;
|
||||
if ($fanspeed >= 0) {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $fanspeed);
|
||||
discover_sensor(null, 'fanspeed', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $fanspeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -24,6 +24,6 @@ foreach ($oids as $index => $oid) {
|
||||
|
||||
if (is_numeric($value)) {
|
||||
$descr = $descr_prefix . ($index + 1);
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'snmp', $descr, 1, 1, null, null, null, null, $value);
|
||||
discover_sensor(null, 'fanspeed', $device, $oid, $index, 'snmp', $descr, 1, 1, null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ if (is_array($oids)) {
|
||||
$descr = 'Fan ' . $index;
|
||||
$oid = '.1.3.6.1.4.1.46242.2.1.2.' . $index;
|
||||
$current = $entry['fanSpeed'];
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, $device['os'], $descr, '1', '1', 0, 0, 8000, 9000, $current);
|
||||
discover_sensor(null, 'fanspeed', $device, $oid, $index, $device['os'], $descr, '1', '1', 0, 0, 8000, 9000, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ foreach (explode("\n", $oids) as $data) {
|
||||
if (! strstr($descr, 'No') and ! strstr($value, 'No')) {
|
||||
$descr = str_replace('"', '', $descr);
|
||||
$descr = trim($descr);
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $value_oid, $oididx, 'nos', $descr, '1', '1', null, null, '80', '100', $value);
|
||||
discover_sensor(null, 'fanspeed', $device, $value_oid, $oididx, 'nos', $descr, '1', '1', null, null, '80', '100', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ foreach ($oids as $index => $entry) {
|
||||
$descr = $entry['fanDescription'];
|
||||
$oid = '.1.3.6.1.4.1.12124.2.53.1.4.' . $index;
|
||||
$current = $entry['fanSpeed'];
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'onefs', $descr, '1', '1', 0, 0, 5000, 9000, $current);
|
||||
discover_sensor(null, 'fanspeed', $device, $oid, $index, 'onefs', $descr, '1', '1', 0, 0, 5000, 9000, $current);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,6 @@ foreach ($sensors_values as $index => $entry) {
|
||||
$descr = "Fan Speed $index:";
|
||||
|
||||
if ($current_value > 0) {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, "$numeric_oid_base.$index", $index, $sensor_type, $descr, 1, 1, null, null, null, null, $current_value);
|
||||
discover_sensor(null, 'fanspeed', $device, "$numeric_oid_base.$index", $index, $sensor_type, $descr, 1, 1, null, null, null, null, $current_value);
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user