", $paths["cacti"], $xml_file_path); if (!file_exists($xml_file_path)) { return false; } $data = implode("",file($xml_file_path)); return xml2array($data); } function query_script_host($host_id, $snmp_query_id) { include ("config.php"); $script_queries = get_data_query_array($snmp_query_id); if ($script_queries == false) { return false; } /* get a complete path for out target script */ $script_path = str_replace("|path_cacti|", $paths["cacti"], $script_queries["script_path"]); /* fetch specified index at specified OID */ $script_index_array = exec_into_array($script_path . " " . $script_queries["arg_index"]); db_execute("delete from host_snmp_cache where host_id=$host_id and snmp_query_id=$snmp_query_id"); while (list($field_name, $field_array) = each($script_queries["fields"][0])) { $field_array = $field_array[0]; if (($field_array["method"] == "walk") && ($field_array["direction"] == "input")) { $script_data_array = exec_into_array($script_path . " " . $script_queries["arg_query"] . " " . $field_array["query_name"]); for ($i=0;($i