diff options
author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-01-22 10:22:46 +0000 |
---|---|---|
committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-01-22 10:22:46 +0000 |
commit | 0dcb4e9f403253a308b088c145e7404c28de2008 (patch) | |
tree | bf43806b346e24fdf47ef7045d9b023f71a6462e /src/zabbix_get | |
parent | 621cd1669477fe40dfcb023bd48cdff267be84df (diff) | |
download | zabbix-0dcb4e9f403253a308b088c145e7404c28de2008.tar.gz zabbix-0dcb4e9f403253a308b088c145e7404c28de2008.tar.xz zabbix-0dcb4e9f403253a308b088c145e7404c28de2008.zip |
- added possibility of hostname using (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3746 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_get')
-rw-r--r-- | src/zabbix_get/Makefile.am | 2 | ||||
-rw-r--r-- | src/zabbix_get/zabbix_get.c | 7 |
2 files changed, 5 insertions, 4 deletions
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<host name or IP> [-p<port number>] -k<key>"; @@ -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; } |