Zabbix: How to configure a trigger which notifies me that a certain error has arised twice

monitoringwebzabbix

I need to configure a Zabbix check which will check access to a certain internet page.
The page can return http status 200 (ok) or 500 (internal server error).
I want to get a Zabbix notification when ever a 500 status error arises twice, is that possible?

Edit #1:
@Tero Kilkanen: This is the error I get when I try to create the trigger:

Incorrect trigger expression. Check expression part starting from "{Mobit engine health check:web.test.rspcode[Check engine,engine health check].count(10,"500 (internal server error)","eq")".

Edit #2:
I've created the web scenario as follows:
enter image description here
And the single step:
enter image description here
I've created the next trigger:
enter image description here
And here's the Lastest Data from the Zabbix server:
enter image description here
But then I have two questions:

1. How can I check that the trigger works if it is not displayed in `Latest Data` in the Zabbix server?
2. How do I edit the trigger to reflect the needed configuration? which is to raise and alert when http status returns `500 Internal server error` twice?

Thanks!

Best Answer

Yes, that is possible.

First you need to create a web check with instructions at https://www.zabbix.com/documentation/2.0/manual/web_monitoring

Then, after making the test, you get new items, which you can use in a trigger. In your case, you want to check the HTTP error code, so the trigger would be like:

{HOST:web.test.error[TESTNAME].count(10,500)}>1

Here, HOST means the host which is configured to make the web check. TESTNAME is the name given to the web check scenario.

The first argument 10 to coint() means that it counts events happening in last ten seconds. The second argument contains the error code to compare against. The trigger launches if there are more than 1 instance of 500 errors in last 10 seconds.

For further information on count syntax, look at https://www.zabbix.com/documentation/2.0/manual/appendix/triggers/functions .