mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix cisco sensor thresholds (#11547)
* Update functions.inc.php Skip changing the high limit threshold to low limit threshold value when high limit threshold doesn't exist for a sensor. If low limit threshold value was set by discovery process or manually, the same value would be also set for high limit threshold. * Update cisco-entity-sensor.inc.php Skip invalid sensor threshold values, which some Cisco ASR devices (probably other families too) return. * Add snmprec data for Cisco ASR9010 * Create iosxr_asr9010.josr * Create iosxr_asr9010.json * Delete iosxr_asr9010.josr * Update iosxr_asr9010.json * Update iosxr_asr9010.json Co-authored-by: Tony Murray <[email protected]> Co-authored-by: PipoCanaja <[email protected]>
This commit is contained in:
co-authored by
Tony Murray
PipoCanaja
parent
c22dad298e
commit
79ca57ed28
@@ -293,7 +293,7 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
|
||||
}
|
||||
|
||||
// Fix high/low thresholds (i.e. on negative numbers)
|
||||
if ($low_limit > $high_limit) {
|
||||
if (isset($high_limit) && $low_limit > $high_limit) {
|
||||
list($high_limit, $low_limit) = array($low_limit, $high_limit);
|
||||
}
|
||||
|
||||
|
||||
@@ -132,6 +132,10 @@ if ($device['os_group'] == 'cisco') {
|
||||
// Check thresholds for this entry (bit dirty, but it works!)
|
||||
if (is_array($t_oids[$index])) {
|
||||
foreach ($t_oids[$index] as $t_index => $key) {
|
||||
// Skip invalid treshold values
|
||||
if ($key['entSensorThresholdValue'] == '-32768') {
|
||||
continue;
|
||||
}
|
||||
// Critical Limit
|
||||
if (($key['entSensorThresholdSeverity'] == 'major' || $key['entSensorThresholdSeverity'] == 'critical') && ($key['entSensorThresholdRelation'] == 'greaterOrEqual' || $key['entSensorThresholdRelation'] == 'greaterThan')) {
|
||||
$limit = ($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