mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Extend REGEX filtering option by sensor_class (#13066)
This commit is contained in:
@@ -33,6 +33,12 @@ $config['os']['vrp']['disabled_sensors']['current'] = true;
|
||||
$config['os']['iosxe']['disabled_sensors_regex'][] = '/PEM Iout/';
|
||||
```
|
||||
|
||||
- Filter all 'power' sensors with description matching regexp ```'/ Power [TR]x /'``` for Operating System iosxr.
|
||||
|
||||
```php
|
||||
$config['os']['iosxr']['disabled_sensors_regex']['power'][] = '/ Power [TR]x /';
|
||||
```
|
||||
|
||||
- Ignore all temperature sensors
|
||||
|
||||
```php
|
||||
|
||||
@@ -1199,6 +1199,11 @@ function can_skip_sensor($device, $sensor_class = '', $sensor_descr = '')
|
||||
return true;
|
||||
}
|
||||
}
|
||||
foreach (Config::getCombined($device['os'], "disabled_sensors_regex.$sensor_class", []) as $skipRegex) {
|
||||
if (! empty($sensor_descr) && preg_match($skipRegex, $sensor_descr)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user