Get current status from httptest (Zabbix)

curlmonitoringzabbixzabbix-agent

I'm trying to use PHP/CURL to query Zabbix and find whether a service is available or not.

From Zabbix Web interface, I get this screen, which shows the test and its status.

Zabbix Web Interface

I'd like to get this data (test name and status) as JSON in order to display in another application.

I'm posting the following JSON:

{"jsonrpc":"2.0","method":"httptest.get", "params": {"output":"extend"},"auth":"XXXXXXXXXXXXXXX","id":0}'

Which returns the tests, but not its status.
What json request should I use in order to receive an status flag (Ok / NOk) ?

Best Answer

That OK/NOK status for web monitoring is calculated by frontend code and API method for that result is not available.

You should to use item.get to get web monitoring item value (for example item "lastfailedstep/Failed step of scenario ...") and then you should to calculate OK/NOK status in your code. See Zabbix item.get API documentation for the parameters.

Related Topic