static int get_value(const char *source_ip, const char *host, unsigned short port, const char *key, int *version,
#include "zbxbincommon.h"
ZBX_GET_CONFIG_VAR2(const char *, const char *, zbx_progname, NULL)
static const char title_message[] = "zabbix_get";
static const char *usage_message[] = {
"-s host-name-or-IP", "[-p port-number]", "[-I IP-address]", "[-t timeout]", "-k item-key", NULL,
#if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
"-s host-name-or-IP", "[-p port-number]", "[-I IP-address]", "[-t timeout]", "--tls-connect cert",
"--tls-ca-file CA-file", "[--tls-crl-file CRL-file]", "[--tls-agent-cert-issuer cert-issuer]",
"[--tls-agent-cert-subject cert-subject]", "--tls-cert-file cert-file", "--tls-key-file key-file",
#if defined(HAVE_OPENSSL)
"[--tls-cipher13 cipher-string]",
#if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
"[--tls-cipher cipher-string]",
"-s host-name-or-IP", "[-p port-number]", "[-I IP-address]", "[-t timeout]", "--tls-connect psk",
"--tls-psk-identity PSK-identity", "--tls-psk-file PSK-file",
#if defined(HAVE_OPENSSL)
"[--tls-cipher13 cipher-string]",
#if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
"[--tls-cipher cipher-string]",
ZBX_GET_CONFIG_VAR(unsigned char, zbx_program_type, ZBX_PROGRAM_TYPE_GET)
#define CONFIG_GET_TIMEOUT_MIN 1
#define CONFIG_GET_TIMEOUT_MAX 30
#define CONFIG_GET_TIMEOUT_MIN_STR ZBX_STR(CONFIG_GET_TIMEOUT_MIN)
#define CONFIG_GET_TIMEOUT_MAX_STR ZBX_STR(CONFIG_GET_TIMEOUT_MAX)
static int CONFIG_GET_TIMEOUT = CONFIG_GET_TIMEOUT_MAX;
static const char *help_message[] = {
"Get data from Zabbix agent.",
" -s --host host-name-or-IP Specify host name or IP address of a host",
" -p --port port-number Specify port number of agent running on the host",
" (default: " ZBX_DEFAULT_AGENT_PORT_STR ")",
" -I --source-address IP-address Specify source IP address",
" -t --timeout seconds Specify timeout. Valid range: " CONFIG_GET_TIMEOUT_MIN_STR "-"
CONFIG_GET_TIMEOUT_MAX_STR " seconds",
" (default: " CONFIG_GET_TIMEOUT_MAX_STR " seconds)",