diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-08-24 10:04:51 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-08-24 10:04:51 +0000 |
commit | 0871955c1bbd573b3a5bd6ae9ce26a8c19c9b274 (patch) | |
tree | 2a150e6d3dd2213d82e8a99edbb595faf69301d1 /include/db.c | |
parent | 889dcc1108b7fe2df9cfdff25a03b26b8e882150 (diff) | |
download | zabbix-0871955c1bbd573b3a5bd6ae9ce26a8c19c9b274.tar.gz zabbix-0871955c1bbd573b3a5bd6ae9ce26a8c19c9b274.tar.xz zabbix-0871955c1bbd573b3a5bd6ae9ce26a8c19c9b274.zip |
Improvements for housekeeper (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@940 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'include/db.c')
-rw-r--r-- | include/db.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/db.c b/include/db.c index 78450151..9c5d7dc0 100644 --- a/include/db.c +++ b/include/db.c @@ -521,6 +521,28 @@ void update_triggers_status_to_unknown(int hostid,int clock) return; } +void DBdelete_host(int hostid) +{ + int i, itemid; + char sql[MAX_STRING_LEN+1]; + + zabbix_log(LOG_LEVEL_DEBUG,"In DBdelete_host(%d)", hostid); + sprintf(sql,"select itemid from items where hostid=%d", hostid); + result = DBselect(sql); + + for(i=0;i<DBnum_rows(result);i++) + { + itemid=atoi(DBget_field(result,i,0)); + DBdelete_item(itemid); + } + DBfree_result(result); + + sprintf(sql,"delete hosts where hostid=%d", hostid); + DBexecute(sql); + + zabbix_log(LOG_LEVEL_DEBUG,"End of DBdelete_host(%d)", hostid); +} + void DBupdate_triggers_status_after_restart(void) { int i; |