diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-22 12:33:15 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-22 12:33:15 +0000 |
| commit | bc3b6068812aa65d806b74b9b89ff1aa74ee0ccb (patch) | |
| tree | 566cced4de2cae16b50466d4844795269006714e /src | |
| parent | a188c2ece5008cd0bbee80407551a1f024ab690c (diff) | |
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@2670 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
| -rw-r--r-- | src/zabbix_server/housekeeper/housekeeper.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/zabbix_server/housekeeper/housekeeper.c b/src/zabbix_server/housekeeper/housekeeper.c index 2f67e42b..c943027e 100644 --- a/src/zabbix_server/housekeeper/housekeeper.c +++ b/src/zabbix_server/housekeeper/housekeeper.c @@ -54,6 +54,8 @@ static int delete_history(int itemid) { char sql[MAX_STRING_LEN]; + zabbix_log(LOG_LEVEL_WARNING,"In delete_history(%d)", itemid); + snprintf(sql,sizeof(sql)-1,"delete from history where itemid=%d limit 500", itemid); DBexecute(sql); @@ -64,6 +66,8 @@ static int delete_trends(int itemid) { char sql[MAX_STRING_LEN]; + zabbix_log(LOG_LEVEL_WARNING,"In delete_trends(%d)", itemid); + snprintf(sql,sizeof(sql)-1,"delete from trends where itemid=%d limit 500", itemid); DBexecute(sql); @@ -75,7 +79,7 @@ static int delete_item(int itemid) char sql[MAX_STRING_LEN]; int res = 0; - zabbix_log(LOG_LEVEL_DEBUG,"In delete_item(%d)", itemid); + zabbix_log(LOG_LEVEL_WARNING,"In delete_item(%d)", itemid); res = delete_history(itemid); @@ -104,7 +108,8 @@ static int delete_host(int hostid) DB_RESULT *result; int res = 0; - zabbix_log(LOG_LEVEL_DEBUG,"In delete_host(%d)", hostid); + zabbix_log(LOG_LEVEL_WARNING,"In delete_host(%d)", hostid); + snprintf(sql,sizeof(sql)-1,"select itemid from items where hostid=%d", hostid); result = DBselect(sql); @@ -156,6 +161,8 @@ static int housekeeping_items(void) DB_RESULT *result; int i,itemid; + zabbix_log( LOG_LEVEL_WARNING, "In housekeeping_items()"); + snprintf(sql,sizeof(sql)-1,"select itemid from items where status=%d", ITEM_STATUS_DELETED); result = DBselect(sql); for(i=0;i<DBnum_rows(result);i++) @@ -188,6 +195,8 @@ static int housekeeping_hosts(void) char sql[MAX_STRING_LEN]; DB_RESULT *result; int i,hostid; + + zabbix_log( LOG_LEVEL_WARNING, "In housekeeping_hosts()"); snprintf(sql,sizeof(sql)-1,"select hostid from hosts where status=%d", HOST_STATUS_DELETED); result = DBselect(sql); @@ -225,6 +234,8 @@ static int housekeeping_history_and_trends(int now) int i; + zabbix_log( LOG_LEVEL_WARNING, "In housekeeping_history_and_trends(%d)", now); + snprintf(sql,sizeof(sql)-1,"select itemid,history,delay,trends from items"); result = DBselect(sql); @@ -288,6 +299,8 @@ static int housekeeping_sessions(int now) { char sql[MAX_STRING_LEN]; + zabbix_log( LOG_LEVEL_WARNING, "In housekeeping_sessions(%d)", now); + snprintf(sql,sizeof(sql)-1,"delete from sessions where lastaccess<%d",now-24*3600); DBexecute(sql); @@ -301,6 +314,8 @@ static int housekeeping_alerts(int now) DB_RESULT *result; int res = SUCCEED; + zabbix_log( LOG_LEVEL_WARNING, "In housekeeping_alarms(%d)", now); + snprintf(sql,sizeof(sql)-1,"select alert_history from config"); result = DBselect(sql); @@ -328,6 +343,8 @@ static int housekeeping_alarms(int now) DB_RESULT *result; int res = SUCCEED; + zabbix_log( LOG_LEVEL_WARNING, "In housekeeping_alarms(%d)", now); + snprintf(sql,sizeof(sql)-1,"select alarm_history from config"); result = DBselect(sql); if(DBnum_rows(result) == 0) @@ -340,6 +357,7 @@ static int housekeeping_alarms(int now) alarm_history=atoi(DBget_field(result,0,0)); snprintf(sql,sizeof(sql)-1,"delete from alarms where clock<%d",now-24*3600*alarm_history); + zabbix_log( LOG_LEVEL_WARNING, "SQL [%s]", sql); DBexecute(sql); } @@ -351,6 +369,8 @@ int main_housekeeper_loop() { int now; + zabbix_set_log_level(LOG_LEVEL_DEBUG); + if(CONFIG_DISABLE_HOUSEKEEPING == 1) { for(;;) |
