mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 02:18:39 +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:
parent
f89ed301d7
commit
4efad1ae69
@ -148,15 +148,15 @@ if ($device['os_group'] == 'cisco') {
|
||||
if (isset($t_oids[$index]) && is_array($t_oids[$index])) {
|
||||
foreach ($t_oids[$index] as $t_index => $key) {
|
||||
// Skip invalid treshold values
|
||||
if ($key['entSensorThresholdValue'] == '-32768') {
|
||||
if (! isset($key['entSensorThresholdValue']) || $key['entSensorThresholdValue'] == '-32768') {
|
||||
continue;
|
||||
}
|
||||
// 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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
7432
tests/data/iosxe_c8500-20x6c.json
Normal file
7432
tests/data/iosxe_c8500-20x6c.json
Normal file
File diff suppressed because it is too large
Load Diff
3021
tests/snmpsim/iosxe_c8500-20x6c.snmprec
Normal file
3021
tests/snmpsim/iosxe_c8500-20x6c.snmprec
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user