mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 18:38:25 +00:00
Cisco sensor discovery fixes (#11077)
* Sev and Rel terminology varies between devices * Most temp sensors don't have low limits, so adding * update test data Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
parent
3263839780
commit
daebf8c765
@ -133,25 +133,36 @@ if ($device['os_group'] == 'cisco') {
|
||||
if (is_array($t_oids[$index])) {
|
||||
foreach ($t_oids[$index] as $t_index => $key) {
|
||||
// Critical Limit
|
||||
if ($key['entSensorThresholdSeverity'] == 'major' && $key['entSensorThresholdRelation'] == 'greaterOrEqual') {
|
||||
if (($key['entSensorThresholdSeverity'] == 'major' || $key['entSensorThresholdSeverity'] == 'critical') && ($key['entSensorThresholdRelation'] == 'greaterOrEqual' || $key['entSensorThresholdRelation'] == 'greaterThan')) {
|
||||
$limit = ($key['entSensorThresholdValue'] * $multiplier / $divisor);
|
||||
}
|
||||
|
||||
if ($key['entSensorThresholdSeverity'] == 'major' && $key['entSensorThresholdRelation'] == 'lessOrEqual') {
|
||||
if (($key['entSensorThresholdSeverity'] == 'major' || $key['entSensorThresholdSeverity'] == 'critical') && ($key['entSensorThresholdRelation'] == 'lessOrEqual' || $key['entSensorThresholdRelation'] == 'lessThan')) {
|
||||
$limit_low = ($key['entSensorThresholdValue'] * $multiplier / $divisor);
|
||||
}
|
||||
|
||||
// Warning Limit
|
||||
if ($key['entSensorThresholdSeverity'] == 'minor' && $key['entSensorThresholdRelation'] == 'greaterOrEqual') {
|
||||
if ($key['entSensorThresholdSeverity'] == 'minor' && ($key['entSensorThresholdRelation'] == 'greaterOrEqual' || $key['entSensorThresholdRelation'] == 'greaterThan')) {
|
||||
$warn_limit = ($key['entSensorThresholdValue'] * $multiplier / $divisor);
|
||||
}
|
||||
|
||||
if ($key['entSensorThresholdSeverity'] == 'minor' && $key['entSensorThresholdRelation'] == 'lessOrEqual') {
|
||||
if ($key['entSensorThresholdSeverity'] == 'minor' && ($key['entSensorThresholdRelation'] == 'lessOrEqual' || $key['entSensorThresholdRelation'] == 'lessThan')) {
|
||||
$warn_limit_low = ($key['entSensorThresholdValue'] * $multiplier / $divisor);
|
||||
}
|
||||
}//end foreach
|
||||
}//end if
|
||||
|
||||
// If temperature sensor, set low thresholds to -1 and -5. Many sensors don't return low thresholds, therefore LibreNMS takes the runtime low
|
||||
// Also changing 0 values (not just null) as Libre loses these somewhere along the line and shows an empty value in the Web UI
|
||||
if ($type == 'temperature') {
|
||||
if ($warn_limit_low == 0) {
|
||||
$warn_limit_low = -1;
|
||||
}
|
||||
if ($limit_low == 0) {
|
||||
$limit_low = -5;
|
||||
}
|
||||
}
|
||||
|
||||
// End Threshold code
|
||||
$ok = true;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user