My alert templates

Most of the actual alerts I’m using are from the stock examples with minimal modification, (Device down due to no ICMP response, device down due to no SNMP response, Device rebooted, service warning and service critical) however I didn’t find a good example for low disk space that worked the way I wanted it to so I thought I’d share that too.

Here are my low disk space and critical disk space warning alerts:

The issue with some of the examples I’ve seen is that they only check percentage of the disk used - with very large disks on the order of terrabytes checking by percentage doesn’t make sense - you really want to check for a certain minimum amount of free space, conversely for relatively small disks (including small ancillary partitions or virtual filesystems on a Linux system) a minimum free space check that is appropriate for a large disk can potentially be unsatisfiable on a small partition because the partition is smaller than the minimum allowed space! :grinning:

So the obvious answer is to somehow combine the two checks, so that’s what I did above. As before, disks are measured in bytes in LibreNMS hence the unwieldy looking numbers in the size comparison.

In the disk space low alert I am checking if free space is < 10GB and the disk is >= 80% full. This means for a disk that is 50GB or larger in size it has to be below 10GB free to trigger an alert, while for a smaller disk it has to be greater than 80% full. (For example a 1GB partition would need less than 200MB free to trigger this alert)

Similarly the disk space critical alert will trigger if there is <1GB free and the disk is >=95% full. So for a 20GB or larger drive less than 1GB of free space would trigger this alert but for a drive smaller than 20GB it would need to be 95% or more full.

The numbers can be tweaked a bit to personal preference but I like the basic idea of ANDing the check for absolute free space with the percentage used, and it seems to cover all scenarios on the servers I’m monitoring including Windows, Mac and Linux.

2 Likes