Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

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)

share|improve this answer
    
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? –  Grant Sep 12 '12 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) –  Joao Figueiredo Sep 13 '12 at 18:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.