2

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!

2 Answers 2

4

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 .

7
  • Thanks for your answer, how do I create the correct Item as well?
    – Itai Ganot
    Jul 15, 2014 at 10:51
  • You need to implement a web check, zabbix.com/documentation/2.0/manual/web_monitoring has good instructions for doing that. After creating the web check, you will have an item web.test.error, which is the HTTP status code. Jul 15, 2014 at 11:57
  • But this web check describes a scenario... i need only to access a web page and get it's status code... is that the only way to do it? by creating a scenario?
    – Itai Ganot
    Jul 15, 2014 at 12:00
  • Yes, you need to create a one-step web check scenario. Jul 15, 2014 at 12:03
  • I updated the answer for completeness. I think you were checking for the wrong value in the web check scenario. Jul 15, 2014 at 14:03
0

It's possible do it. Create the trigger below:

{HOST:web.test.rspcode[SCENARIO,STEP].diff(200)}

Good luck!

2
  • Not a good idea, cause e.g. 301 doesn't mean an error. Most time it's just a desired redirect http->https or smth like this
    – vladkras
    Oct 13, 2016 at 4:58
  • How do you tell to send the alert only after it is returning 500 for a consecutive 5 requests?
    – zeroweb
    Dec 19, 2017 at 18:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .