1

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.

1 Answer 1

2

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)

2
  • Will .str("optimal") work if it comes back with something like "Failure: system is not optimal"? ie. will it match anywhere in the text, or just at the beginning? Commented Sep 12, 2012 at 19:29
  • It will match any string occurrence. If you need to catch it a the beginning you should use something like (untested): .regexp(^optimal) Commented Sep 13, 2012 at 18:44

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.