summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-02-19 20:15:52 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-02-19 20:15:52 +0000
commitb9bdbe0d36474db098437592c7ecd02ff0718b0e (patch)
tree628a4a4e0b60936b5581fe247be354a57c019eeb /src
parentef3a42e35d42d516259353623c967c6186a85707 (diff)
- fix for initial update of host statuses (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2660 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r--src/zabbix_server/poller/poller.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/zabbix_server/poller/poller.c b/src/zabbix_server/poller/poller.c
index cfdd35c2..6a597b45 100644
--- a/src/zabbix_server/poller/poller.c
+++ b/src/zabbix_server/poller/poller.c
@@ -155,9 +155,10 @@ static void update_key_status(int hostid,int host_status)
DB_ITEM item;
DB_RESULT *result;
- zabbix_log(LOG_LEVEL_DEBUG, "In update_key_status()");
+ zabbix_log(LOG_LEVEL_DEBUG, "In update_key_status(%d,%d)",hostid,host_status);
snprintf(sql,sizeof(sql)-1,"select %s where h.hostid=i.hostid and h.hostid=%d and i.key_='%s'", ZBX_SQL_ITEM_SELECT, hostid,SERVER_STATUS_KEY);
+ zabbix_log(LOG_LEVEL_DEBUG, "SQL [%s]", sql);
result = DBselect(sql);
if( DBnum_rows(result) == 0)
@@ -169,7 +170,8 @@ static void update_key_status(int hostid,int host_status)
DBget_item_from_db(&item,result,0);
/* Do not process new value for status, if previous status is the same */
- if(cmp_double(item.lastvalue, (double)host_status) == 1)
+ zabbix_log( LOG_LEVEL_DEBUG, "item.lastvalue[%f] new host status[%d]",item.lastvalue,host_status);
+ if( (item.lastvalue_null==1) || (cmp_double(item.lastvalue, (double)host_status) == 1))
{
init_result(&agent);
SET_UI64_RESULT(&agent, host_status);