mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix handling of zero value for entSensorThresholdValue for dbm cisco sensor (#16336)
* add handling of zero value for entSensorThresholdValue for dbm sensor type this addresses https://github.com/librenms/librenms/issues/16335 * Update cisco-entity-sensor.inc.php * safe check for $key['entSensorThresholdValue'] * style --------- Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
This commit is contained in:
@@ -148,15 +148,15 @@ if ($device['os_group'] == 'cisco') {
|
|||||||
if (isset($t_oids[$index]) && is_array($t_oids[$index])) {
|
if (isset($t_oids[$index]) && is_array($t_oids[$index])) {
|
||||||
foreach ($t_oids[$index] as $t_index => $key) {
|
foreach ($t_oids[$index] as $t_index => $key) {
|
||||||
// Skip invalid treshold values
|
// Skip invalid treshold values
|
||||||
if ($key['entSensorThresholdValue'] == '-32768') {
|
if (! isset($key['entSensorThresholdValue']) || $key['entSensorThresholdValue'] == '-32768') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Critical Limit
|
// Critical Limit
|
||||||
if (($key['entSensorThresholdSeverity'] == 'major' || $key['entSensorThresholdSeverity'] == 'critical') && ($key['entSensorThresholdValue'] != 0) && ($key['entSensorThresholdRelation'] == 'greaterOrEqual' || $key['entSensorThresholdRelation'] == 'greaterThan')) {
|
if (($key['entSensorThresholdSeverity'] == 'major' || $key['entSensorThresholdSeverity'] == 'critical') && ($key['entSensorThresholdRelation'] == 'greaterOrEqual' || $key['entSensorThresholdRelation'] == 'greaterThan')) {
|
||||||
$limit = ($key['entSensorThresholdValue'] * $multiplier / $divisor);
|
$limit = ($key['entSensorThresholdValue'] * $multiplier / $divisor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($key['entSensorThresholdSeverity'] == 'major' || $key['entSensorThresholdSeverity'] == 'critical') && ($key['entSensorThresholdValue'] != 0) && ($key['entSensorThresholdRelation'] == 'lessOrEqual' || $key['entSensorThresholdRelation'] == 'lessThan')) {
|
if (($key['entSensorThresholdSeverity'] == 'major' || $key['entSensorThresholdSeverity'] == 'critical') && ($key['entSensorThresholdRelation'] == 'lessOrEqual' || $key['entSensorThresholdRelation'] == 'lessThan')) {
|
||||||
$limit_low = ($key['entSensorThresholdValue'] * $multiplier / $divisor);
|
$limit_low = ($key['entSensorThresholdValue'] * $multiplier / $divisor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user