Zabbix trigger for text item

zabbix

I have an item in zabbix 2.0 with "Type of information" set to text.

When everything is normal, it should say "optimal". How do I create a trigger for it saying anything other than "optimal"?

I know how to work with triggers for numeric data types, but I haven't worked with text based ones before.

Best Answer

Considering your item key is

text["/path/to/your/file.txt"]

your trigger should be something like,

{some_server:log["/path/to/your/file.txt"].str("optimal")}#1 & {some_server:log["/path/to/your/file.txt"].nodata(600)}#1

The .nodata function triggers if you get 600 seconds without receiving new data.

If you want to only check for optimal at the beginning of the string, instead of .str("optimal"), use .regexp(^optimal)