如何在物品不可用时触发警报?

How to trigger alert when items are unavailable?

使用 Zabbix,如果某个项目无法访问(例如 'ZBX_NOTSUPPORTED' 或当 zabbix 代理无法提供预期的项目格式时跟踪到的任何错误),我如何触发警报?

目标是防止主机在检索项目数据时无提示地失败。

来自documentation

Receiving notifications on unsupported items is supported since Zabbix 2.2.

It is part of the concept of internal events in Zabbix, allowing users to be notified on these occasions. Internal events reflect a change of state:

  • when items go from 'normal' to 'unsupported' (and back) when triggers
  • go from 'normal' to 'unknown' (and back) when low-level discovery
  • rules go from 'normal' to 'unsupported' (and back)

当项目不受支持时,这意味着该项目尚未收到任何 data.So 您可以使用 nodata() 函数。

无数据(秒) 检查是否没有收到数据。 支持的值类型:任何

Returns: 1 - 如果在定义的时间段内没有收到数据 0 - 否则