Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-22842

Web Scenario status code blank into Zabbix API

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Trivial Trivial
    • None
    • 6.0.17, 6.4.1, 6.4.2
    • API (A)

      Good morning,
      I would like to monitor the status of a web app via Zabbix.
      To do this, I added the host and to the record I added a web scenario with the url of the site that I want to monitor.
      If I manage everything through Zabbix, the monitoring works and the "response code" of the site correctly replies the code 200. But if I try to access the same record through the API, Zabbix returns me the empty field.
      I also tried with a user who has maximum rights on the system and the result does not change.

      To access the API area that interests me I used Zabbix 6.2 and 6.4 and the official documentation, https://www.zabbix.com/documentation...ttptest/object, and as the API method the " httptest.get".

      The CURL command used is

      Code:

      curl -X POST -k -H 'Content-Type: application/json-rpc' -i 'https://zabbix.mydomain.com/zabbix/api_jsonrpc.php' --data '\{ "jsonrpc": "2.0", "method": "httptest.get", "params": { "selectSteps": "extend", "httptestids": "1", "selectHttpTests": "extend" },"auth":"<token my user>", "id": 1 }'
      Scrolling in the returned json, the key "status_code" is unfortunately empty while on the documentation it is indicated that if the site is online it should be "200".
      

      Can someone tell me how to fix it and if it was a bug how to report it?

      Thank you!​ 

            agavrilovs Aleksandrs Petrovs-Gavrilovs
            pecas Pecas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: