Triggers with adaptable thresholds

There are monitored metrics that have rather different threshold needs, depending on the possible range of the value, even when measuring in percentages instead of absolute values. For example, using bytes for a disk space trigger will not work that well when disks can range from a few dozen megabytes to hundreds of terabytes or even petabytes. Applying our knowledge of trigger expressions, we could vary our threshold depending on the total disk size. For this, we will have to monitor both free and total disk space:

( 
    {host:vfs.fs.size[/,total].last()}<=100GB 
        and 
    {host:vfs.fs.size[/,pfree].last()}<10 
) or 
( {host:vfs.fs.size[/,total].last()}>100GB and {host:vfs.fs.size[/,pfree].last()}<5 )

A trigger that requires item values like this with the last function will only work when all involved items have collected at least one value. In this case, two items are referenced, each twice.

The previous expression has been split for readability. In Zabbix versions prior to 2.4, it would have to be entered on a single line, but since Zabbix 2.4, newlines and tab characters are supported in trigger expressions.

This expression will make the trigger act differently in two cases of disk configuration:

  • Total disk space being less than or equal to 100 GB
  • Total disk space being more than 100 GB

Depending on the amount of total disk space, a different threshold is applied to the free disk space as a percentage—10% for smaller disks and 5% for larger disks.

You might easily expand this to have different thresholds for disks between 100 MB, 10 GB, 100 GB, 10 TB, and higher.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.198.129