diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-04 11:10:23 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-04 11:10:23 +0000 |
commit | b8677042875ced11a84258e57642fa75e85a022c (patch) | |
tree | 120f7b0f197cac72079aae1f5a6b8db674ec3047 /src/zabbix_server/functions.c | |
parent | 560c32cc84776bc518a625dbc92acd08920e3fc1 (diff) | |
download | zabbix-b8677042875ced11a84258e57642fa75e85a022c.tar.gz zabbix-b8677042875ced11a84258e57642fa75e85a022c.tar.xz zabbix-b8677042875ced11a84258e57642fa75e85a022c.zip |
- automatic recovery of unsupported items (Alexei)
- added config.refresh_unsupported (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2386 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_server/functions.c')
-rw-r--r-- | src/zabbix_server/functions.c | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/src/zabbix_server/functions.c b/src/zabbix_server/functions.c index feb83ccc..776e0380 100644 --- a/src/zabbix_server/functions.c +++ b/src/zabbix_server/functions.c @@ -54,34 +54,6 @@ extern int autoregister(char *server); /****************************************************************************** * * - * Function: calculate_item_nextcheck * - * * - * Purpose: calculate nextcheck timespamp for item * - * * - * Parameters: delay - item's refresh rate in sec * - * now - current timestamp * - * * - * Return value: nextcheck value * - * * - * Author: Alexei Vladishev * - * * - * Comments: Old algorithm: now+delay * - * New one: preserve period, if delay==5, nextcheck = 0,5,10,15,... * - * * - ******************************************************************************/ -int calculate_item_nextcheck(int delay, int now) -{ - int i; - - i=delay*(int)(now/delay); - - while(i<=now) i+=delay; - - return i; -} - -/****************************************************************************** - * * * Function: update_functions * * * * Purpose: re-calculate and updates values of functions related to the item * @@ -761,6 +733,16 @@ static int update_item(DB_ITEM *item, AGENT_RESULT *value, int now) } DBexecute(sql); +/* Update item status if required */ + if(item->status == ITEM_STATUS_NOTSUPPORTED) + { + zabbix_log( LOG_LEVEL_WARNING, "Parameter [%s] became supported by agent on host [%s]", item->key, item->host ); + zabbix_syslog("Parameter [%s] became supported by agent on host [%s]", item->key, item->host ); + item->status = ITEM_STATUS_ACTIVE; + snprintf(sql,sizeof(sql)-1,"update items set status=%d where itemid=%d", ITEM_STATUS_ACTIVE, item->itemid); + DBexecute(sql); + } + return ret; } |