ESXi datastore alerting with shared storage

Hey all,

I’m currently monitoring a load of ESXi hosts which are all connected to a pair of SANs, LibreNMS has picked up the datastore usage amongst all the other good stuff, which is great.

However, the issue I have is that when a datastore starts filling up, all the hosts (24x) then send a disk space warning/critical alert so I get 24x low disk alerts. Is there any way to aggregate/merge the alerts or only alert once per datastore?

I can get what I want via an SQL query, as shown below:

MariaDB [librenms]> SELECT DISTINCT storage_descr FROM storage WHERE storage.storage_perc >= 85;

±--------------------------------------------------+

| storage_descr |

±--------------------------------------------------+

| /vmfs/volumes/61c53601-cxae6b92-c0a9-xe019550000z |

| / |

| /vmfs/volumes/6140e3f8-cxdcc9a4-7bd5-xe019550000z |

±--------------------------------------------------+

However, if I try and throw that into a custom SQL based rule I get the following error everytime it’s used:

Error in alert rule Disk Space Warning (85%+) - TESTING (35): SQLSTATE[HY093]: Invalid parameter number (Connection: mysql, SQL: SELECT DISTINCT storage_descr FROM storage WHERE storage.storage_perc >= 85)

Any thoughts please?

Thanks!