PDA

View Full Version : Does this Trigger work like I think it does? [web check...]


bignose
28-06-2010, 20:32
Hi,

I have a trigger/web-check that looks like this

{www1.toronto.terida.net:web.test.fail[Atlas English].max(#3)}#0

Its job is to check a website. It runs every 10 seconds and if I get 3 failures in a row, It should trigger. I've been getting alot of notices latley that its down, but if I check in my Apache logs, I can see the hits coming in just fine, so I dug deeper into my postgresql tables.

select * from items where key_ = 'web.test.fail[Atlas English]';

To get my item id.. and then..

zabbix=# select to_timestamp(clock),value from history_uint where value = 1 and itemid = 22283 order by clock desc limit 10;
to_timestamp | value
------------------------+-------
2010-06-28 13:15:31-04 | 1
2010-06-25 12:59:51-04 | 1
2010-06-22 14:49:48-04 | 1
2010-06-22 14:49:38-04 | 1
2010-06-22 14:49:28-04 | 1
2010-06-22 14:49:18-04 | 1
2010-06-22 14:49:08-04 | 1
2010-06-22 14:48:58-04 | 1
2010-06-22 14:46:52-04 | 1
2010-06-22 14:46:42-04 | 1

Now as you can see, on today the 28th and A few days ago the 25th, it only happened once. However on both of those days, I got a notice. Also on the 25th, I can recall the actual down time, it was me restarting apache for a configuration change.

Idea's? Is my Trigger syntax wrong?

Jeff.

jerrylenk
29-06-2010, 17:18
Hi Jeff,

If I understand right, you want the trigger to trigger when all of the last 3 samples are NOT 0. That would be min(#3) >0 , assuming that all non-0 values are >0.
max(#3) #0 returns true if any ONE of the last 3 is greater than 0.
^^ That's what you have seen.

cu, Jerry

bignose
29-06-2010, 17:42
You are correct, min is what I want.

I also contacted the author of the book, and let him know of the correction. [The new Zabbix 1.8 book by Rihards Olups]