diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-07-19 14:17:45 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-07-19 14:17:45 +0000 |
| commit | 2691ad6741639192c107509983aa42a0fcd39141 (patch) | |
| tree | 83dfc7e8829477e3ee68d4917dc4eb7e80446cc3 /frontends/php/include/items.inc.php | |
| parent | 9952250afe4243f8ac3de8fbcb7d4b5b1292179d (diff) | |
- developed "Copty to" functionality for trigger groups (Eugene)
- developed "Copty to" functionality for item groups (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3067 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/items.inc.php')
| -rw-r--r-- | frontends/php/include/items.inc.php | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php index 328074e8..a62e78c1 100644 --- a/frontends/php/include/items.inc.php +++ b/frontends/php/include/items.inc.php @@ -372,12 +372,47 @@ } } + function copy_item_to_host($itemid, $hostid, $copy_mode = false) + { + $db_tmp_item = get_item_by_itemid($itemid); + + $parrent_applications = array(); + $db_applications = get_applications_by_itemid($db_tmp_item["itemid"]); + while($db_application = DBfetch($db_applications)) + array_push($parrent_applications,$db_application["applicationid"]); + + add_item( + $db_tmp_item["description"], + $db_tmp_item["key_"], + $hostid, + $db_tmp_item["delay"], + $db_tmp_item["history"], + $db_tmp_item["status"], + $db_tmp_item["type"], + $db_tmp_item["snmp_community"], + $db_tmp_item["snmp_oid"], + $db_tmp_item["value_type"], + $db_tmp_item["trapper_hosts"], + $db_tmp_item["snmp_port"], + $db_tmp_item["units"], + $db_tmp_item["multiplier"], + $db_tmp_item["delta"], + $db_tmp_item["snmpv3_securityname"], + $db_tmp_item["snmpv3_securitylevel"], + $db_tmp_item["snmpv3_authpassphrase"], + $db_tmp_item["snmpv3_privpassphrase"], + $db_tmp_item["formula"], + $db_tmp_item["trends"], + $db_tmp_item["logtimefmt"], + $db_tmp_item["valuemapid"], + get_same_applications_for_host($parrent_applications,$hostid), + $copy_mode ? 0 : $db_tmp_item["itemid"]); + } + function copy_template_items($hostid, $templateid = null, $copy_mode = false) { $host = get_host_by_hostid($hostid); -//SDI("sync host: ".$host['host']); - $db_tmp_items = get_items_by_hostid($host["templateid"]); while($db_tmp_item = DBfetch($db_tmp_items)) @@ -387,7 +422,6 @@ while($db_application = DBfetch($db_applications)) array_push($parrent_applications,$db_application["applicationid"]); - $applications = get_same_applications_for_host($parrent_applications,$hostid); add_item( $db_tmp_item["description"], @@ -413,7 +447,7 @@ $db_tmp_item["trends"], $db_tmp_item["logtimefmt"], $db_tmp_item["valuemapid"], - $applications, + get_same_applications_for_host($parrent_applications,$hostid), $copy_mode ? 0 : $db_tmp_item["itemid"]); } } |
