diff options
author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-10-31 07:42:04 +0000 |
---|---|---|
committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-10-31 07:42:04 +0000 |
commit | cf058c2ec2bff2902940ebcb7b753267ac7bea98 (patch) | |
tree | f7eea92cfd095f103b0b0ac1dda7fe4bba019152 | |
parent | cb6645a1e4f14f29e542d5342e927695452138d8 (diff) | |
download | zabbix-cf058c2ec2bff2902940ebcb7b753267ac7bea98.tar.gz zabbix-cf058c2ec2bff2902940ebcb7b753267ac7bea98.tar.xz zabbix-cf058c2ec2bff2902940ebcb7b753267ac7bea98.zip |
- fixed recursion coping of elements from template
git-svn-id: svn://svn.zabbix.com/trunk@3415 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | frontends/php/include/db.inc.php | 2 | ||||
-rw-r--r-- | frontends/php/include/hosts.inc.php | 4 | ||||
-rw-r--r-- | frontends/php/include/items.inc.php | 2 | ||||
-rw-r--r-- | frontends/php/include/triggers.inc.php | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index 18097f31..000c14fb 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -26,7 +26,7 @@ // $DB_TYPE ="POSTGRESQL"; $DB_TYPE ="MYSQL"; $DB_SERVER ="localhost"; - $DB_DATABASE ="zabbix"; + $DB_DATABASE ="osmiy1"; $DB_USER ="root"; $DB_PASSWORD =""; // END OF DATABASE CONFIGURATION diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php index 834035cc..46fd29ee 100644 --- a/frontends/php/include/hosts.inc.php +++ b/frontends/php/include/hosts.inc.php @@ -375,7 +375,7 @@ require_once "include/items.inc.php"; function get_hosts_by_templateid($templateid) { - return DBselect("select * from hosts where templateid=$templateid"); + return DBselect("select h.* from hosts h, hosts_templates ht where h.hostid=ht.hostid and ht.templateid=$templateid"); } # Update Host status @@ -629,7 +629,7 @@ require_once "include/items.inc.php"; if(!$result) return $result; if($applicationid==null) - { + {// create application for childs $applicationid = $applicationid_new; $db_childs = get_hosts_by_templateid($hostid); diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php index 271061f5..cf7ae987 100644 --- a/frontends/php/include/items.inc.php +++ b/frontends/php/include/items.inc.php @@ -247,7 +247,7 @@ // add items to child hosts - $db_hosts = DBselect("select hostid from hosts where templateid=".$host["hostid"]); + $db_hosts = get_hosts_by_templateid($host["hostid"]); while($db_host = DBfetch($db_hosts)) { // recursion diff --git a/frontends/php/include/triggers.inc.php b/frontends/php/include/triggers.inc.php index 26a9edac..5d8b1109 100644 --- a/frontends/php/include/triggers.inc.php +++ b/frontends/php/include/triggers.inc.php @@ -340,7 +340,7 @@ } if($trig_host) - { + {// create trigger for childs $child_hosts = get_hosts_by_templateid($trig_host["hostid"]); while($child_host = DBfetch($child_hosts)) { |