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?
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.
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.
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.
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.