From 0dcb4e9f403253a308b088c145e7404c28de2008 Mon Sep 17 00:00:00 2001 From: osmiy Date: Mon, 22 Jan 2007 10:22:46 +0000 Subject: - added possibility of hostname using (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@3746 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- src/zabbix_get/Makefile.am | 2 +- src/zabbix_get/zabbix_get.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/zabbix_get') diff --git a/src/zabbix_get/Makefile.am b/src/zabbix_get/Makefile.am index 740c8d33..e38248ff 100644 --- a/src/zabbix_get/Makefile.am +++ b/src/zabbix_get/Makefile.am @@ -1,4 +1,4 @@ SUBDIRS = bin_PROGRAMS = zabbix_get zabbix_get_SOURCES = zabbix_get.c -zabbix_get_LDADD = ../libs/zbxcommon/libzbxcommon.a ../libs/zbxlog/libzbxlog.a ../libs/zbxcrypto/libzbxcrypto.a ../libs/zbxsys/libzbxsys.a ../libs/zbxconf/libzbxconf.a +zabbix_get_LDADD = ../libs/zbxcommon/libzbxcommon.a ../libs/zbxlog/libzbxlog.a ../libs/zbxcrypto/libzbxcrypto.a ../libs/zbxsys/libzbxsys.a ../libs/zbxconf/libzbxconf.a ../libs/zbxnet/libzbxnet.a diff --git a/src/zabbix_get/zabbix_get.c b/src/zabbix_get/zabbix_get.c index 785bd80f..c8298d0e 100644 --- a/src/zabbix_get/zabbix_get.c +++ b/src/zabbix_get/zabbix_get.c @@ -43,6 +43,8 @@ #include "common.h" +#include "zbxsock.h" + char *progname = NULL; char title_message[] = "ZABBIX get - Communicate with ZABBIX agent"; char usage_message[] = "[-hv] -s [-p] -k"; @@ -145,11 +147,10 @@ static int get_value(char *server,int port,char *key,char *value) /* printf("get_value([%s],[%d],[%s])",server,port,key);*/ servaddr_in.sin_family=AF_INET; - hp=gethostbyname(server); - if(hp==NULL) + if(NULL == (hp = zbx_gethost(server))); { - zbx_error("Error on gethostbyname. [%s]", strerror(errno)); + zbx_error("Error on gethost(). [%s]", strerror(errno)); return FAIL; } -- cgit