سؤال

I need trigger able to detect that polled Zabbix agent items does not returns data. For zabbix trapper items this functionality is covered by nodata() function (Heartbeat lost detection in Zabbix documentation) but I need similar functionality supported for Zabbix agent items.

For example, a have defined Zabbix agent UserParameter: UserParameter=custom.mssqlping,/usr/local/scripts/mssqlping.sh.

The script mssqlping.sh returns 0/1. I need to cover situation when mssqlping.sh script is broken and returns empy string, which is not stored in zabbix because it is not number.

How to detect that periodically polled item data are no longer coming?

هل كانت مفيدة؟

المحلول

It is not that it's not stored that creates the problem but the fact that it is not being considered as a valid item anymore so you can't trigger anything out of it. There is a plenty of related bug reports related to it. AFAIk your options:

  1. Adjust the script to return a numeric value in case of errors
  2. Use 2.2's "internal events" to detect the "becomes unsupported" event
  3. Make and external script that will query the database directly and will notify you on its own or triggering a condition through zabbix's trappers

نصائح أخرى

Or the option here is to trigger based on nodata()

from: https://www.zabbix.com/forum/zabbix-help/41652-zabbix-trigger-timeout?p=245422#post245422

{myserver:example.iregexp("/string/",1m)}=1 AND {myserver:example.nodata(1m)}=0

some more reading: https://zabbix.org/wiki/Trigger_examples

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top