const char *progname = NULL;
const char title_message[] = "zabbix_get";
const char syslog_app_name[] = "zabbix_get";
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]",
unsigned char program_type = ZBX_PROGRAM_TYPE_GET;
static unsigned char get_program_type(void)
#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;
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)",
" -k --key item-key Specify key of the item to retrieve value for",
" -h --help Display this help message",
" -V --version Display version number",