diff options
Diffstat (limited to 'src/libs/zbxsysinfo/simple')
-rw-r--r-- | src/libs/zbxsysinfo/simple/ntp.c | 3 | ||||
-rw-r--r-- | src/libs/zbxsysinfo/simple/ntp.h | 2 | ||||
-rw-r--r-- | src/libs/zbxsysinfo/simple/simple.c | 2 | ||||
-rw-r--r-- | src/libs/zbxsysinfo/simple/simple.h | 1 |
4 files changed, 6 insertions, 2 deletions
diff --git a/src/libs/zbxsysinfo/simple/ntp.c b/src/libs/zbxsysinfo/simple/ntp.c index 55c227a8..f1e7c082 100644 --- a/src/libs/zbxsysinfo/simple/ntp.c +++ b/src/libs/zbxsysinfo/simple/ntp.c @@ -22,6 +22,7 @@ #include "comms.h" #include "log.h" #include "cfg.h" +#include "ntp.h" #define NTP_SCALE 4294967296.0 /* 2^32, of course! */ @@ -190,7 +191,7 @@ int check_ntp(char *host, unsigned short port, int *value_int) *value_int = 0; - if (SUCCEED == (ret = zbx_tcp_connect(&s, host, port, 0))) { + if (SUCCEED == (ret = zbx_tcp_connect(&s, CONFIG_SOURCE_IP, host, port, 0))) { make_packet(&data); pack_ntp((unsigned char*)packet, sizeof(packet), &data); diff --git a/src/libs/zbxsysinfo/simple/ntp.h b/src/libs/zbxsysinfo/simple/ntp.h index 2805b36a..4d9b0ea2 100644 --- a/src/libs/zbxsysinfo/simple/ntp.h +++ b/src/libs/zbxsysinfo/simple/ntp.h @@ -19,6 +19,8 @@ #if !defined(SYSINFO_SYMPLE_NTP_H_INCLUDED) +extern char *CONFIG_SOURCE_IP; + int check_ntp(char *host, unsigned short port, int *value_int); #endif /* SYSINFO_SYMPLE_NTP_H_INCLUDED */ diff --git a/src/libs/zbxsysinfo/simple/simple.c b/src/libs/zbxsysinfo/simple/simple.c index 03bb05f7..b29b8e6f 100644 --- a/src/libs/zbxsysinfo/simple/simple.c +++ b/src/libs/zbxsysinfo/simple/simple.c @@ -118,7 +118,7 @@ static int check_ssh(const char *host, unsigned short port, int *value_int) assert(value_int); *value_int = 0; - if (SUCCEED == (ret = zbx_tcp_connect(&s, host, port, 0))) { + if (SUCCEED == (ret = zbx_tcp_connect(&s, CONFIG_SOURCE_IP, host, port, 0))) { if( SUCCEED == (ret = zbx_tcp_recv(&s, &recv_buf)) ) { if ( 0 == strncmp(recv_buf, "SSH", 3) ) diff --git a/src/libs/zbxsysinfo/simple/simple.h b/src/libs/zbxsysinfo/simple/simple.h index cc00e2ce..41f47443 100644 --- a/src/libs/zbxsysinfo/simple/simple.h +++ b/src/libs/zbxsysinfo/simple/simple.h @@ -21,6 +21,7 @@ #include "sysinfo.h" +extern char *CONFIG_SOURCE_IP; extern ZBX_METRIC parameters_simple[]; int CHECK_SERVICE_PERF(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); |