diff options
Diffstat (limited to 'src/zabbix_server/timer/timer.c')
-rw-r--r-- | src/zabbix_server/timer/timer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/zabbix_server/timer/timer.c b/src/zabbix_server/timer/timer.c index 1f8735c2..a73cb6e3 100644 --- a/src/zabbix_server/timer/timer.c +++ b/src/zabbix_server/timer/timer.c @@ -45,6 +45,8 @@ extern void update_triggers(int itemid); +extern int CONFIG_SERVERD_ID; + /****************************************************************************** * * * Function: main_timer_loop * @@ -81,9 +83,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 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); + 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 and i.serverid=%d", HOST_STATUS_MONITORED, now, ITEM_STATUS_ACTIVE,CONFIG_SERVERD_ID); #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 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); + 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 and i.serverid=%d", HOST_STATUS_MONITORED, now, ITEM_STATUS_ACTIVE,CONFIG_SERVERD_ID); #endif result = DBselect(sql); |