我需要configuration一个Zabbix检查,检查访问某个互联网页面。 该页面可以返回http status 200 (ok)或500 (internal server error) 。 当500 status error出现两次时,我想得到一个Zabbix通知,这是可能的吗?
编辑#1:@Tero Kilkanen:这是我尝试创build触发器时得到的错误:
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")".
编辑#2:我创build了如下的Web场景:
而单步:
我创build了下一个触发器:
这里是Zabbix服务器的Lastest Data :
但是,我有两个问题:
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?
谢谢!
是的,这是可能的。
首先,您需要在https://www.zabbix.com/documentation/2.0/manual/web_monitoring上创build一个网页检查
然后,在testing后,你会得到新的项目,你可以在触发器中使用。 在你的情况下,你想检查HTTP错误代码,所以触发器就像:
{HOST:web.test.error [testing名] .Count之间(10500)}> 1
在这里,HOST表示被configuration为进行networking检查的主机。 TESTNAME是提供给Web检查场景的名称。
coint()的第一个参数10意味着它计数在过去十秒内发生的事件。 第二个参数包含要比较的错误代码。 如果在最近10秒内有超过1个500错误的实例,则触发器启动。
有关count语法的更多信息,请参见https://www.zabbix.com/documentation/2.0/manual/appendix/triggers/functions 。
这是可能的。 在下面创build触发器:
{HOST:web.test.rspcode[SCENARIO,STEP].diff(200)}
祝你好运!