How to ignore storage?


I have tried to follow the user docs for ignoring storage. I have a FreeNAS server and it lists 10~ different storage locations:


In my config.php I have added this line to the bottom:
$config[‘ignore_mount’][] = “/mnt/iocage”;
I then selected edit device, then rediscover device. The storage locations still appear.

How can I remove or ignore these storage locations?

Thank you

Does anyone know?

If you just want to ignore it for alerts, try setting the warn percent to 100.

I’m actually having this same problem. I’m pretty new to LibreNMS but when I added my OpnSense firewall it automatically was detecting these mount points and alerting on them due to my storage rule and the fact that it thinks they’re full at 100%. This is a false positive and from everything I’ve seen in docs and configs these should be ignored. Am I doing something wrong or is this a bug?

/var/captiveportal/zone0/dev - should be ignore by this default, no?
$config[‘ignore_mount_string’][] = ‘devfs’;

/var/dhcpd/dev - should be ignored by this in the default:
$config[‘ignore_mount_regexp’][] = ‘/^/var/dhcpd/dev,/’;

I’m adding here instead of starting my own because I suspect I’m having the same issue as OP.

You could just set the storage percent warn to 101 this will stop the alerting. Edit->Storage.

What if I want to really ignore the storage?
I recently integrated a freenas box in my librenms server, the problem is it is exposing all snapshots as different mounts, so I have ~1200 storages :astonished: the page of this device takes forever to load and the storage graph errors out.
Is there a way to really remove all the snapshots from the monitored items?
The option

$config['ignore_mount_regexp'][] = ".*/\.zfs/snapshot/.*";

has no effect.

$config['ignore_mount_string'][] = ".zfs/snapshot";

worked so probably it was just a case of a badly written regexp.

Keep in mind you did not escape the .

The first attempt was with

$config['ignore_mount_regexp'][] = ".zfs/snapshot";

and a non escaped dot should match any character, shouldn’t it?
Anyway, in the the previous message the dot before zfs is escaped.

Edit: if you refer to the “ignore_mount_string” it doesn’t use regular expression.
ignore_mount -> the mount has to be the exact string specified
ignore_mount_string -> the mount contains the string
ignore_mount_regexp -> it checks the mount against the string as a regular expression

Ah, I didn’t see you switched to string.

I think the problem with your regex is you forgot the enclosing characters. Also, you don’t have to match the whole string, only part of it.

So: '#\.zfs/snapshot/# (I used # so I didn’t have to escape /)

Isn’t that the sed syntax for search and replace? I though that / had no special meaning in a regular expression.

My fault, I didn’t know that php needed an enclosing character :sweat_smile:

sed uses regex. For regex the terminating characters can be anything, / is typically used. Whatever character you use, you need to escape it in the regex expression.

Protip, if you use the web ui or lnms config:set to set this setting, it will check that that the regex is valid :slight_smile:

I didn’t realize you can set those via the web ui :sweat_smile: (in Discovery -> Storage Module)