int zbx_get_agent_protocol_version_int(const char *version_str)
if (0 != strcmp(ZBX_VERSION_UNDEFINED_STR, version_str) &&
FAIL != (version_int = zbx_get_component_version(version_str)))
void zbx_agent_prepare_request(struct zbx_json *j, const char *key, int timeout)
zbx_json_addstring(j, ZBX_PROTO_TAG_REQUEST, ZBX_PROTO_VALUE_GET_PASSIVE_CHECKS, ZBX_JSON_TYPE_STRING);
zbx_json_addarray(j, ZBX_PROTO_TAG_DATA);
zbx_json_addobject(j, NULL);
zbx_json_addstring(j, ZBX_PROTO_TAG_KEY, key, ZBX_JSON_TYPE_STRING);
zbx_json_addint64(j, ZBX_PROTO_TAG_TIMEOUT, (zbx_int64_t)timeout);
int zbx_agent_handle_response(char *buffer, size_t read_bytes, ssize_t received_len, const char *addr,
AGENT_RESULT *result, int *version)
zabbix_log(LOG_LEVEL_DEBUG, "get value from agent result: '%s'", buffer);
SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Received empty response from Zabbix Agent at [%s]."
" Assuming that agent dropped connection because of access permissions.",
if (ZBX_COMPONENT_VERSION(7, 0, 0) <= *version)
struct zbx_json_parse jp, jp_data, jp_row;