diff options
author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-08-01 15:17:17 +0000 |
---|---|---|
committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-08-01 15:17:17 +0000 |
commit | e040ad4ad0dbec022158c000590ee7eb5b412a66 (patch) | |
tree | 1b941dbabcd6458a3f39c6dfca335d5e9f04208c | |
parent | 61719f5136e0d1876782232ee4d611042654327c (diff) | |
download | zabbix-e040ad4ad0dbec022158c000590ee7eb5b412a66.tar.gz zabbix-e040ad4ad0dbec022158c000590ee7eb5b412a66.tar.xz zabbix-e040ad4ad0dbec022158c000590ee7eb5b412a66.zip |
- [DEV-195] added support of source ip address
git-svn-id: svn://svn.zabbix.com/trunk@5863 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | misc/conf/zabbix_agentd.conf | 3 | ||||
-rw-r--r-- | misc/conf/zabbix_proxy.conf | 3 | ||||
-rw-r--r-- | misc/conf/zabbix_server.conf | 3 | ||||
-rw-r--r-- | src/zabbix_proxy/servercomms.c | 2 | ||||
-rw-r--r-- | src/zabbix_proxy/servercomms.h | 1 |
5 files changed, 11 insertions, 1 deletions
diff --git a/misc/conf/zabbix_agentd.conf b/misc/conf/zabbix_agentd.conf index 74347b46..bbb9a28d 100644 --- a/misc/conf/zabbix_agentd.conf +++ b/misc/conf/zabbix_agentd.conf @@ -27,6 +27,9 @@ Hostname=localhost #ListenIP=127.0.0.1 +# Source IP address for outgouing connections +#SourceIP= + # Number of pre-forked instances of zabbix_agentd. # Default value is 5 # This parameter must be between 1 and 16 diff --git a/misc/conf/zabbix_proxy.conf b/misc/conf/zabbix_proxy.conf index e9eefb06..420a2cf1 100644 --- a/misc/conf/zabbix_proxy.conf +++ b/misc/conf/zabbix_proxy.conf @@ -50,6 +50,9 @@ Hostname=proxy # must be between 1024 and 32767 #ListenPort=10051 +# Source IP address for outgouing connections +#SourceIP= + # Listen interface for trapper. Trapper will listen all network interfaces # if this parameter is missing. #ListenIP=127.0.0.1 diff --git a/misc/conf/zabbix_server.conf b/misc/conf/zabbix_server.conf index 171378f9..dfc17860 100644 --- a/misc/conf/zabbix_server.conf +++ b/misc/conf/zabbix_server.conf @@ -44,6 +44,9 @@ #ListenPort=10051 +# Source IP address for outgouing connections +#SourceIP= + # Listen interface for trapper. Trapper will listen all network interfaces # if this parameter is missing. diff --git a/src/zabbix_proxy/servercomms.c b/src/zabbix_proxy/servercomms.c index e0651bfa..ce98f405 100644 --- a/src/zabbix_proxy/servercomms.c +++ b/src/zabbix_proxy/servercomms.c @@ -36,7 +36,7 @@ int connect_to_server(zbx_sock_t *sock, int timeout) CONFIG_SERVER_PORT, timeout); - if (FAIL == (res = zbx_tcp_connect(sock, CONFIG_SERVER, CONFIG_SERVER_PORT, timeout))) + if (FAIL == (res = zbx_tcp_connect(sock, CONFIG_SOURCE_IP, CONFIG_SERVER, CONFIG_SERVER_PORT, timeout))) zabbix_log(LOG_LEVEL_ERR, "Unable connect to the server [%s]:%d [%s]", CONFIG_SERVER, CONFIG_SERVER_PORT, diff --git a/src/zabbix_proxy/servercomms.h b/src/zabbix_proxy/servercomms.h index 10974fb5..cb959b13 100644 --- a/src/zabbix_proxy/servercomms.h +++ b/src/zabbix_proxy/servercomms.h @@ -20,6 +20,7 @@ #ifndef ZABBIX_SERVERCOMMS_H #define ZABBIX_SERVERCOMMS_H +extern char *CONFIG_SOURCE_IP; extern char *CONFIG_SERVER; extern int CONFIG_SERVER_PORT; extern char *CONFIG_HOSTNAME; |