[ZBXNEXT-5225] HTTP Agent maybe could collect internal information from the curl session Created: 2019 May 15  Updated: 2024 Jan 04

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Server (S)
Affects Version/s: None
Fix Version/s: None

Type: New Feature Request Priority: Trivial
Reporter: Mariano Obarrio Miles Assignee: Andris Zeila
Resolution: Unresolved Votes: 7
Labels: HTTP, HTTPAgent, curl
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2019-05-15-14-04-07-627.png    
Issue Links:
Duplicate

 Description   

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

 



 Comments   
Comment by Glebs Ivanovskis [ 2019 May 15 ]

With Zabbix agent, SNMP, IPMI, ODBC, and other types of items you don't get the information how long it took to get the result, do you? Why would HTTP agent be any different? The result you get itself is way more important than the time it takes to get the result. If you are interested in measuring performance of HTTP service, consider using web scenario — there you can get response time, download speed, etc.

Comment by Mariano Obarrio Miles [ 2019 May 16 ]

Hi Glebs,
In the Agent you have performance measures using functions like net.tcp.service.perf, net.udp.service.perf or web.page.perf.

I think the big difference with other items is that HTTP Agent use cURL and currently collecting internal metrics of session but not all.

Of course If I use Web Scenarios get some of this information (not all) but is more easy and light use "http agent".

I desagree about that the result is most important than the time it takes to get it. This depend on what do you want to measre, in my use case, I try measure the user experience and the result is less important than the time to get it.

Comment by Mariano Obarrio Miles [ 2019 May 16 ]

I forgot to comment that I use LLD to discover hundreds services, Web Scenarios don't support LLD.

Comment by Glebs Ivanovskis [ 2019 May 16 ]

I meant that you don't get the information how long it took Zabbix server to connect to Zabbix agent even for net.*.service.perf items.

It's a pity that web scenarios can't be discovered. Seems like ZBXNEXT-2621 is very close to your use case.

Comment by richlv [ 2019 Jul 03 ]

Gathering more datapoints from a single check is useful - not only it is more efficient, it also allows to correlate those datapoints.
While web scenarios are doing that to some extent, gathering multiple datapoints is also useful for other items like ICMP ping.

Glebs mentioned that other item types do not offer extended information, but perhaps the thought train can go the other way around - that they actually should. That is, the base item and the *perf one should merge. User should still have the choice on whether to collect perf data (no need to store double data if it is not relevant).

Perhaps long-term HTTP agent item and web scenario could merge as well, with items becoming scenario steps, but that likely won't happen soon, if ever.

Generated at Thu Apr 25 22:42:40 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.