mercredi 4 juillet 2018

Zabbix web.page.regexp set output if pattern not found

I created a new Zabbix agent item to try to monitor the content of a web page, but I can't manage to make it work.

To test this, I'm using the page http://httpbin.org/get that will return a json page with whatever get parameter you put in the url. In Zabbix I've set the following key:

web.page.regexp[httpbin.org,/get?a=thisisatest,80,"thisisatest",,1]

This works so far and returns 1, if "thisisatest" is found. In the item settings I selected the value type "Numeric (unsigned)" and "Boolean" so it can be shown as a graph. But the problem happens, if either the regex doesn't match or the page is unavailable. Example:

web.page.regexp[httpbin.org,/get?a=thisisNOTatest,80,"thisisatest",,1]

This just returns an empty string (or nothing), so Zabbix can't parse it and the Item won't work (Error: Not supported)

Anyone knows if there's a way to get this working right, or if i'm doing something wrong?




Aucun commentaire:

Enregistrer un commentaire