Problem:
Trigger send an e-mail immediately when the site is unreachable.
System:
Linux Debian Stretch, Zabbix 4.2.1.
Current configuration of the web scenario:
Scenario:
Name: website.com
Update interval: 30s
Attempts: 3
Agent: Zabbix
Steps:
(just one)
Name: website.com
URL: http://website.com/page.php
Follow redirects: checked
Timeout: 30s
(rest unchanged)
Current configuration of the trigger:
Name: The website.com can't be reached!
Expression: {VIRTUALMACHINE:web.test.fail[website.com].last(3m)}>0
(rest unchanged)
Explanation
The trigger has to send an e-mail if the site is unreachable for 3 minutes (or 3 last checks with timeout 30 seconds on every check). I was trying to do it in many ways (below*), but with each trigger expression that I tried the e-mail notification was sent immediately when the zabbix detected the problem for the first time (and not for the nth attempt).
*
{VIRTUALMACHINE:web.test.fail[website.com].sum(#3)}>0
{VIRTUALMACHINE:web.test.fail[website.com].last(3m)}<>0
{VIRTUALMACHINE:web.test.rspcode[website.com,website.com].last(0)}#200
{VIRTUALMACHINE:web.test.fail[website.com].last(3)}#0
{VIRTUALMACHINE:web.test.fail[website.com].sum(#3)}>0
{VIRTUALMACHINE:web.test.fail[website.com].last(3)}>0
{VIRTUALMACHINE:web.test.fail[website.com].min(1)}>0
Please if you give an answer explain it. Feel free to ask.