summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-01-13 13:43:27 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-01-13 13:43:27 +0000
commit5a6adc26eecab5f2ca5b7d6ccd32929f86cd1eb7 (patch)
tree5338482d73d4b96ee37c826a6c7885c9f4f7d16a /src
parent3c634960c083dc93b465ca0e6606804fb3df2594 (diff)
downloadzabbix-5a6adc26eecab5f2ca5b7d6ccd32929f86cd1eb7.tar.gz
zabbix-5a6adc26eecab5f2ca5b7d6ccd32929f86cd1eb7.tar.xz
zabbix-5a6adc26eecab5f2ca5b7d6ccd32929f86cd1eb7.zip
- fixed evaluation of nodata(). Thanks to Igor Micko. (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@1600 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r--src/zabbix_server/server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zabbix_server/server.c b/src/zabbix_server/server.c
index e3c4ae7d..4528d6af 100644
--- a/src/zabbix_server/server.c
+++ b/src/zabbix_server/server.c
@@ -777,9 +777,9 @@ int main_nodata_loop()
now=time(NULL);
#ifdef HAVE_PGSQL
- snprintf(sql,sizeof(sql)-1,"select distinct f.itemid,f.functionid,f.parameter from functions f, items i,hosts h where h.hostid=i.hostid and (h.status=%d or (h.status=%d and h.disable_until<%d)) and i.itemid=f.itemid and f.function='nodata' and i.lastclock+f.parameter::text::integer<=%d and i.status=%d and i.type=%d and f.lastvalue<>1", HOST_STATUS_MONITORED, HOST_STATUS_UNREACHABLE, now, now, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER);
+ snprintf(sql,sizeof(sql)-1,"select distinct f.itemid,f.functionid,f.parameter from functions f, items i,hosts h where h.hostid=i.hostid and (h.status=%d or (h.status=%d and h.disable_until<%d)) and i.itemid=f.itemid and f.function='nodata' and i.lastclock+f.parameter::text::integer<=%d and i.status=%d and i.type=%d and (f.lastvalue<>1 or f.lastvalue is NULL)", HOST_STATUS_MONITORED, HOST_STATUS_UNREACHABLE, now, now, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER);
#else
- snprintf(sql,sizeof(sql)-1,"select distinct f.itemid,f.functionid,f.parameter from functions f, items i,hosts h where h.hostid=i.hostid and (h.status=%d or (h.status=%d and h.disable_until<%d)) and i.itemid=f.itemid and f.function='nodata' and i.lastclock+f.parameter<=%d and i.status=%d and i.type=%d and f.lastvalue<>1", HOST_STATUS_MONITORED, HOST_STATUS_UNREACHABLE, now, now, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER);
+ snprintf(sql,sizeof(sql)-1,"select distinct f.itemid,f.functionid,f.parameter from functions f, items i,hosts h where h.hostid=i.hostid and (h.status=%d or (h.status=%d and h.disable_until<%d)) and i.itemid=f.itemid and f.function='nodata' and i.lastclock+f.parameter<=%d and i.status=%d and i.type=%d and (f.lastvalue<>1 or f.lastvalue is NULL)", HOST_STATUS_MONITORED, HOST_STATUS_UNREACHABLE, now, now, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER);
#endif
#ifdef ZABBIX_THREADS