2012-09-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* include/functions_reporting.php
	 operation/reporting/reporting_xml.php: Some fixes on CSV and XML
	 report exportation.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6941 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2012-09-10 10:32:05 +00:00
parent 5470562748
commit c352eeebca
3 changed files with 46 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2012-09-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_reporting.php
operation/reporting/reporting_xml.php: Some fixes on CSV and XML
report exportation.
2012-09-10 Sergio Martin <sergio.martin@artica.es>
* include/functions_graph.php: Fixed some notices for

View File

@ -2417,6 +2417,12 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$sla_showed[] = $sla;
$sla_showed_values[] = $sla_value;
if (($config ['metaconsole'] == 1) && defined('METACONSOLE')) {
//Restore db connection
metaconsole_restore_db();
}
}
// SLA items sorted descending ()

View File

@ -16,6 +16,7 @@
include_once("include/functions_modules.php");
include_once("include/functions_events.php");
include_once ('include/functions_groups.php');
enterprise_include_once ('include/functions_metaconsole.php');
function xml_array ($array) {
foreach ($array as $name => $value) {
@ -189,6 +190,16 @@ foreach ($contents as $content) {
$data["uperiod"] = $content['period'];
$data["type"] = $content["type"];
// Support for metaconsole
$server_name = $content ['server_name'];
if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_connect($connection) != NOERR){
//ui_print_error_message ("Error connecting to ".$server_name);
}
}
$session_id = session_id();
switch ($content["type"]) {
@ -269,6 +280,17 @@ foreach ($contents as $content) {
$sla_failed = false;
foreach ($slas as $sla) {
//Metaconsole connection
$server_name = $sla ['server_name'];
if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_connect($connection) != NOERR) {
//ui_print_error_message ("Error connecting to ".$server_name);
continue;
}
}
$sla_data = array ();
$sla_data["agent"] = modules_get_agentmodule_agent_name ($sla['id_agent_module']);
$sla_data["module"] = modules_get_agentmodule_name ($sla['id_agent_module']);
@ -285,6 +307,12 @@ foreach ($contents as $content) {
$sla_data["value"] = format_numeric ($sla_value);
}
array_push ($data["objdata"]["sla"], $sla_data);
if (($config ['metaconsole'] == 1) && defined('METACONSOLE')) {
//Restore db connection
metaconsole_restore_db();
}
}
break;
case 6:
@ -662,6 +690,12 @@ foreach ($contents as $content) {
xml_array ($data);
echo '</object>';
$counter++;
if (($config ['metaconsole'] == 1) && defined('METACONSOLE')) {
//Restore db connection
metaconsole_restore_db();
}
}
echo '</reports></report>';