summaryrefslogtreecommitdiffstats
path: root/src/zabbix_server/nodewatcher
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-02-12 11:17:32 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-02-12 11:17:32 +0000
commit3c84ea4214e238d11de802a888a7c1539fbfc07e (patch)
tree95f8b0bd9ca77e97ceec19fdb0cf9086290349fd /src/zabbix_server/nodewatcher
parent2fe0bdc77b19a0357570a0d752aae59fe40345b3 (diff)
downloadzabbix-3c84ea4214e238d11de802a888a7c1539fbfc07e.tar.gz
zabbix-3c84ea4214e238d11de802a888a7c1539fbfc07e.tar.xz
zabbix-3c84ea4214e238d11de802a888a7c1539fbfc07e.zip
- [DEV-109] Server changes - Nodewatcher
git-svn-id: svn://svn.zabbix.com/trunk@5349 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_server/nodewatcher')
-rw-r--r--src/zabbix_server/nodewatcher/history.c9
-rw-r--r--src/zabbix_server/nodewatcher/nodesender.c13
2 files changed, 13 insertions, 9 deletions
diff --git a/src/zabbix_server/nodewatcher/history.c b/src/zabbix_server/nodewatcher/history.c
index edcdd69c..574940fc 100644
--- a/src/zabbix_server/nodewatcher/history.c
+++ b/src/zabbix_server/nodewatcher/history.c
@@ -211,17 +211,18 @@ void process_history_table_data(ZBX_TABLE *table, int master_nodeid, int nodeid)
zbx_snprintf_alloc(&tmp, &tmp_allocated, &tmp_offset, 1024, " from %s where"
" (itemid>"ZBX_FS_UI64" or (itemid="ZBX_FS_UI64" and clock>%d)) and clock<%d"
- " and"ZBX_COND_NODEID"order by itemid,clock",
+ DB_NODE " order by itemid,clock",
table->table,
lastid, lastid, lastclock, clock,
- ZBX_NODE("itemid", nodeid));
+ DBnode("itemid", nodeid));
} else { /* ZBX_HISTORY */
zbx_snprintf_alloc(&tmp, &tmp_allocated, &tmp_offset, 1024, " from %s where %s>"ZBX_FS_UI64
- " and"ZBX_COND_NODEID"order by %2$s",
+ DB_NODE " order by %s",
table->table,
table->recid,
lastid,
- ZBX_NODE(table->recid, nodeid));
+ DBnode(table->recid, nodeid),
+ table->recid);
}
result = DBselectN(tmp, 10000);
diff --git a/src/zabbix_server/nodewatcher/nodesender.c b/src/zabbix_server/nodewatcher/nodesender.c
index 0e49e60b..d7cfc671 100644
--- a/src/zabbix_server/nodewatcher/nodesender.c
+++ b/src/zabbix_server/nodewatcher/nodesender.c
@@ -107,12 +107,14 @@ int calculate_checksums(int nodeid, const char *tablename, const zbx_uint64_t id
case ZBX_TYPE_INT :
case ZBX_TYPE_UINT :
zbx_snprintf_alloc(&sql, &sql_allocated, &sql_offset, 128,
- "case when %s is null then 'NULL' else %1$s end",
+ "case when %s is null then 'NULL' else %s end",
+ tables[t].fields[f].name,
tables[t].fields[f].name);
break;
default :
zbx_snprintf_alloc(&sql, &sql_allocated, &sql_offset, 128,
- "case when %s is null then 'NULL' else md5(%1$s) end",
+ "case when %s is null then 'NULL' else md5(%s) end",
+ tables[t].fields[f].name,
tables[t].fields[f].name);
break;
}
@@ -139,9 +141,9 @@ int calculate_checksums(int nodeid, const char *tablename, const zbx_uint64_t id
}
zbx_snprintf_alloc(&sql, &sql_allocated, &sql_offset, 512,
- " from %s where"ZBX_COND_NODEID,
+ " from %s where 1=1" DB_NODE,
tables[t].table,
- ZBX_NODE(tables[t].recid,nodeid));
+ DBnode(tables[t].recid, nodeid));
if (0 != id) {
zbx_snprintf_alloc(&sql, &sql_allocated, &sql_offset, 128,
@@ -280,7 +282,8 @@ char *get_config_data(int nodeid, int dest_nodetype)
if (r[0] == NULL || r[1] == NULL || (dest_nodetype == ZBX_NODE_SLAVE && *s != c) ||
(dest_nodetype == ZBX_NODE_MASTER && *(s+1) != c) || strcmp(r[0], r[1]) != 0) {
- zbx_snprintf_alloc(&sql, &sql_allocated, &sql_offset, 128, "%s,length(%1$s),",
+ zbx_snprintf_alloc(&sql, &sql_allocated, &sql_offset, 128, "%s,length(%s),",
+ tables[t].fields[f].name,
tables[t].fields[f].name);
}
s += 2;