如何教 Zabbix 对事件中的短暂峰值保持聪明? [英] How to teach Zabbix to be smart about short spikes in events?
问题描述
最近我开始收到来自 Zabbix 的关于我们的一台服务器上的高 iowait 的警报.此事件是由 pg_dump 备份我们的数据库引起的,这完全没问题,因为峰值很短,而且……嗯,因为备份是服务器上的合法活动.
Recently I've started to receive alerts from Zabbix about high iowait at one of our servers. This event is caused by pg_dump backing up our database and it's perfectly ok because the spike is short and... well, because backing up is a legitimate activity at the server.
有没有办法教 Zabbix 在这些事情上变得聪明?我认为没有必要发送关于每天 iowait 短暂(<30 秒)峰值的电子邮件警报.另一方面,如果服务器日充满了 5 秒的峰值,则应进行调查.
Is there a way to teach Zabbix to be smart about such things? I think there is no need to send email alerts about one short (<30secs) spike of iowait per day. On the other hand, if server day is full of 5-secs spikes, this should be investigated.
推荐答案
最流行和最简单的方法是使用适当的触发功能.例如,不要使用您最有可能使用的 last()
,而是使用 min(60)
或 avg(60)
.最小值不会检测到重复尖峰,平均值可能.
The most popular and easiest way is to use proper trigger functions. For example, instead of what you most likely use, last()
, go for min(60)
or avg(60)
. Minimum would not detect repeated spiking, average might.
其他可能有用的触发函数:
regexp()
(主要用于文本项)str()
(主要用于文本项)count()
regexp()
(mostly for text items)str()
(mostly for text items)count()
注意 last()
不能返回或计算多个值,因此 last()
= last(0)
= last(300)
.
Note that last()
cannot return or evaluate multiple values, thus last()
= last(0)
= last(300)
.
这篇关于如何教 Zabbix 对事件中的短暂峰值保持聪明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!