Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-5225

HTTP Agent maybe could collect internal information from the curl session

XMLWordPrintable

    • Icon: New Feature Request New Feature Request
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • None
    • Server (S)

      Now, the HTTP Agent only gets the response code (CURLINFO_RESPONSE_CODE), but not other internal information, which is very useful like CURLINFO_TOTAL_TIME, CURLINFO_STARTTRANSFER_TIME, etc.

      More Info: https://curl.haxx.se/libcurl/c/curl_easy_getinfo.html

      I make a external script in bash to collect this information, with preprocessing get Response code, Start Transfer Time and Total Response Time, with this info we detect performance problems.

      Example of external scrip:

      CALL:
      /usr/bin/curl -w '{"http_code":%{http_code},"size_download":%{size_download},"size_header":%{size_header},"size_request":%{size_request},"size_upload":%{size_upload},"speed_download":%{speed_download},"speed_upload":%{speed_upload},"time_connect":%{time_connect
      },"time_namelookup":%{time_namelookup},"time_starttransfer":%{time_starttransfer},"time_appconnect":%{time_appconnect},"time_pretransfer":%{time_pretransfer},"time_redirect":%{time_redirect},"time_total":%{time_total}}' -o /dev/null -s --data-binary "$XML_POST_DATA" -H "Accept-Encoding
      : gzip" -H "Content-Type: text/xml" $URL

      OUTPUT:
      {{{}}
      {{      "http_code": 200,}}
      {{      "size_download": 154118,}}
      {{      "size_header": 184,}}
      {{      "size_request": 196,}}
      {{      "size_upload": 1106,}}
      {{      "speed_download": 21590,}}
      {{      "speed_upload": 154,}}
      {{      "time_connect": 0.005,}}
      {{      "time_namelookup": 0.004,}}
      {{      "time_starttransfer": 0.006,}}
      {{      "time_appconnect": 0,}}
      {{      "time_pretransfer": 0.005,}}
      {{      "time_redirect": 0,}}
           "time_total": 7.138
      }

      This is only an idea.... if HTTP Agent have a new Retrive mode "Internal" and this return all internal information from curl session in JSON format like I paste before, The HTTP Agent are more powerful.

       

      Thanks,

       

      Mariano

       

            wiper Andris Zeila
            mobarrio Mariano Obarrio Miles
            Votes:
            7 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: