Disable sensors not working

Hi

I hot having any luck disabling sensors. We have a number of Axis cameras and we are getting sensor errors because (by design) there is no SD card installed, and no network share configured.

Below is an extract from the logs when the device was added. This is where I got the OS and sensor names from:

2020-10-19 15:11:19 sensor 10.2.17.100 Sensor Added: state storageDisruptionDetectedState 1 Storage Status: SD_DISK System
2020-10-19 15:11:19 sensor 10.2.17.100 Sensor Added: state storageDisruptionDetectedState 2 Storage Status: NetworkShare System
2020-10-19 15:11:19 sensor 10.2.17.100 Sensor Added: temperature axiscam 1 Temperature Sensor 1 System
2020-10-19 15:11:19 sensor 10.2.17.100 Sensor Added: temperature axiscam 2 Temperature Sensor 2 System
2020-10-19 15:11:18 system 10.2.17.100 Device OS changed: generic -> axiscam System
2020-10-19 15:11:18 system 10.2.17.100 Device OS: generic -> axiscam System
2020-10-19 15:11:18 system 10.2.17.100 Device type changed server => appliance

At the bottom of the config.php, and added 3 lines I thought would disable the sensors, but they don’t change anything:

Disable Sensors

$config[‘os’][‘axiscam’][‘disabled_sensors’][‘NetworkShare’] = true;
$config[‘os’][‘axiscam’][‘disabled_sensors’][‘SD_DISK’] = true;

Any ideas?

Try it via RegEx.

Just read the docs, they are well written regarding ignoring interfaces/sensors:

https://docs.librenms.org/Support/Configuration/#ignoring-health-sensors

I can confirm that Regex works.

$config[‘disabled_sensors_regex’][] = ‘/NetworkShare/’;
$config[‘disabled_sensors_regex’][] = ‘/SD_DISK/’;

These don’t work:
$config[‘os’][‘axiscam’][‘disabled_sensors’][‘NetworkShare’] = true;
$config[‘os’][‘axiscam’][‘disabled_sensors’][‘SD_DISK’] = true;

If anyone has any ideas why not, I’d love to know.

Probably because the type of the sensor in the DB is not “NetworkShare” nor “SD_DISK”.
Reading the doc, you’ll see that you can filter on the type or with a regex on the name.
https://docs.librenms.org/Developing/os/Settings/

For the axis sensor, you would have to check the type (storage, disk, …) and filter on it. Or filter the regex directly on Axis (instead of globally as you did here).