--- host.php.orig 2006-10-09 05:06:01.000000000 +0200 +++ host.php 2006-12-05 14:55:29.000000000 +0100 @@ -41,7 +41,8 @@ 2 => "Enable", 3 => "Disable", 4 => "Change SNMP Options", - 5 => "Clear Statistics" + 5 => "Clear Statistics", + 6 => "Reapply Host Template" ); /* set default action */ @@ -270,6 +271,32 @@ api_device_remove($selected_items[$i]); } + }elseif ($_POST["drp_action"] == "6") { /* Reapply Host Template */ + for ($i=0;($i 0) { + foreach ($snmp_queries as $snmp_query) { + db_execute("replace into host_snmp_query (host_id,snmp_query_id,reindex_method) values ($selected_items[$i]," . $snmp_query["snmp_query_id"] . "," . DATA_QUERY_AUTOINDEX_BACKWARDS_UPTIME . ")"); + + /* recache snmp data */ + run_data_query($selected_items[$i], $snmp_query["snmp_query_id"]); + } + } + + $graph_templates = db_fetch_assoc("select graph_template_id from host_template_graph where host_template_id=$host_template_id"); + + if (sizeof($graph_templates) > 0) { + foreach ($graph_templates as $graph_template) { + db_execute("replace into host_graph (host_id,graph_template_id) values ($selected_items[$i]," . $graph_template["graph_template_id"] . ")"); + } + } + } }elseif (ereg("^tr_([0-9]+)$", $_POST["drp_action"], $matches)) { /* place on tree */ for ($i=0;($i$host_list

"; + }elseif ($_POST["drp_action"] == "6") { /* Reapply Host Template */ + print " + +

To reapply Host Template for the following devices, press the \"yes\" button below.

+

$host_list

+ + "; }elseif ($_POST["drp_action"] == "1") { /* delete */ print "