diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-22 16:08:35 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-22 16:08:35 +0000 |
| commit | cfdccc6dd4f9d313f6cdc34f62f6453a1f5a1a0b (patch) | |
| tree | f1c9d0192496011e899f91dd9575db73d5cfc77a /frontends/php/include/hosts.inc.php | |
| parent | 1e241634d9beb1dc6368d270f8be45d158c66a18 (diff) | |
| download | zabbix-cfdccc6dd4f9d313f6cdc34f62f6453a1f5a1a0b.tar.gz zabbix-cfdccc6dd4f9d313f6cdc34f62f6453a1f5a1a0b.tar.xz zabbix-cfdccc6dd4f9d313f6cdc34f62f6453a1f5a1a0b.zip | |
- added hosekeeper support for frontend (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2675 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/hosts.inc.php')
| -rw-r--r-- | frontends/php/include/hosts.inc.php | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php index 83b84ed4..1763b364 100644 --- a/frontends/php/include/hosts.inc.php +++ b/frontends/php/include/hosts.inc.php @@ -278,22 +278,32 @@ $ret = FALSE; - for($i=0;$i<100;$i++) + // delete items -> triggers -> graphs + $db_items = get_items_by_hostid($hostid); + while($db_item = DBfetch($db_items)) { - if($DB_TYPE=="MYSQL") - { - $sql="update hosts set status=".HOST_STATUS_DELETED.",host=concat(host,\" [DEL$i]\") where hostid=$hostid"; - } - else - { - $sql="update hosts set status=".HOST_STATUS_DELETED.",host=host||' [DEL$i]' where hostid=$hostid"; - } - if($ret = DBexecute($sql,1)) break; + delete_item($db_item["itemid"]); } - if($ret){ - delete_host_profile($hostid); + + // delete host from maps + delete_sysmaps_host_by_hostid($hostid); + + // delete host from group + DBexecute("delete from hosts_groups where hostid=$hostid"); + + // unlink child hosts + $db_childs = get_hosts_by_templateid($hostid); + while($db_child = DBfetch($db_childs)) + { + DBexecute("update hosts set templateid=0 where hostid=".$db_child["hostid"]); + sync_host_with_templates($hostid); } - return $ret; + + // delete host profile + delete_host_profile($hostid); + + // delete host + return DBexecute("delete from hosts where hostid=$hostid"); } function delete_host_group($groupid) |
