Skip to content

Zabbix and how to the filesystem template to send warn or crit for fixed free space values

We are monitoring our servers with zabbix.

A lot of servers are running in a slightly different configuration, especially when it comes to harddisk space. Furthermore, it is fine to operate on "almost full" disk or "near the limit".

The task was to adjust the existing zabbix templates without creating and maintaining our own ones. A part of our servers should warn us if there is only 5 GB of free disk space left and should send us a crit if the amount of free disk space drops below 3 GB.

So we ended up with a bit of calcuation. E.G. a server has 170 GB of disk space, we are running the following math.

#calcuation for critical, if free disk space is below 3 GB
$percentage = (3 GB / 100 %) * 170 GB; #results in 5.1 %
$numberForZabbix = (100 % - $percentage) #100 - 5.1 = 94.9

Once we have done the math for the warning (5 GB) and for all the servers, we can go into the host configuration and use the mighty macro section.

For the example host above, we want to add the following two macro lines


Of course, the crit message now says "more than 94.9 percent of disk space used" but this is the compromise we have to deal with. The other solution would be to maintain our own template, what we want to avoid.

Translate to de es fr it pt ja


No Trackbacks


Display comments as Linear | Threaded

No comments

The author does not allow comments to this entry

Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
To leave a comment you must approve it via e-mail, which will be sent to your address after submission.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.

Markdown format allowed
Form options