summaryrefslogtreecommitdiffstats
path: root/src/zabbix_server/timer
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-08-11 09:47:48 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-08-11 09:47:48 +0000
commitb959f42a4b496e525775f0350175632edad8bcdd (patch)
treeaf09823a3dd0c4a2ec4fa3c96d212e66aacfc367 /src/zabbix_server/timer
parent253bc61881a9660f17125314fe0eb8cd792953b0 (diff)
downloadzabbix-b959f42a4b496e525775f0350175632edad8bcdd.tar.gz
zabbix-b959f42a4b496e525775f0350175632edad8bcdd.tar.xz
zabbix-b959f42a4b496e525775f0350175632edad8bcdd.zip
- time-related functions will be calculated regardless of host status (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@1973 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_server/timer')
-rw-r--r--src/zabbix_server/timer/timer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zabbix_server/timer/timer.c b/src/zabbix_server/timer/timer.c
index 328a1ca4..58283c51 100644
--- a/src/zabbix_server/timer/timer.c
+++ b/src/zabbix_server/timer/timer.c
@@ -79,9 +79,9 @@ void main_timer_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 and h.available!=%d) or (h.status=%d and h.available=%d and h.disable_until<%d)) and i.itemid=f.itemid and f.function in ('nodata','date','dayofweek','time','now') and i.lastclock+f.parameter::text::integer<=%d and i.status=%d and i.type=%d", HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, 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 and i.itemid=f.itemid and f.function in ('nodata','date','dayofweek','time','now') and i.lastclock+f.parameter::text::integer<=%d and i.status=%d", HOST_STATUS_MONITORED, now, ITEM_STATUS_ACTIVE);
#else
- snprintf(sql,sizeof(sql)-1,"select distinct f.itemid,f.functionid,f.parameter,f.function from functions f, items i,hosts h where h.hostid=i.hostid and ((h.status=%d and h.available!=%d) or (h.status=%d and h.available=%d and h.disable_until<%d)) and i.itemid=f.itemid and f.function in ('nodata','date','dayofweek','time','now') and i.lastclock+f.parameter<=%d and i.status=%d and i.type=%d", HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, HOST_STATUS_MONITORED, HOST_AVAILABLE_FALSE, now, now, ITEM_STATUS_ACTIVE, ITEM_TYPE_TRAPPER);
+ snprintf(sql,sizeof(sql)-1,"select distinct f.itemid,f.functionid,f.parameter,f.function from functions f, items i,hosts h where h.hostid=i.hostid and h.status=%d and i.itemid=f.itemid and f.function in ('nodata','date','dayofweek','time','now') and i.lastclock+f.parameter<=%d and i.status=%d", HOST_STATUS_MONITORED, now, ITEM_STATUS_ACTIVE);
#endif
result = DBselect(sql);