diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-10 19:26:41 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-10 19:26:41 +0000 |
commit | 428047af74ec7be9bf06d213d7e8a856d7fedabb (patch) | |
tree | 1e7627785d4d84a7a6cc2715fa3a827097aed6ce /src | |
parent | 60fa57a65117956b0766829f4c4c9ffd1ac6f741 (diff) | |
download | zabbix-428047af74ec7be9bf06d213d7e8a856d7fedabb.tar.gz zabbix-428047af74ec7be9bf06d213d7e8a856d7fedabb.tar.xz zabbix-428047af74ec7be9bf06d213d7e8a856d7fedabb.zip |
- fixed processing of SNMP and simple checks (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2408 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r-- | src/zabbix_server/functions.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/zabbix_server/functions.c b/src/zabbix_server/functions.c index 6f7b3827..f07b2ab5 100644 --- a/src/zabbix_server/functions.c +++ b/src/zabbix_server/functions.c @@ -579,40 +579,52 @@ static int add_history(DB_ITEM *item, AGENT_RESULT *value, int now) { /* Save delta */ if( (item->value_type==ITEM_VALUE_TYPE_FLOAT) && (value->type & AR_DOUBLE)) + { if((item->prevorgvalue_null == 0) && (item->prevorgvalue <= value->dbl)) { DBadd_history(item->itemid, (value->dbl - item->prevorgvalue)/(now-item->lastclock), now); } + } else if( (item->value_type==ITEM_VALUE_TYPE_FLOAT) && (value->type & AR_UINT64)) + { if((item->prevorgvalue_null == 0) && (item->prevorgvalue <= (double)value->ui64)) { DBadd_history(item->itemid, ((double)value->ui64 - item->prevorgvalue)/(now-item->lastclock), now); } + } else if((item->value_type==ITEM_VALUE_TYPE_UINT64) && (value->type & AR_UINT64)) + { if((item->prevorgvalue_null == 0) && (item->prevorgvalue <= value->ui64)) { DBadd_history_uint(item->itemid, (zbx_uint64_t)(value->ui64 - item->prevorgvalue)/(now-item->lastclock), now); } + } } /* Real delta: simple difference between values */ else if(item->delta == ITEM_STORE_SIMPLE_CHANGE) { /* Save delta */ if((item->value_type==ITEM_VALUE_TYPE_FLOAT) && (value->type & AR_DOUBLE)) + { if((item->prevorgvalue_null == 0) && (item->prevorgvalue <= value->dbl) ) { DBadd_history(item->itemid, (value->dbl - item->prevorgvalue), now); } + } else if((item->value_type==ITEM_VALUE_TYPE_FLOAT) && (value->type & AR_UINT64)) + { if((item->prevorgvalue_null == 0) && (item->prevorgvalue <= (double)value->ui64) ) { DBadd_history(item->itemid, ((double)value->ui64 - item->prevorgvalue), now); } + } else if((item->value_type==ITEM_VALUE_TYPE_UINT64) && (value->type & AR_UINT64)) + { if((item->prevorgvalue_null == 0) && (item->prevorgvalue <= value->ui64) ) { DBadd_history_uint(item->itemid, (value->ui64 - item->prevorgvalue), now); } + } } else { |