1

I have created a trigger for a check on a web scenario (using the example below). It triggers an alert if there are 3 values equal 0 within 60secs.

My understanding was that web.test.fail returns the step number when it fails.

What I do not understand is how the following example would trigger an alert - if there is only 1 step in web scenario for test.example.com, and it fails, wouldn't web.test.fail would return 1 instead of 0? Wouldn't that mean there would be 3 values equal 1 within 60 secs? In this case, how would the following example work? Am I understanding this wrong?

Trigger example:

{hosts1:web.test.fail[test.example.com].count(60,0)}=3 

1 Answer 1

3

The trigger expression {hosts1:web.test.fail[test.example.com].last()} will return a result of the latest test:

  • 0 - OK. The web scenario test.example.com (all steps) was tested successfully;
  • 1 - The first step of the web scenario test.example.com was failed (you have only one step of the scenario as you told);
  • UNKNOWN - The web host is unreachable.

If the trigger expression will return UNKNOWN state or value more than 0, the trigger will generate PROBLEM alert.

If you want to generate alert after three consecutive failed checks then rewrite the trigger expression as:

{hosts1:web.test.fail[test.example.com].sum(#3)}>0 

This trigger will work with any step counts of your web scenario. It sends PROBLEM alert at first failed test and sends OK restore alert after three consecutive successful checks (180 secs after service was fully restored).

11
  • Trigger should not become unknown if the webhost/service is down - web scenario should properly detect that was a failure. Regarding the expression, this is simpler: {hosts1:web.test.fail[test.example.com].min(#3)=1}. Commented Sep 18, 2017 at 9:43
  • Wont' the following trigger alerts repeatedly when the last 3 values are 1 ? {hosts1:web.test.fail[test.example.com].min(#3)=1} Commented Sep 18, 2017 at 14:31
  • @Dextor What Zabbix version do you use? Commented Sep 18, 2017 at 14:33
  • @MikhailKhirgiy Zabbix 3.4 Commented Sep 18, 2017 at 14:40
  • 1
    @Dextor @Richlv I'm sorry. I wasn't right. I've tested all on Zabbix 3.2 and updated my answer. @Richlv I think sum(#3)>0 will be better than min(#3)=1. It will work with any step counts of a web scenario and will send the OK alert after 3 consecutive successful checks. Commented Sep 19, 2017 at 13:12

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.