summaryrefslogtreecommitdiffstats
path: root/src/zabbix_server/functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/zabbix_server/functions.c')
-rw-r--r--src/zabbix_server/functions.c38
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;
}