". $agent_data['nombre']."\n";
$content_report .= " ". $agent_data['comentarios']."\n";
$content_report .= " ".$agent_data['direccion']."\n";
$content_report .= " ".$agent_data['id_grupo']."\n";
$content_report .= " ". $agent_data['intervalo']."\n";
$sql = "SELECT t1.description, t2.name
FROM tagent_custom_data t1, tagent_custom_fields t2
WHERE t1.id_agent=".$agent_data['id_agente']."
AND t1.id_field=t2.id_field";
$custom_fields = db_get_all_rows_sql($sql);
if ($custom_fields !== false) {
foreach ($custom_fields as $field) {
$field['name'] = io_safe_output($field['name']);
//remove blank
$field['name'] = preg_replace('/\s/', '_', $field['name']);
$content_report .= " <".$field['name'].">".$field['description']."".$field['name'].">\n";
}
}
$content_report .= " ".$agent_data['id_os']."\n";
$content_report .= " ". agents_get_name ($agent_data['id_parent'])."\n";
$content_report .= " ".$agent_data['id_extra']."\n";
$content_report .= " ".$agent_data['disabled']."\n";
$result = fwrite($file, $content_report);
$position++;
fclose($file);
return $position;
}
//xml con los datos de módulos de un agente
function xml_file_agent_conf ($modules = array(), $file_temp, $position = 0, $id_agent) {
$file = fopen($file_temp, 'a+');
foreach ($modules as $module) {
$content_report = " \n";
$result = fwrite($file, $content_report);
$position++;
}
fclose($file);
return $position;
}
// xml eventos
function xml_file_event ($events = array(), $file_temp, $position = 0, $id_agent) {
$file = fopen($file_temp, 'a+');
foreach ($events as $event) {
$content_report = " \n";
$result = fwrite($file, $content_report);
$position++;
}
fclose($file);
return $position;
}
//xml graph
function xml_file_graph ($data_module = array(), $file_temp, $position = 0) {
$file = fopen($file_temp, 'a+');
foreach ($data_module as $data_m) {
$content_report = " \n";
$result = fwrite($file, $content_report);
$position++;
}
fclose($file);
return $position;
}
?>