diff options
author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-02-06 10:30:17 +0000 |
---|---|---|
committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-02-06 10:30:17 +0000 |
commit | b2cba180a2e3fccbc339bf8816edd6ea5ad1db86 (patch) | |
tree | 25e15bbc87941698bb60d75ed5da98c06a6033ab | |
parent | c822906ff6919872a72b01ad450f55117b1d0822 (diff) | |
download | zabbix-b2cba180a2e3fccbc339bf8816edd6ea5ad1db86.tar.gz zabbix-b2cba180a2e3fccbc339bf8816edd6ea5ad1db86.tar.xz zabbix-b2cba180a2e3fccbc339bf8816edd6ea5ad1db86.zip |
- [DEV-106] Synchronizing of configuration tables
git-svn-id: svn://svn.zabbix.com/trunk@5326 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | src/zabbix_server/trapper/proxyconfig.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/zabbix_server/trapper/proxyconfig.c b/src/zabbix_server/trapper/proxyconfig.c index 5670360f..f221fc94 100644 --- a/src/zabbix_server/trapper/proxyconfig.c +++ b/src/zabbix_server/trapper/proxyconfig.c @@ -146,6 +146,7 @@ static int get_proxyconfig_data(zbx_uint64_t proxyid, struct zbx_json *j) static const struct proxytable_t pt[]={ {"hosts", NULL, NULL}, {"items", "hosts", "hostid"}, + {"nodes", NULL, NULL}, {NULL} }; int t, p; @@ -185,7 +186,8 @@ static int get_proxyconfig_data(zbx_uint64_t proxyid, struct zbx_json *j) ******************************************************************************/ int send_proxyconfig(zbx_sock_t *sock, struct zbx_json_parse *jp) { - char hostname[MAX_STRING_LEN]; + char hostname[MAX_STRING_LEN], + host_esc[MAX_STRING_LEN]; const char *p; DB_RESULT result; DB_ROW row; @@ -201,8 +203,9 @@ int send_proxyconfig(zbx_sock_t *sock, struct zbx_json_parse *jp) if (NULL == zbx_json_decodevalue(p, hostname, sizeof(hostname))) return res; + DBescape_string(hostname, host_esc, MAX_STRING_LEN); result = DBselect("select proxyid from proxies where name='%s' and"ZBX_COND_NODEID, - hostname, + host_esc, LOCAL_NODE("proxyid")); if (NULL != (row = DBfetch(result))) { @@ -210,7 +213,6 @@ int send_proxyconfig(zbx_sock_t *sock, struct zbx_json_parse *jp) zbx_json_init(&j, 512*1024); if (SUCCEED == get_proxyconfig_data(proxyid, &j)) { - zabbix_log(LOG_LEVEL_WARNING, "\n%s", j.buffer); zabbix_log(LOG_LEVEL_WARNING, "Sending configuration data to proxy \"%s\" datalen %zd", hostname, j.buffer_size); |