0) { foreach ($snmp_queries as $snmp_query) { db_execute("replace into host_snmp_query (host_id,snmp_query_id) values ($host_id," . $snmp_query["snmp_query_id"] . ")"); /* recache snmp data */ data_query($host_id, $snmp_query["snmp_query_id"]); } } } } if ((is_error_message()) || ($_POST["host_template_id"] != $_POST["_host_template_id"])) { header("Location: host.php?action=edit&id=" . (empty($host_id) ? $_POST["id"] : $host_id)); }else{ header("Location: host.php"); } } } /* --------------------- Host Functions --------------------- */ function host_reload_query() { data_query($_GET["host_id"], $_GET["id"]); } function host_remove_query() { db_execute("delete from host_snmp_cache where snmp_query_id=" . $_GET["id"] . " and host_id=" . $_GET["host_id"]); db_execute("delete from host_snmp_query where snmp_query_id=" . $_GET["id"] . " and host_id=" . $_GET["host_id"]); } function host_remove() { global $config; if ((read_config_option("remove_verification") == "on") && (!isset($_GET["confirm"]))) { include("./include/top_header.php"); form_confirm("Are You Sure?", "Are you sure you want to delete the host '" . db_fetch_cell("select description from host where id=" . $_GET["id"]) . "'?", $_SERVER["HTTP_REFERER"], "host.php?action=remove&id=" . $_GET["id"]); include("./include/bottom_footer.php"); exit; } if ((read_config_option("remove_verification") == "") || (isset($_GET["confirm"]))) { db_execute("delete from host where id=" . $_GET["id"]); db_execute("delete from host_snmp_query where host_id=" . $_GET["id"]); db_execute("delete from host_snmp_cache where host_id=" . $_GET["id"]); db_execute("update data_local set host_id=0 where host_id=" . $_GET["id"]); db_execute("update graph_local set host_id=0 where host_id=" . $_GET["id"]); } } function host_edit() { global $colors, $paths, $fields_host_edit; display_output_messages(); if (!empty($_GET["id"])) { $host = db_fetch_row("select * from host where id=" . $_GET["id"]); $header_label = "[edit: " . $host["description"] . "]"; }else{ $header_label = "[new]"; } start_box("Polling Hosts $header_label", "98%", $colors["header"], "3", "center", ""); draw_edit_form(array( "config" => array("form_name" => "chk"), "fields" => inject_form_variables($fields_host_edit, (isset($host) ? $host : array())) )); if (!empty($host["id"])) { form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],1); ?>
Associated Data Query
If you choose to add this data query to this host, information will be queried from this host upon addition.
 
Polling Hosts", "98%", $colors["header"], "3", "center", "host.php?action=edit"); print ""; DrawMatrixHeaderItem("Description",$colors["header_text"],1); DrawMatrixHeaderItem("Hostname",$colors["header_text"],1); DrawMatrixHeaderItem(" ",$colors["header_text"],1); print ""; $hosts = db_fetch_assoc("select id,hostname,description from host order by description"); $i = 0; if (sizeof($hosts) > 0) { foreach ($hosts as $host) { form_alternate_row_color($colors["alternate"],$colors["light"],$i); $i++; ?> "> ">Delete  No Hosts"; } end_box(); } ?>