Alerting for NFS mounts on Mac OS X via SNMP

Hi

I am new to LibreNMS, but have found it very useful and easy to use so far.
I have run into a problem concerning alerting of NFS mounts in Mac OS X.

I have some servers using NFS sharepoints to run scripts from and would like to get an alert if the NFS mount is missing.

I have used this guide to setup SNMP on Mac OS X, and it is working:
https://rickheil.com/monitoring-os-x-servers-with-observium-part-1-snmp/

And I have used the Net-SNMP manual to find some useful info on how to get the NFS shares to be seen as “fixed disks”, and it is working.
http://www.net-snmp.org/docs/man/snmpd.conf.html

On the test server I have 3 “disks”:
/ - system
/Volumes/example_1 - NFS mount
/Volumes/example_2 - NFS mount

I would like to know how to get an alert if one of the NFS mounts are missing.

So far I have been using storage.device_descr = /Volumes/example_1 to define NFS mount 1, but when I make an alert rule it tells me that the 2 other disks are having errors, probably because they aren’t mounted as that name.

I have tried a lot of different scenarios, and it just haven’t worked correctly yet. I feel like I am missing a piece of the puzzle. Should I even use storage.device_descr to define the mount point? or should I use something different?

not sure if this may help you - http://docs.librenms.org/Support/Configuration/#storage-configuration

I do see the NFS sharepoints in LibreNMS WebGUI so it is there, it is more the scripting of the alerting I have issues with, I think.
I solved this by making the snmpd.conf on the Mac OS X System sent the NFS share info to the librenms server as fixed disks.

But thank you for the quick reply.

You should share the rule(s) you’ve tried and someone will expand on them :slight_smile:

Hi

As requested I am below posting my different tries of alert rule. As mentioned I would like to get an alert when any single NFS mount is missing and for the test I am just having all drives mounted.

When I make this alert:
%storage.storage_descr = “/Volumes/example_1” - Critical
I get a warning:
#1: storage_id => ‘59’, storage_descr => ‘/Volumes/example_1’

Then I thought this would work:
%storage.storage_descr != “/Volumes/example_1” && - Critical
But then I get:
#1: storage_id => ‘40’, storage_descr => ‘/’
#2: storage_id => ‘41’, storage_descr => ‘/Volumes/example_2’

Next thing I tried was:
%storage.storage_descr != “/Volumes/example_1” && %storage.storage_descr = “/” && %storage.storage_descr = “/Volumes/example_2” - Critical
then I got:
Nothing

Remember no drives are missing at the moment, so I shouldn’t get a error.

But I don’t get an alert when unmounting the drive on the last try described.

Any ideas?

Actually overall I’m not sure this will work, our alerting system relies on data being returned in mysql to match the rule, if no data exists we can’t alert.

I’ve never actually used it before but you could try your second example but select invert rule and see if that does what you need.

Hi

I see your point, it makes sense.
I have been using nagios XI so far and had that feature setup and would like to do the same with librenms.
But if that is not possible I imaging I have to go back.

The inverted rule didn’t work.

Anyway thank for the enlightment;-)

You can use nagios checks in the “services” section and write alerts based on them, if that helps.