Zabbix – trigger alerts from web scenario

zabbix

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

Best Answer

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).

Related Topic