diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2001-08-30 12:00:02 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2001-08-30 12:00:02 +0000 |
commit | 021efd5bfe977924076cccd522b09d62f9218bad (patch) | |
tree | 4a9b9cbef104a9919c5b2f7ec0b7f51bab9e4212 /src | |
parent | ee10f3832e9cb01b848842510cff0b9097227982 (diff) | |
download | zabbix-021efd5bfe977924076cccd522b09d62f9218bad.tar.gz zabbix-021efd5bfe977924076cccd522b09d62f9218bad.tar.xz zabbix-021efd5bfe977924076cccd522b09d62f9218bad.zip |
All calculations are made in C code instead of SQL statements.
git-svn-id: svn://svn.zabbix.com/trunk@177 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r-- | src/zabbix_sucker/zabbix_sucker.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zabbix_sucker/zabbix_sucker.c b/src/zabbix_sucker/zabbix_sucker.c index d7907f2a..b113a36c 100644 --- a/src/zabbix_sucker/zabbix_sucker.c +++ b/src/zabbix_sucker/zabbix_sucker.c @@ -418,7 +418,7 @@ int get_values(void) sprintf(c,"insert into history (itemid,clock,value) values (%d,%d,%g)",item.itemid,now,value); DBexecute(c); - sprintf(c,"update items set NextCheck=%d+%d,PrevValue=LastValue,LastValue=%f,LastClock=%d where ItemId=%d",now,item.delay,value,now,item.itemid); + sprintf(c,"update items set NextCheck=%d,PrevValue=LastValue,LastValue=%f,LastClock=%d where ItemId=%d",now+item.delay,value,now,item.itemid); DBexecute(c); if( update_functions( item.itemid ) == FAIL) @@ -470,7 +470,7 @@ int housekeeping_items() item.history=atoi(DBget_field(result,i,2)); now = time(NULL); - sprintf (c,"delete from history where ItemId=%d and Clock<%d-%d",item.itemid,now,item.history); + sprintf (c,"delete from history where ItemId=%d and Clock<%d",item.itemid,now-item.history); DBexecute(c); now = time(NULL); |