mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
2012-09-07 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_html.php include/graphs/fgraph.php include/functions_reporting.php include/javascript/pandora.js include/ajax/reporting.ajax.php include/ajax/agent.php pandoradb.sql pandoradb.postgreSQL.sql pandoradb.oracle.sql operation/agentes/ver_agente.php operation/reporting/reporting_viewer.php extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql general/header.php godmode/reporting/reporting_builder.list_items.php godmode/reporting/reporting_builder.php godmode/reporting/reporting_builder.item_editor.php: Integration of reports in metaconsole. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6938 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
d6cf6e4785
commit
75fde73952
@ -1,3 +1,25 @@
|
|||||||
|
2012-09-07 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
|
* include/functions_html.php
|
||||||
|
include/graphs/fgraph.php
|
||||||
|
include/functions_reporting.php
|
||||||
|
include/javascript/pandora.js
|
||||||
|
include/ajax/reporting.ajax.php
|
||||||
|
include/ajax/agent.php
|
||||||
|
pandoradb.sql
|
||||||
|
pandoradb.postgreSQL.sql
|
||||||
|
pandoradb.oracle.sql
|
||||||
|
operation/agentes/ver_agente.php
|
||||||
|
operation/reporting/reporting_viewer.php
|
||||||
|
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql
|
||||||
|
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql
|
||||||
|
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql
|
||||||
|
general/header.php
|
||||||
|
godmode/reporting/reporting_builder.list_items.php
|
||||||
|
godmode/reporting/reporting_builder.php
|
||||||
|
godmode/reporting/reporting_builder.item_editor.php: Integration of reports
|
||||||
|
in metaconsole.
|
||||||
|
|
||||||
2012-09-07 Miguel de Dios <miguel.dedios@artica.es>
|
2012-09-07 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
* include/functions_ui.php: fixed the ui_get_full_url function,
|
* include/functions_ui.php: fixed the ui_get_full_url function,
|
||||||
because sometimes added two times the php script name.
|
because sometimes added two times the php script name.
|
||||||
|
@ -190,6 +190,7 @@ ALTER TABLE treport_content_item ADD FOREIGN KEY (`id_report_content`) REFERENCE
|
|||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
ALTER TABLE treport ADD COLUMN `id_template` INTEGER UNSIGNED DEFAULT 0;
|
ALTER TABLE treport ADD COLUMN `id_template` INTEGER UNSIGNED DEFAULT 0;
|
||||||
ALTER TABLE treport ADD COLUMN `id_group_edit` mediumint(8) unsigned NULL DEFAULT 0;
|
ALTER TABLE treport ADD COLUMN `id_group_edit` mediumint(8) unsigned NULL DEFAULT 0;
|
||||||
|
ALTER TABLE treport ADD COLUMN `metaconsole` tinyint(1) DEFAULT 0;
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `tgraph`
|
-- Table `tgraph`
|
||||||
|
@ -194,6 +194,7 @@ ALTER TABLE treport_content_item ADD FOREIGN KEY (id_report_content) REFERENCES
|
|||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
ALTER TABLE treport ADD (id_template NUMBER(10, 0) default 0 NOT NULL);
|
ALTER TABLE treport ADD (id_template NUMBER(10, 0) default 0 NOT NULL);
|
||||||
ALTER TABLE treport ADD (id_group_edit NUMBER(19, 0) default 0 NOT NULL);
|
ALTER TABLE treport ADD (id_group_edit NUMBER(19, 0) default 0 NOT NULL);
|
||||||
|
ALTER TABLE treport ADD (metaconsole NUMBER(5, 0) DEFAULT 0);
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `tgraph`
|
-- Table `tgraph`
|
||||||
|
@ -194,6 +194,7 @@ INSERT INTO "tconfig" ("token", "value") VALUES ('event_fields', 'evento,id_agen
|
|||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
ALTER TABLE "treport" ADD COLUMN "id_template" INTEGER NOT NULL default 0;
|
ALTER TABLE "treport" ADD COLUMN "id_template" INTEGER NOT NULL default 0;
|
||||||
ALTER TABLE "treport" ADD COLUMN "id_group_edit" BIGINT NOT NULL default 0;
|
ALTER TABLE "treport" ADD COLUMN "id_group_edit" BIGINT NOT NULL default 0;
|
||||||
|
ALTER TABLE "treport" ADD COLUMN "metaconsole" SMALLINT DEFAULT 0;
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `tgraph`
|
-- Table `tgraph`
|
||||||
|
@ -103,7 +103,7 @@ config_check();
|
|||||||
</td>
|
</td>
|
||||||
<td width="20%">
|
<td width="20%">
|
||||||
<?php
|
<?php
|
||||||
if ($config["metaconsole"] == 0) {
|
//if ($config["metaconsole"] == 0) {
|
||||||
echo '<a class="white_bold" href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60">';
|
echo '<a class="white_bold" href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60">';
|
||||||
|
|
||||||
$servers["all"] = (int) db_get_value ('COUNT(id_server)','tserver');
|
$servers["all"] = (int) db_get_value ('COUNT(id_server)','tserver');
|
||||||
@ -123,7 +123,7 @@ config_check();
|
|||||||
}
|
}
|
||||||
unset ($servers); // Since this is the header, we don't like to trickle down variables.
|
unset ($servers); // Since this is the header, we don't like to trickle down variables.
|
||||||
echo '</a>';
|
echo '</a>';
|
||||||
}
|
//}
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td width="20%">
|
<td width="20%">
|
||||||
@ -182,7 +182,7 @@ config_check();
|
|||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<?php
|
<?php
|
||||||
if ($config["metaconsole"] == 0) {
|
//if ($config["metaconsole"] == 0) {
|
||||||
?>
|
?>
|
||||||
<form method="get" style="" name="quicksearch" action="">
|
<form method="get" style="" name="quicksearch" action="">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -206,7 +206,7 @@ config_check();
|
|||||||
?>
|
?>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
}
|
//}
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -33,7 +33,7 @@ $show_sort_options[1] = __('Ascending');
|
|||||||
$show_sort_options[2] = __('Descending');
|
$show_sort_options[2] = __('Descending');
|
||||||
|
|
||||||
enterprise_include('/godmode/reporting/reporting_builder.item_editor.php');
|
enterprise_include('/godmode/reporting/reporting_builder.item_editor.php');
|
||||||
require_once ($config['homedir'].'/include/functions_agents.php');
|
require_once ($config['homedir'] . '/include/functions_agents.php');
|
||||||
if (enterprise_include_once ('include/functions_metaconsole.php')) {
|
if (enterprise_include_once ('include/functions_metaconsole.php')) {
|
||||||
$servers = enterprise_hook("metaconsole_get_connection_names");
|
$servers = enterprise_hook("metaconsole_get_connection_names");
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ switch ($action) {
|
|||||||
$server_name = $item ['server_name'];
|
$server_name = $item ['server_name'];
|
||||||
|
|
||||||
// Metaconsole db connection
|
// Metaconsole db connection
|
||||||
if (($config ['metaconsole'] == 1) && ($server_name != '')) {
|
if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -342,14 +342,20 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
if (($config ['metaconsole'] == 1) && ($server_name != '')) {
|
if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$urlForm = 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=' . $actionParameter . '&id_report=' . $idReport;
|
// Build link for sort actions: metaconsole and normal console
|
||||||
|
$variable_link = ui_get_full_url(false);
|
||||||
|
// Metaconsole
|
||||||
|
if ($config['metaconsole'] == 1 and defined('METACONSOLE'))
|
||||||
|
$variable_link .= '/enterprise/meta/';
|
||||||
|
|
||||||
|
$urlForm = $variable_link . 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=item_editor&action=' . $actionParameter . '&id_report=' . $idReport;
|
||||||
|
|
||||||
echo '<form action="' . $urlForm . '" method="post">';
|
echo '<form action="' . $urlForm . '" method="post">';
|
||||||
html_print_input_hidden('id_item', $idItem);
|
html_print_input_hidden('id_item', $idItem);
|
||||||
@ -364,7 +370,11 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
html_print_select(reports_get_report_types(), 'type', $type, 'chooseType();', '', '');
|
html_print_select(reports_get_report_types(), 'type', $type, 'chooseType();', '', '');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo reports_get_report_types($type);
|
$report_type = reports_get_report_types($type);
|
||||||
|
if (!empty($report_type) and isset($report_type[$type]['name']))
|
||||||
|
echo $report_type[$type]['name'];
|
||||||
|
else
|
||||||
|
echo __('Not valid');
|
||||||
echo '<input type="hidden" id="type" name="type" value="' . $type . '" />';
|
echo '<input type="hidden" id="type" name="type" value="' . $type . '" />';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -477,7 +487,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
<td style="vertical-align: top;"><?php echo __('Agent'); ?></td>
|
<td style="vertical-align: top;"><?php echo __('Agent'); ?></td>
|
||||||
<td style="">
|
<td style="">
|
||||||
<?php
|
<?php
|
||||||
if ($config['metaconsole'] == 1) {
|
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
$agent_name = '';
|
$agent_name = '';
|
||||||
|
|
||||||
@ -508,7 +518,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
if($idAgent) {
|
if($idAgent) {
|
||||||
$sql = "SELECT id_agente_modulo, nombre FROM tagente_modulo WHERE id_agente = " . $idAgent . " AND delete_pending = 0";
|
$sql = "SELECT id_agente_modulo, nombre FROM tagente_modulo WHERE id_agente = " . $idAgent . " AND delete_pending = 0";
|
||||||
|
|
||||||
if ($config['metaconsole'] == 1) {
|
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
|
|
||||||
if (metaconsole_load_external_db($connection) == NOERR) {
|
if (metaconsole_load_external_db($connection) == NOERR) {
|
||||||
@ -582,7 +592,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
<td style="vertical-align: top;"><?php echo __('Custom graph'); ?></td>
|
<td style="vertical-align: top;"><?php echo __('Custom graph'); ?></td>
|
||||||
<td style="">
|
<td style="">
|
||||||
<?php
|
<?php
|
||||||
if ($config['metaconsole'] == 1) {
|
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
$graphs = array();
|
$graphs = array();
|
||||||
$graphs = metaconsole_get_custom_graphs();
|
$graphs = metaconsole_get_custom_graphs();
|
||||||
$value_selected = $idCustomGraph . '|' . $server_name;
|
$value_selected = $idCustomGraph . '|' . $server_name;
|
||||||
@ -607,7 +617,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
$style_button_create_custom_graph = '';
|
$style_button_create_custom_graph = '';
|
||||||
$style_button_edit_custom_graph = 'style="display: none;"';
|
$style_button_edit_custom_graph = 'style="display: none;"';
|
||||||
// Select the target server
|
// Select the target server
|
||||||
if ($config['metaconsole'] == 1) {
|
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
$metaconsole_connections = enterprise_hook('metaconsole_get_connection_names');
|
$metaconsole_connections = enterprise_hook('metaconsole_get_connection_names');
|
||||||
if ($metaconsole_connections === false) {
|
if ($metaconsole_connections === false) {
|
||||||
$metaconsole_connections = array();
|
$metaconsole_connections = array();
|
||||||
@ -650,7 +660,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
<tr id="row_servers" style="" class="datos">
|
<tr id="row_servers" style="" class="datos">
|
||||||
<td style="vertical-align: top;"><?php echo __('Server'); ?></td>
|
<td style="vertical-align: top;"><?php echo __('Server'); ?></td>
|
||||||
<td style=""><?php
|
<td style=""><?php
|
||||||
if ($config ['metaconsole'] != 1)
|
if ($config ['metaconsole'] != 1 or !defined('METACONSOLE'))
|
||||||
html_print_select ($servers, 'combo_server', $server_name, '', __('Select server'), 0, false, false, true, '', true);
|
html_print_select ($servers, 'combo_server', $server_name, '', __('Select server'), 0, false, false, true, '', true);
|
||||||
else
|
else
|
||||||
html_print_select ($servers, 'combo_server', $server_name, '', __('Select server'), 0);
|
html_print_select ($servers, 'combo_server', $server_name, '', __('Select server'), 0);
|
||||||
@ -773,7 +783,7 @@ if ($enterpriseEnable) {
|
|||||||
reporting_enterprise_text_box();
|
reporting_enterprise_text_box();
|
||||||
}
|
}
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
if ($config ['metaconsole'] == 1) {
|
if ($config ['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -811,7 +821,7 @@ function print_SLA_list($width, $action, $idItem = null) {
|
|||||||
foreach ($itemsSLA as $item) {
|
foreach ($itemsSLA as $item) {
|
||||||
$server_name = $item ['server_name'];
|
$server_name = $item ['server_name'];
|
||||||
// Metaconsole db connection
|
// Metaconsole db connection
|
||||||
if (($config ['metaconsole'] == 1) && ($server_name != '')) {
|
if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -822,8 +832,12 @@ function print_SLA_list($width, $action, $idItem = null) {
|
|||||||
$nameAgent = agents_get_name ($idAgent);
|
$nameAgent = agents_get_name ($idAgent);
|
||||||
$nameModule = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module']));
|
$nameModule = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module']));
|
||||||
|
|
||||||
|
$server_name_element = '';
|
||||||
|
if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE'))
|
||||||
|
$server_name_element .= ' (' . $server_name . ')';
|
||||||
|
|
||||||
echo '<tr id="sla_' . $item['id'] . '" style="" class="datos">
|
echo '<tr id="sla_' . $item['id'] . '" style="" class="datos">
|
||||||
<td>' . printSmallFont($nameAgent) . '</td>
|
<td>' . printSmallFont($nameAgent) . $server_name_element . '</td>
|
||||||
<td>' . printSmallFont($nameModule) . '</td>
|
<td>' . printSmallFont($nameModule) . '</td>
|
||||||
<td>' . $item['sla_min'] . '</td>
|
<td>' . $item['sla_min'] . '</td>
|
||||||
<td>' . $item['sla_max'] . '</td>
|
<td>' . $item['sla_max'] . '</td>
|
||||||
@ -832,7 +846,7 @@ function print_SLA_list($width, $action, $idItem = null) {
|
|||||||
<a href="javascript: deleteSLARow(' . $item['id'] . ');">' . html_print_image("images/cross.png", true) . '</a>
|
<a href="javascript: deleteSLARow(' . $item['id'] . ');">' . html_print_image("images/cross.png", true) . '</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
if ($config ['metaconsole'] == 1) {
|
if ($config ['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
@ -875,7 +889,7 @@ function print_SLA_list($width, $action, $idItem = null) {
|
|||||||
|
|
||||||
function print_General_list($width, $action, $idItem = null) {
|
function print_General_list($width, $action, $idItem = null) {
|
||||||
global $config;
|
global $config;
|
||||||
include_once('include/functions_html.php');
|
include_once($config['homedir'] . '/include/functions_html.php');
|
||||||
?>
|
?>
|
||||||
<table class="databox" id="general_list" border="0" cellpadding="4" cellspacing="4" width="98%">
|
<table class="databox" id="general_list" border="0" cellpadding="4" cellspacing="4" width="98%">
|
||||||
<thead>
|
<thead>
|
||||||
@ -906,7 +920,7 @@ function print_General_list($width, $action, $idItem = null) {
|
|||||||
foreach ($itemsGeneral as $item) {
|
foreach ($itemsGeneral as $item) {
|
||||||
$server_name = $item ['server_name'];
|
$server_name = $item ['server_name'];
|
||||||
// Metaconsole db connection
|
// Metaconsole db connection
|
||||||
if (($config ['metaconsole'] == 1) && ($server_name != '')) {
|
if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -917,15 +931,19 @@ function print_General_list($width, $action, $idItem = null) {
|
|||||||
$nameAgent = agents_get_name ($idAgent);
|
$nameAgent = agents_get_name ($idAgent);
|
||||||
$nameModule = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module']));
|
$nameModule = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module']));
|
||||||
|
|
||||||
|
$server_name_element = '';
|
||||||
|
if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE'))
|
||||||
|
$server_name_element .= ' (' . $server_name . ')';
|
||||||
|
|
||||||
echo '<tr id="general_' . $item['id'] . '" style="" class="datos">
|
echo '<tr id="general_' . $item['id'] . '" style="" class="datos">
|
||||||
<td>' . printSmallFont($nameAgent) . '</td>
|
<td>' . printSmallFont($nameAgent) . $server_name_element . '</td>
|
||||||
<td>' . printSmallFont($nameModule) . '</td>
|
<td>' . printSmallFont($nameModule) . '</td>
|
||||||
<td>' . printSmallFont($item['operation']) . '</td>
|
<td>' . printSmallFont($item['operation']) . '</td>
|
||||||
<td style="text-align: center;">
|
<td style="text-align: center;">
|
||||||
<a href="javascript: deleteGeneralRow(' . $item['id'] . ');">' . html_print_image("images/cross.png", true) . '</a>
|
<a href="javascript: deleteGeneralRow(' . $item['id'] . ');">' . html_print_image("images/cross.png", true) . '</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
if ($config ['metaconsole'] == 1) {
|
if ($config ['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
@ -968,9 +986,9 @@ ui_require_javascript_file ('pandora_inventory', ENTERPRISE_DIR.'/include/javasc
|
|||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
agent_module_autocomplete('#text-agent', '#hidden-id_agent', '#id_agent_module', '#hidden-server_name');
|
agent_module_autocomplete('#text-agent', '#hidden-id_agent', '#id_agent_module', '#hidden-server_name', undefined, <?php echo '"' . $config['homeurl'] . '"'; ?>);
|
||||||
agent_module_autocomplete('#text-agent_sla', '#hidden-id_agent_sla', '#id_agent_module_sla', '#hidden-server_name');
|
agent_module_autocomplete('#text-agent_sla', '#hidden-id_agent_sla', '#id_agent_module_sla', '#hidden-server_name', undefined, <?php echo '"' . $config['homeurl'] . '"'; ?>);
|
||||||
agent_module_autocomplete('#text-agent_general', '#hidden-id_agent_general', '#id_agent_module_general', '#hidden-server_name_general', '#id_operation_module_general');
|
agent_module_autocomplete('#text-agent_general', '#hidden-id_agent_general', '#id_agent_module_general', '#hidden-server_name_general', '#id_operation_module_general', <?php echo '"' . $config['homeurl'] . '"'; ?>);
|
||||||
|
|
||||||
chooseType();
|
chooseType();
|
||||||
chooseSQLquery();
|
chooseSQLquery();
|
||||||
@ -988,7 +1006,7 @@ function create_custom_graph() {
|
|||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
// Metaconsole activated
|
// Metaconsole activated
|
||||||
if ($config['metaconsole'] == 1) {
|
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
?>
|
?>
|
||||||
var target_server = $("#meta_servers").val();
|
var target_server = $("#meta_servers").val();
|
||||||
// If target server is not selected
|
// If target server is not selected
|
||||||
@ -1007,7 +1025,7 @@ function create_custom_graph() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params1.join ("&"),
|
data: params1.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
async: false,
|
async: false,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1023,7 +1041,7 @@ function create_custom_graph() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params1.join ("&"),
|
data: params1.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
async: false,
|
async: false,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1049,7 +1067,7 @@ function edit_custom_graph() {
|
|||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
// Metaconsole activated
|
// Metaconsole activated
|
||||||
if ($config['metaconsole'] == 1) {
|
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
?>
|
?>
|
||||||
var agent_server_temp;
|
var agent_server_temp;
|
||||||
var id_element_graph;
|
var id_element_graph;
|
||||||
@ -1069,7 +1087,7 @@ function edit_custom_graph() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params1.join ("&"),
|
data: params1.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
async: false,
|
async: false,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1085,7 +1103,7 @@ function edit_custom_graph() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params1.join ("&"),
|
data: params1.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
async: false,
|
async: false,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1134,7 +1152,7 @@ function chooseSQLquery() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params1.join ("&"),
|
data: params1.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
async: false,
|
async: false,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1149,7 +1167,7 @@ function chooseSQLquery() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1170,7 +1188,7 @@ function deleteSLARow(id_row) {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1190,7 +1208,7 @@ function deleteGeneralRow(id_row) {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1221,7 +1239,7 @@ function addSLARow() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
async: false,
|
async: false,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1236,7 +1254,7 @@ function addSLARow() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
async: false,
|
async: false,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1257,7 +1275,7 @@ function addSLARow() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1309,7 +1327,7 @@ function addGeneralRow() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
async: false,
|
async: false,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1324,7 +1342,7 @@ function addGeneralRow() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
async: false,
|
async: false,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1339,7 +1357,7 @@ function addGeneralRow() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
async: false,
|
async: false,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -1357,7 +1375,7 @@ function addGeneralRow() {
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= <?php echo '"' . $config['homeurl'] . '"'; ?> + "/ajax.php",
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
@ -26,7 +26,7 @@ if (! check_acl ($config['id_user'], 0, "IW")) {
|
|||||||
include_once($config['homedir'] . "/include/functions_agents.php");
|
include_once($config['homedir'] . "/include/functions_agents.php");
|
||||||
enterprise_include_once ('include/functions_metaconsole.php');
|
enterprise_include_once ('include/functions_metaconsole.php');
|
||||||
|
|
||||||
if ($config ['metaconsole'] == 1) {
|
if ($config ['metaconsole'] == 1 and defined('METACONSOLE')) {
|
||||||
$agents = array();
|
$agents = array();
|
||||||
$agents = metaconsole_get_report_agents($idReport);
|
$agents = metaconsole_get_report_agents($idReport);
|
||||||
$modules = array();
|
$modules = array();
|
||||||
@ -105,10 +105,17 @@ else {
|
|||||||
$modules[$row['id_agent_module']] = $row['nombre'];
|
$modules[$row['id_agent_module']] = $row['nombre'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filter report items created from metaconsole in normal console list and the opposite
|
||||||
|
if (defined('METACONSOLE') and $config['metaconsole'] == 1) {
|
||||||
|
$where_types = ' AND ((server_name IS NOT NULL AND length(server_name) != 0) OR type IN (\'general\',\'SLA\',\'exception\',\'top_n\'))';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$where_types = ' AND ((server_name IS NULL OR length(server_name) = 0) OR type IN (\'general\',\'SLA\',\'exception\',\'top_n\'))';
|
||||||
|
|
||||||
$rows = db_get_all_rows_sql('
|
$rows = db_get_all_rows_sql('
|
||||||
SELECT DISTINCT(type)
|
SELECT DISTINCT(type)
|
||||||
FROM treport_content
|
FROM treport_content
|
||||||
WHERE id_report = ' . $idReport);
|
WHERE id_report = ' . $idReport . $where_types);
|
||||||
if ($rows === false) {
|
if ($rows === false) {
|
||||||
$rows = array();
|
$rows = array();
|
||||||
}
|
}
|
||||||
@ -143,7 +150,7 @@ $table->data[1][0] = __('Type');
|
|||||||
$table->data[1][1] = html_print_select($types, 'type_filter', $typeFilter, '', __('All'), 0, true);
|
$table->data[1][1] = html_print_select($types, 'type_filter', $typeFilter, '', __('All'), 0, true);
|
||||||
|
|
||||||
echo '<div id="form_filter" style="display: none;">';
|
echo '<div id="form_filter" style="display: none;">';
|
||||||
echo '<form method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report=' . $idReport . '">';
|
echo '<form method="post" action ="index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report=' . $idReport . '">';
|
||||||
|
|
||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
|
|
||||||
@ -165,6 +172,13 @@ if ($moduleFilter != 0) {
|
|||||||
$where .= ' AND id_agent_module = ' . $moduleFilter;
|
$where .= ' AND id_agent_module = ' . $moduleFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filter report items created from metaconsole in normal console list and the opposite
|
||||||
|
if (defined('METACONSOLE') and $config['metaconsole'] == 1) {
|
||||||
|
$where .= ' AND ((server_name IS NOT NULL AND length(server_name) != 0) OR type IN (\'general\',\'SLA\',\'exception\',\'top_n\'))';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$where .= ' AND ((server_name IS NULL OR length(server_name) = 0) OR type IN (\'general\',\'SLA\',\'exception\',\'top_n\'))';
|
||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
$items = db_get_all_rows_sql('SELECT *
|
$items = db_get_all_rows_sql('SELECT *
|
||||||
@ -198,6 +212,12 @@ $table = null;
|
|||||||
|
|
||||||
$table->style[0] = 'text-align: right;';
|
$table->style[0] = 'text-align: right;';
|
||||||
|
|
||||||
|
// Build link for sort actions: metaconsole and normal console
|
||||||
|
$variable_link = ui_get_full_url(false);
|
||||||
|
// Metaconsole
|
||||||
|
if ($config['metaconsole'] == 1 and defined('METACONSOLE'))
|
||||||
|
$variable_link .= '/enterprise/meta/';
|
||||||
|
|
||||||
if ($items) {
|
if ($items) {
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
|
|
||||||
@ -211,18 +231,19 @@ if ($items) {
|
|||||||
$table->head[0] = '<span title="' . __('Position') . '">' . __('P.') . '</span>';
|
$table->head[0] = '<span title="' . __('Position') . '">' . __('P.') . '</span>';
|
||||||
$table->head[1] = __('Type');
|
$table->head[1] = __('Type');
|
||||||
if (!$filterEnable) {
|
if (!$filterEnable) {
|
||||||
$table->head[1] .= ' <a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=type&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_up.png", true, array("title" => __('Ascendent'))) . '</a>' .
|
$table->head[1] .= ' <a onclick="return message_check_sort_items();" href="' . $variable_link . 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=type&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_up.png", true, array("title" => __('Ascendent'))) . '</a>' .
|
||||||
'<a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=type&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_down.png", true, array("title" => __('Descent'))) . '</a>';
|
'<a onclick="return message_check_sort_items();" href="' . $variable_link . 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=type&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_down.png", true, array("title" => __('Descent'))) . '</a>';
|
||||||
}
|
}
|
||||||
$table->head[2] = __('Agent');
|
$table->head[2] = __('Agent');
|
||||||
if (!$filterEnable) {
|
if (!$filterEnable) {
|
||||||
$table->head[2] .= ' <a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=agent&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_up.png", true, array("title" => __('Ascendent'))) . '</a>' .
|
$table->head[2] .= ' <a onclick="return message_check_sort_items();" href="' . $variable_link . 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=agent&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_up.png", true, array("title" => __('Ascendent'))) . '</a>' .
|
||||||
'<a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=agent&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_down.png", true, array("title" => __('Descent'))) . '</a>';
|
'<a onclick="return message_check_sort_items();" href="' . $variable_link . 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=agent&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_down.png", true, array("title" => __('Descent'))) . '</a>';
|
||||||
}
|
}
|
||||||
$table->head[3] = __('Module');
|
$table->head[3] = __('Module');
|
||||||
|
|
||||||
if (!$filterEnable) {
|
if (!$filterEnable) {
|
||||||
$table->head[3] .= ' <a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=module&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_up.png", true, array("title" => __('Ascendent'))) . '</a>' .
|
$table->head[3] .= ' <a onclick="return message_check_sort_items();" href="' . $variable_link . 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=module&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_up.png", true, array("title" => __('Ascendent'))) . '</a>' .
|
||||||
'<a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=module&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_down.png", true, array("title" => __('Descent'))) . '</a>';
|
'<a onclick="return message_check_sort_items();" href="' . $variable_link . 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=module&id_report=' . $idReport . $urlFilter . '">' . html_print_image("images/sort_down.png", true, array("title" => __('Descent'))) . '</a>';
|
||||||
}
|
}
|
||||||
$table->head[4] = __('Period');
|
$table->head[4] = __('Period');
|
||||||
$table->head[5] = __('Description');
|
$table->head[5] = __('Description');
|
||||||
@ -270,7 +291,7 @@ foreach ($items as $item) {
|
|||||||
|
|
||||||
$server_name = $item ['server_name'];
|
$server_name = $item ['server_name'];
|
||||||
|
|
||||||
if (($config ['metaconsole'] == 1) && ($server_name != '')) {
|
if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) {
|
||||||
|
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
@ -320,9 +341,9 @@ foreach ($items as $item) {
|
|||||||
|
|
||||||
$row[6] = '';
|
$row[6] = '';
|
||||||
|
|
||||||
$row[6] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=edit&id_report=' . $idReport . '&id_item=' . $item['id_rc'] . '">' . html_print_image("images/wrench_orange.png", true, array("title" => __('Edit'))) . '</a>';
|
$row[6] .= '<a href="' . $variable_link . 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=item_editor&action=edit&id_report=' . $idReport . '&id_item=' . $item['id_rc'] . '">' . html_print_image("images/wrench_orange.png", true, array("title" => __('Edit'))) . '</a>';
|
||||||
$row[6] .= ' ';
|
$row[6] .= ' ';
|
||||||
$row[6] .= '<a onClick="if (!confirm (\'Are you sure?\')) return false;" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete&id_report=' . $idReport . '&id_item=' . $item['id_rc'] . $urlFilter . '">' . html_print_image("images/cross.png", true, array("title" => __('Delete'))) .'</a>';
|
$row[6] .= '<a onClick="if (!confirm (\'Are you sure?\')) return false;" href="' . $variable_link . 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=list_items&action=delete&id_report=' . $idReport . '&id_item=' . $item['id_rc'] . $urlFilter . '">' . html_print_image("images/cross.png", true, array("title" => __('Delete'))) .'</a>';
|
||||||
$row[6] .= html_print_checkbox_extended ('delete_multiple[]', $item['id_rc'], false, false, '', 'class="check_delete"', true);
|
$row[6] .= html_print_checkbox_extended ('delete_multiple[]', $item['id_rc'], false, false, '', 'class="check_delete"', true);
|
||||||
|
|
||||||
$row[7] = '';
|
$row[7] = '';
|
||||||
@ -333,15 +354,15 @@ foreach ($items as $item) {
|
|||||||
$table->data[] = $row;
|
$table->data[] = $row;
|
||||||
$count++;
|
$count++;
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
if (($config ['metaconsole'] == 1) && ($server_name != '') ) {
|
if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui_pagination ($countItems, 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report=' . $idReport . $urlFilter);
|
ui_pagination ($countItems, $variable_link . 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report=' . $idReport . $urlFilter);
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
ui_pagination ($countItems, 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report=' . $idReport . $urlFilter);
|
ui_pagination ($countItems, $variable_link . 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report=' . $idReport . $urlFilter);
|
||||||
|
|
||||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=" . $idReport . "'
|
echo "<form action='" . $variable_link . "index.php?sec=reporting&sec2=" . $config['homedir'] . "/godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=" . $idReport . "'
|
||||||
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
|
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
|
||||||
echo "<div style='padding-bottom: 20px; text-align: right; width:100%'>";
|
echo "<div style='padding-bottom: 20px; text-align: right; width:100%'>";
|
||||||
html_print_input_hidden('ids_items_to_delete', '');
|
html_print_input_hidden('ids_items_to_delete', '');
|
||||||
@ -350,8 +371,13 @@ echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_bui
|
|||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|
||||||
$table = null;
|
$table = null;
|
||||||
$table->width = '60%';
|
$table->width = '100%';
|
||||||
$table->colspan[0][0] = 3;
|
$table->colspan[0][0] = 3;
|
||||||
|
$table->size = array();
|
||||||
|
$table->size[0] = '25%';
|
||||||
|
$table->size[1] = '25%';
|
||||||
|
$table->size[2] = '25%';
|
||||||
|
$table->size[3] = '25%';
|
||||||
$table->data[0][0] = "<b>". __("Sort items") . "</b>";
|
$table->data[0][0] = "<b>". __("Sort items") . "</b>";
|
||||||
$table->data[1][0] = __('Sort selected items from position: ');
|
$table->data[1][0] = __('Sort selected items from position: ');
|
||||||
$table->data[1][1] = html_print_select_style(
|
$table->data[1][1] = html_print_select_style(
|
||||||
@ -362,14 +388,19 @@ $table->data[1][2] = html_print_input_text_extended('position_to_sort', 1,
|
|||||||
$table->data[1][2] .= html_print_input_hidden('ids_items_to_sort', '', true);
|
$table->data[1][2] .= html_print_input_hidden('ids_items_to_sort', '', true);
|
||||||
$table->data[1][3] = html_print_submit_button(__('Sort'), 'sort_submit', false, 'class="sub upd"', true);
|
$table->data[1][3] = html_print_submit_button(__('Sort'), 'sort_submit', false, 'class="sub upd"', true);
|
||||||
|
|
||||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=" . $idReport . "'
|
echo "<form action='" . $variable_link . "index.php?sec=reporting&sec2=" . $config['homedir'] . "/godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=" . $idReport . "'
|
||||||
method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
|
method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|
||||||
$table = null;
|
$table = null;
|
||||||
$table->width = '60%';
|
$table->width = '100%';
|
||||||
$table->colspan[0][0] = 3;
|
$table->colspan[0][0] = 3;
|
||||||
|
$table->size = array();
|
||||||
|
$table->size[0] = '25%';
|
||||||
|
$table->size[1] = '25%';
|
||||||
|
$table->size[2] = '25%';
|
||||||
|
$table->size[3] = '25%';
|
||||||
$table->data[0][0] = "<b>". __("Delete items") . "</b>";
|
$table->data[0][0] = "<b>". __("Delete items") . "</b>";
|
||||||
$table->data[1][0] = __('Delete selected items from position: ');
|
$table->data[1][0] = __('Delete selected items from position: ');
|
||||||
$table->data[1][1] = html_print_select_style(
|
$table->data[1][1] = html_print_select_style(
|
||||||
@ -380,7 +411,7 @@ $table->data[1][2] = html_print_input_text_extended('position_to_delete', 1,
|
|||||||
$table->data[1][2] .= html_print_input_hidden('ids_items_to_delete', '', true);
|
$table->data[1][2] .= html_print_input_hidden('ids_items_to_delete', '', true);
|
||||||
$table->data[1][3] = html_print_submit_button(__('Delete'), 'delete_submit', false, 'class="sub upd"', true);
|
$table->data[1][3] = html_print_submit_button(__('Delete'), 'delete_submit', false, 'class="sub upd"', true);
|
||||||
|
|
||||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=" . $idReport . "'
|
echo "<form action='" . $variable_link . "index.php?sec=reporting&sec2=" . $config['homedir'] . "/godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=" . $idReport . "'
|
||||||
method='post'>";
|
method='post'>";
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
// IMPORTANT NOTE: All reporting pages are used also for metaconsole reporting functionality
|
||||||
|
// So, it's very important to specify full url and paths to resources because metaconsole has a different
|
||||||
|
// entry point: enterprise/meta/index.php than normal console !!!
|
||||||
|
|
||||||
// Login check
|
// Login check
|
||||||
check_login ();
|
check_login ();
|
||||||
|
|
||||||
@ -23,10 +27,11 @@ if (! check_acl ($config['id_user'], 0, "IW")) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once ("include/functions_reports.php");
|
require_once ($config['homedir'] . "/include/functions_reports.php");
|
||||||
|
|
||||||
// Load enterprise extensions
|
// Load enterprise extensions
|
||||||
enterprise_include ('operation/reporting/custom_reporting.php');
|
enterprise_include ('operation/reporting/custom_reporting.php');
|
||||||
|
enterprise_include_once ('include/functions_metaconsole.php');
|
||||||
|
|
||||||
$enterpriseEnable = false;
|
$enterpriseEnable = false;
|
||||||
if (enterprise_include_once('include/functions_reporting.php') !== ENTERPRISE_NOT_HOOK) {
|
if (enterprise_include_once('include/functions_reporting.php') !== ENTERPRISE_NOT_HOOK) {
|
||||||
@ -188,7 +193,7 @@ switch ($action) {
|
|||||||
$sql = "SELECT id_rc FROM treport_content WHERE id_report=$idReport ORDER BY '`order`'";
|
$sql = "SELECT id_rc FROM treport_content WHERE id_report=$idReport ORDER BY '`order`'";
|
||||||
$items = db_get_all_rows_sql($sql);
|
$items = db_get_all_rows_sql($sql);
|
||||||
switch ($pos_delete) {
|
switch ($pos_delete) {
|
||||||
case 'below':
|
case 'above':
|
||||||
if ($position_to_delete == 1) {
|
if ($position_to_delete == 1) {
|
||||||
$resultOperationDB = false;
|
$resultOperationDB = false;
|
||||||
} else {
|
} else {
|
||||||
@ -201,7 +206,7 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'above':
|
case 'below':
|
||||||
if ($position_to_delete == $countItems) {
|
if ($position_to_delete == $countItems) {
|
||||||
$resultOperationDB = false;
|
$resultOperationDB = false;
|
||||||
} else {
|
} else {
|
||||||
@ -221,11 +226,11 @@ switch ($action) {
|
|||||||
case 'list':
|
case 'list':
|
||||||
$buttons = array(
|
$buttons = array(
|
||||||
'list_reports' => array('active' => false,
|
'list_reports' => array('active' => false,
|
||||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder">' .
|
'text' => '<a href="index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder">' .
|
||||||
html_print_image("images/god6.png", true, array ("title" => __('Main'))) .'</a>')
|
html_print_image("images/god6.png", true, array ("title" => __('Main'))) .'</a>')
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($enterpriseEnable){
|
if ($enterpriseEnable and !defined('METACONSOLE')) {
|
||||||
$buttons = reporting_enterprise_add_main_Tabs($buttons);
|
$buttons = reporting_enterprise_add_main_Tabs($buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,8 +245,19 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Report LIST
|
// Page header for metaconsole
|
||||||
ui_print_page_header (__('Reporting').' » '.__('Custom reporting'), "images/reporting.png", false, "",false, $buttons);
|
if ($enterpriseEnable and defined('METACONSOLE')) {
|
||||||
|
// Bread crumbs
|
||||||
|
ui_meta_add_breadcrumb(array('link' => 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder', 'text' => __('Reporting')));
|
||||||
|
|
||||||
|
ui_meta_print_page_header($nav_bar);
|
||||||
|
|
||||||
|
// Print header
|
||||||
|
ui_meta_print_header(__('Reporting'), "", $buttons);
|
||||||
|
}
|
||||||
|
// Page header for normal console
|
||||||
|
else
|
||||||
|
ui_print_page_header (__('Reporting').' » '.__('Custom reporting'), "images/reporting.png", false, "",false, $buttons);
|
||||||
|
|
||||||
if ($action == 'delete_report') {
|
if ($action == 'delete_report') {
|
||||||
$result = reports_delete_report ($idReport);
|
$result = reports_delete_report ($idReport);
|
||||||
@ -274,7 +290,7 @@ switch ($action) {
|
|||||||
|
|
||||||
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true);
|
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true);
|
||||||
|
|
||||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&id_group='.$id_group'
|
echo "<form action='index.php?sec=reporting&sec2=" . $config['homedir'] . "/godmode/reporting/reporting_builder&id_group='.$id_group'
|
||||||
method='post'>";
|
method='post'>";
|
||||||
html_print_table($table_aux);
|
html_print_table($table_aux);
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
@ -310,6 +326,12 @@ switch ($action) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filter normal and metaconsole reports
|
||||||
|
if ($config['metaconsole'] == 1 and defined('METACONSOLE'))
|
||||||
|
$filter['metaconsole'] = 1;
|
||||||
|
else
|
||||||
|
$filter['metaconsole'] = 0;
|
||||||
|
|
||||||
$reports = reports_get_reports ($filter,
|
$reports = reports_get_reports ($filter,
|
||||||
array ('name', 'id_report', 'description', 'private',
|
array ('name', 'id_report', 'description', 'private',
|
||||||
'id_user', 'id_group'), $return_all_group, 'IR', $group);
|
'id_user', 'id_group'), $return_all_group, 'IR', $group);
|
||||||
@ -362,7 +384,7 @@ switch ($action) {
|
|||||||
$data = array ();
|
$data = array ();
|
||||||
|
|
||||||
if (check_acl ($config["id_user"], $report["id_group"], "AW")) {
|
if (check_acl ($config["id_user"], $report["id_group"], "AW")) {
|
||||||
$data[0] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit&id_report='.
|
$data[0] = '<a href="index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&action=edit&id_report='.
|
||||||
$report['id_report'].'">'.$report['name'].'</a>';
|
$report['id_report'].'">'.$report['name'].'</a>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -372,9 +394,9 @@ switch ($action) {
|
|||||||
|
|
||||||
$data[1] = $report['description'];
|
$data[1] = $report['description'];
|
||||||
|
|
||||||
$data[2] = '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$report['id_report'].'">' .
|
$data[2] = '<a href="index.php?sec=reporting&sec2=' . $config['homedir'] . '/operation/reporting/reporting_viewer&id='.$report['id_report'].'">' .
|
||||||
html_print_image("images/reporting.png", true) . '</a>';
|
html_print_image("images/reporting.png", true) . '</a>';
|
||||||
$data[3] = '<a href="ajax.php?page=operation/reporting/reporting_xml&id='.$report['id_report'].'">' . html_print_image("images/database_lightning.png", true) . '</a>'; //I chose ajax.php because it's supposed to give XML anyway
|
$data[3] = '<a href="'. $config['homeurl'] . '/ajax.php?page=' . $config['homedir'] . '/operation/reporting/reporting_xml&id='.$report['id_report'].'">' . html_print_image("images/database_lightning.png", true) . '</a>'; //I chose ajax.php because it's supposed to give XML anyway
|
||||||
|
|
||||||
|
|
||||||
//Calculate dinamically the number of the column
|
//Calculate dinamically the number of the column
|
||||||
@ -413,7 +435,7 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
$data[$next] = '<form method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit" style="display:inline">';
|
$data[$next] = '<form method="post" action="index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&action=edit" style="display:inline">';
|
||||||
$data[$next] .= html_print_input_hidden ('id_report', $report['id_report'], true);
|
$data[$next] .= html_print_input_hidden ('id_report', $report['id_report'], true);
|
||||||
$data[$next] .= html_print_input_image ('edit', 'images/config.png', 1, '', true, array ('title' => __('Edit')));
|
$data[$next] .= html_print_input_image ('edit', 'images/config.png', 1, '', true, array ('title' => __('Edit')));
|
||||||
$data[$next] .= '</form>';
|
$data[$next] .= '</form>';
|
||||||
@ -433,12 +455,12 @@ switch ($action) {
|
|||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo "<div class='nf'>".__('There are no defined reportings')."</div>";
|
ui_print_error_message(__('There are no defined reportings'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (check_acl ($config['id_user'], 0, "IW")) {
|
if (check_acl ($config['id_user'], 0, "IW")) {
|
||||||
echo '<form method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=new">';
|
echo '<form method="post" action="index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=main&action=new">';
|
||||||
echo '<div class="action-buttons" style="width: 98%;">';
|
echo '<div class="action-buttons" style="width: 98%;">';
|
||||||
html_print_submit_button (__('Create report'), 'create', false, 'class="sub next"');
|
html_print_submit_button (__('Create report'), 'create', false, 'class="sub next"');
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
@ -525,13 +547,21 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
else if ($action == 'save') {
|
else if ($action == 'save') {
|
||||||
if ($reportName != "" && $idGroupReport != "") {
|
if ($reportName != "" && $idGroupReport != "") {
|
||||||
|
|
||||||
|
// This flag allow to differentiate between normal console and metaconsole reports
|
||||||
|
if (defined('METACONSOLE') and $config['metaconsole'] == 1)
|
||||||
|
$metaconsole_report = 1;
|
||||||
|
else
|
||||||
|
$metaconsole_report = 0;
|
||||||
|
|
||||||
$idOrResult = db_process_sql_insert('treport',
|
$idOrResult = db_process_sql_insert('treport',
|
||||||
array('name' => $reportName,
|
array('name' => $reportName,
|
||||||
'id_group' => $idGroupReport,
|
'id_group' => $idGroupReport,
|
||||||
'description' => $description,
|
'description' => $description,
|
||||||
'private' => $private,
|
'private' => $private,
|
||||||
'id_group_edit' => $id_group_edit,
|
'id_group_edit' => $id_group_edit,
|
||||||
'id_user' => $config['id_user']));
|
'id_user' => $config['id_user'],
|
||||||
|
'metaconsole' => $metaconsole_report));
|
||||||
if ($idOrResult !== false)
|
if ($idOrResult !== false)
|
||||||
db_pandora_audit( "Report management", "Create report #$idOrResult");
|
db_pandora_audit( "Report management", "Create report #$idOrResult");
|
||||||
else
|
else
|
||||||
@ -833,7 +863,7 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['metaconsole'] == 1) {
|
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
if ($values['type'] == 'custom_graph') {
|
if ($values['type'] == 'custom_graph') {
|
||||||
$id_gs = substr ($values['id_gs'], 0, strpos ($values['id_gs'], '|'));
|
$id_gs = substr ($values['id_gs'], 0, strpos ($values['id_gs'], '|'));
|
||||||
if ($id_gs !== false && $id_gs !== '') {
|
if ($id_gs !== false && $id_gs !== '') {
|
||||||
@ -914,7 +944,8 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ($enterpriseEnable) {
|
|
||||||
|
if ($enterpriseEnable and $activeTab != 'advanced') {
|
||||||
$resultOperationDB = reporting_enterprise_update_action();
|
$resultOperationDB = reporting_enterprise_update_action();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -964,49 +995,156 @@ switch ($action) {
|
|||||||
case 'module':
|
case 'module':
|
||||||
case 'agent':
|
case 'agent':
|
||||||
case 'type':
|
case 'type':
|
||||||
switch ($field) {
|
|
||||||
case 'module':
|
// Sort functionality for normal console
|
||||||
$sql = "
|
if (!defined('METACONSOLE')) {
|
||||||
SELECT t1.id_rc, t2.nombre
|
switch ($field) {
|
||||||
FROM treport_content AS t1
|
case 'module':
|
||||||
LEFT JOIN tagente_modulo AS t2
|
$sql = "
|
||||||
ON t1.id_agent_module = t2.id_agente_modulo
|
SELECT t1.id_rc, t2.nombre
|
||||||
WHERE %s
|
|
||||||
ORDER BY nombre %s
|
|
||||||
";
|
|
||||||
break;
|
|
||||||
case 'agent':
|
|
||||||
$sql = "
|
|
||||||
SELECT t4.id_rc, t5.nombre
|
|
||||||
FROM
|
|
||||||
(
|
|
||||||
SELECT t1.*, id_agente
|
|
||||||
FROM treport_content AS t1
|
FROM treport_content AS t1
|
||||||
LEFT JOIN tagente_modulo AS t2
|
LEFT JOIN tagente_modulo AS t2
|
||||||
ON t1.id_agent_module = id_agente_modulo
|
ON t1.id_agent_module = t2.id_agente_modulo
|
||||||
) AS t4
|
WHERE %s
|
||||||
LEFT JOIN tagente AS t5
|
ORDER BY nombre %s
|
||||||
ON (t4.id_agent = t5.id_agente OR t4.id_agente = t5.id_agente)
|
";
|
||||||
WHERE %s
|
break;
|
||||||
ORDER BY t5.nombre %s
|
case 'agent':
|
||||||
";
|
$sql = "
|
||||||
break;
|
SELECT t4.id_rc, t5.nombre
|
||||||
case 'type':
|
FROM
|
||||||
$sql = "SELECT id_rc FROM treport_content WHERE %s ORDER BY type %s";
|
(
|
||||||
break;
|
SELECT t1.*, id_agente
|
||||||
}
|
FROM treport_content AS t1
|
||||||
$sql = sprintf($sql, 'id_report = ' . $idReport, '%s');
|
LEFT JOIN tagente_modulo AS t2
|
||||||
switch ($dir) {
|
ON t1.id_agent_module = id_agente_modulo
|
||||||
case 'up':
|
) AS t4
|
||||||
$sql = sprintf($sql, 'ASC');
|
LEFT JOIN tagente AS t5
|
||||||
break;
|
ON (t4.id_agent = t5.id_agente OR t4.id_agente = t5.id_agente)
|
||||||
case 'down':
|
WHERE %s
|
||||||
$sql = sprintf($sql, 'DESC');
|
ORDER BY t5.nombre %s
|
||||||
break;
|
";
|
||||||
}
|
break;
|
||||||
|
case 'type':
|
||||||
$ids = db_get_all_rows_sql($sql);
|
$sql = "SELECT id_rc FROM treport_content WHERE %s ORDER BY type %s";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$sql = sprintf($sql, 'id_report = ' . $idReport, '%s');
|
||||||
|
switch ($dir) {
|
||||||
|
case 'up':
|
||||||
|
$sql = sprintf($sql, 'ASC');
|
||||||
|
break;
|
||||||
|
case 'down':
|
||||||
|
$sql = sprintf($sql, 'DESC');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
echo $sql;
|
||||||
|
$ids = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
|
}
|
||||||
|
// Sort functionality for metaconsole
|
||||||
|
else if ($config['metaconsole'] == 1) {
|
||||||
|
|
||||||
|
switch ($field) {
|
||||||
|
case 'agent':
|
||||||
|
case 'module':
|
||||||
|
|
||||||
|
$sql = "SELECT id_rc, id_agent, id_agent_module, server_name FROM treport_content WHERE %s ORDER BY server_name";
|
||||||
|
$sql = sprintf($sql, 'id_report = ' . $idReport, '%s');
|
||||||
|
|
||||||
|
$report_items = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
|
$ids = array();
|
||||||
|
$temp_sort = array();
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
if (!empty($report_items)) {
|
||||||
|
|
||||||
|
foreach ($report_items as $report_item) {
|
||||||
|
|
||||||
|
$connection = metaconsole_get_connection($report_item['server_name']);
|
||||||
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($field) {
|
||||||
|
case 'agent':
|
||||||
|
$agents_name = agents_get_agents(array('id_agente' => $report_item['id_agent']), 'nombre');
|
||||||
|
|
||||||
|
// Item without agent
|
||||||
|
if (!$agents_name)
|
||||||
|
$element_name = '';
|
||||||
|
else {
|
||||||
|
$agent_name = array_shift($agents_name);
|
||||||
|
$element_name = $agent_name['nombre'];
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'module':
|
||||||
|
$module_name = modules_get_agentmodule_name($report_item['id_agent_module']);
|
||||||
|
|
||||||
|
// Item without module
|
||||||
|
if (!$module_name)
|
||||||
|
$element_name = '';
|
||||||
|
else {
|
||||||
|
$element_name = $module_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
metaconsole_restore_db_force();
|
||||||
|
|
||||||
|
$temp_sort[$report_item['id_rc']] = $element_name;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Performes sorting
|
||||||
|
switch ($dir) {
|
||||||
|
case 'up':
|
||||||
|
asort($temp_sort);
|
||||||
|
break;
|
||||||
|
case 'down':
|
||||||
|
arsort($temp_sort);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($temp_sort as $temp_element_key => $temp_element_val) {
|
||||||
|
$ids[$i]['id_rc'] = $temp_element_key;
|
||||||
|
$ids[$i]['element_name'] = $temp_element_val;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Free resources
|
||||||
|
unset($temp_sort);
|
||||||
|
unset($report_items);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
// Type case only depends of local database
|
||||||
|
case 'type':
|
||||||
|
$sql = "SELECT id_rc FROM treport_content WHERE %s ORDER BY type %s";
|
||||||
|
|
||||||
|
$sql = sprintf($sql, 'id_report = ' . $idReport, '%s');
|
||||||
|
switch ($dir) {
|
||||||
|
case 'up':
|
||||||
|
$sql = sprintf($sql, 'ASC');
|
||||||
|
break;
|
||||||
|
case 'down':
|
||||||
|
$sql = sprintf($sql, 'DESC');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ids = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$count = 1;
|
$count = 1;
|
||||||
$resultOperationDB = true;
|
$resultOperationDB = true;
|
||||||
foreach($ids as $id) {
|
foreach($ids as $id) {
|
||||||
@ -1019,6 +1157,7 @@ switch ($action) {
|
|||||||
|
|
||||||
$count = $count + 1;
|
$count = $count + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
@ -1122,13 +1261,13 @@ if ($enterpriseEnable) {
|
|||||||
|
|
||||||
$buttons = array(
|
$buttons = array(
|
||||||
'main' => array('active' => false,
|
'main' => array('active' => false,
|
||||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=edit&id_report=' . $idReport . '">' .
|
'text' => '<a href="index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=main&action=edit&id_report=' . $idReport . '">' .
|
||||||
html_print_image("images/reporting_edit.png", true, array ("title" => __('Main'))) .'</a>'),
|
html_print_image("images/reporting_edit.png", true, array ("title" => __('Main'))) .'</a>'),
|
||||||
'list_items' => array('active' => false,
|
'list_items' => array('active' => false,
|
||||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report=' . $idReport . '">' .
|
'text' => '<a href="index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report=' . $idReport . '">' .
|
||||||
html_print_image("images/god6.png", true, array ("title" => __('List items'))) .'</a>'),
|
html_print_image("images/god6.png", true, array ("title" => __('List items'))) .'</a>'),
|
||||||
'item_editor' => array('active' => false,
|
'item_editor' => array('active' => false,
|
||||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=new&id_report=' . $idReport . '">' .
|
'text' => '<a href="index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=item_editor&action=new&id_report=' . $idReport . '">' .
|
||||||
html_print_image("images/config.png", true, array ("title" => __('Item editor'))) .'</a>')
|
html_print_image("images/config.png", true, array ("title" => __('Item editor'))) .'</a>')
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1137,7 +1276,7 @@ if ($enterpriseEnable) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$buttons['view'] = array('active' => false,
|
$buttons['view'] = array('active' => false,
|
||||||
'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=' . $idReport . '">' .
|
'text' => '<a href="index.php?sec=reporting&sec2=' . $config['homedir'] . '/operation/reporting/reporting_viewer&id=' . $idReport . '">' .
|
||||||
html_print_image("images/reporting.png", true, array ("title" => __('View report'))) .'</a>');
|
html_print_image("images/reporting.png", true, array ("title" => __('View report'))) .'</a>');
|
||||||
|
|
||||||
$buttons[$activeTab]['active'] = true;
|
$buttons[$activeTab]['active'] = true;
|
||||||
@ -1153,7 +1292,18 @@ else {
|
|||||||
$textReportName = '';
|
$textReportName = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_print_page_header(__('Reporting') . $textReportName, "images/reporting_edit.png", false, "reporting_" . $activeTab . "_tab", true, $buttons);
|
// Page header for metaconsole
|
||||||
|
if ($enterpriseEnable and defined('METACONSOLE')) {
|
||||||
|
// Bread crumbs
|
||||||
|
ui_meta_add_breadcrumb(array('link' => 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder', 'text' => __('Reporting')));
|
||||||
|
|
||||||
|
ui_meta_print_page_header($nav_bar);
|
||||||
|
|
||||||
|
// Print header
|
||||||
|
ui_meta_print_header(__('Reporting'). $textReportName, "", $buttons);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ui_print_page_header(__('Reporting') . $textReportName, "images/reporting_edit.png", false, "reporting_" . $activeTab . "_tab", true, $buttons);
|
||||||
|
|
||||||
if ($resultOperationDB !== null) {
|
if ($resultOperationDB !== null) {
|
||||||
ui_print_result_message ($resultOperationDB, __('Successfull action'), __('Unsuccessfull action'));
|
ui_print_result_message ($resultOperationDB, __('Successfull action'), __('Unsuccessfull action'));
|
||||||
@ -1161,13 +1311,13 @@ if ($resultOperationDB !== null) {
|
|||||||
|
|
||||||
switch ($activeTab) {
|
switch ($activeTab) {
|
||||||
case 'main':
|
case 'main':
|
||||||
require_once('godmode/reporting/reporting_builder.main.php');
|
require_once($config['homedir'] . '/godmode/reporting/reporting_builder.main.php');
|
||||||
break;
|
break;
|
||||||
case 'list_items':
|
case 'list_items':
|
||||||
require_once('godmode/reporting/reporting_builder.list_items.php');
|
require_once($config['homedir'] . '/godmode/reporting/reporting_builder.list_items.php');
|
||||||
break;
|
break;
|
||||||
case 'item_editor':
|
case 'item_editor':
|
||||||
require_once('godmode/reporting/reporting_builder.item_editor.php');
|
require_once($config['homedir'] . '/godmode/reporting/reporting_builder.item_editor.php');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
reporting_enterprise_select_tab($activeTab);
|
reporting_enterprise_select_tab($activeTab);
|
||||||
|
@ -135,7 +135,7 @@ elseif ($search_agents && ($config['metaconsole'] == 1)) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($search_agents_2 && ($config['metaconsole'] == 0)) {
|
if ($search_agents_2 && (!defined('METACONSOLE'))) {
|
||||||
|
|
||||||
require_once ('include/functions_agents.php');
|
require_once ('include/functions_agents.php');
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ if ($search_agents_2 && ($config['metaconsole'] == 0)) {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
elseif ($search_agents_2 && ($config['metaconsole'] == 1)) {
|
elseif ($search_agents_2 && ($config['metaconsole'] == 1) && defined('METACONSOLE')) {
|
||||||
$servers = db_get_all_rows_sql ("SELECT * FROM tmetaconsole_setup");
|
$servers = db_get_all_rows_sql ("SELECT * FROM tmetaconsole_setup");
|
||||||
if (!isset($servers)) {
|
if (!isset($servers)) {
|
||||||
return;
|
return;
|
||||||
|
@ -147,7 +147,25 @@ if ($get_metaconsole_hash_data) {
|
|||||||
|
|
||||||
$server = enterprise_hook('metaconsole_get_connection', array($server_name));
|
$server = enterprise_hook('metaconsole_get_connection', array($server_name));
|
||||||
|
|
||||||
$pwd = $server["auth_token"]; // Create HASH login info
|
// Bad data
|
||||||
|
if (empty($server)){
|
||||||
|
echo '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deserialization of auth_token
|
||||||
|
$auth_serialized = json_decode($server['auth_token'] ,true);
|
||||||
|
|
||||||
|
$auth_token = '';
|
||||||
|
|
||||||
|
if (is_array($auth_serialized)) {
|
||||||
|
$auth_token = $auth_serialized["auth_token"];
|
||||||
|
$api_password = $auth_serialized["api_password"];
|
||||||
|
$console_user = $auth_serialized["console_user"];
|
||||||
|
$console_password = $auth_serialized["console_password"];
|
||||||
|
}
|
||||||
|
|
||||||
|
$pwd = $auth_token; // Create HASH login info
|
||||||
$user = $config["id_user"];
|
$user = $config["id_user"];
|
||||||
$hashdata = $user.$pwd;
|
$hashdata = $user.$pwd;
|
||||||
$hashdata = md5($hashdata);
|
$hashdata = md5($hashdata);
|
||||||
|
@ -1227,7 +1227,7 @@ function html_print_image ($src, $return = false, $options = false, $return_src
|
|||||||
|
|
||||||
if (!$relative) {
|
if (!$relative) {
|
||||||
if (defined('METACONSOLE'))
|
if (defined('METACONSOLE'))
|
||||||
$src .= ENTERPRISE_DIR . '/meta/' . $src;
|
$src = ENTERPRISE_DIR . '/meta/' . $src;
|
||||||
|
|
||||||
$src = ui_get_full_url($src);
|
$src = ui_get_full_url($src);
|
||||||
}
|
}
|
||||||
|
@ -1318,7 +1318,7 @@ function reporting_alert_reporting ($id_group, $period = 0, $date = 0, $return =
|
|||||||
$data[__('Alerts not fired')] = $not_fired_percentage;
|
$data[__('Alerts not fired')] = $not_fired_percentage;
|
||||||
|
|
||||||
$output .= pie3d_graph(false, $data, 280, 150,
|
$output .= pie3d_graph(false, $data, 280, 150,
|
||||||
__("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
|
__("other"), $config['homeurl'] . '/', $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'], $config['font_size']);
|
||||||
|
|
||||||
$output .= '<strong>'.__('Alerts fired').': '.sizeof ($alerts_fired).'</strong><br />';
|
$output .= '<strong>'.__('Alerts fired').': '.sizeof ($alerts_fired).'</strong><br />';
|
||||||
@ -1394,7 +1394,7 @@ function reporting_monitor_health ($id_group, $period = 0, $date = 0, $return =
|
|||||||
$data[__('Monitors BAD')] = $not_down_percentage;
|
$data[__('Monitors BAD')] = $not_down_percentage;
|
||||||
|
|
||||||
$output .= pie3d_graph(false, $data, 280, 150,
|
$output .= pie3d_graph(false, $data, 280, 150,
|
||||||
__("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
|
__("other"), $config['homeurl'] . '/', $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'], $config['font_size']);
|
||||||
|
|
||||||
if (!$return)
|
if (!$return)
|
||||||
@ -2105,7 +2105,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
}
|
}
|
||||||
|
|
||||||
$server_name = $content ['server_name'];
|
$server_name = $content ['server_name'];
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -2143,7 +2143,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
|
|
||||||
$data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'],
|
$data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'],
|
||||||
false, $sizgraph_w, $sizgraph_h, '', '', false, true, true,
|
false, $sizgraph_w, $sizgraph_h, '', '', false, true, true,
|
||||||
$report["datetime"], '', 0, 0, true, true);
|
$report["datetime"], '', 0, 0, true, true, $config['homeurl'] . '/');
|
||||||
|
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
break;
|
break;
|
||||||
@ -2189,7 +2189,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
0,
|
0,
|
||||||
$report["datetime"],
|
$report["datetime"],
|
||||||
true,
|
true,
|
||||||
'',
|
$config['homedir'] . '/',
|
||||||
1,
|
1,
|
||||||
// Important parameter, this tell to graphic_combined_module function that is a projection graph
|
// Important parameter, this tell to graphic_combined_module function that is a projection graph
|
||||||
$output_projection,
|
$output_projection,
|
||||||
@ -2250,7 +2250,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
$data = array ();
|
$data = array ();
|
||||||
$data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'],
|
$data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'],
|
||||||
false, $sizgraph_w, $sizgraph_h, '', '', false, true, true,
|
false, $sizgraph_w, $sizgraph_h, '', '', false, true, true,
|
||||||
$report["datetime"], '', true, 0, true, true);
|
$report["datetime"], '', true, 0, true, true, $config['homedir'] . '/');
|
||||||
|
|
||||||
/*$data[0] = graphic_combined_module(
|
/*$data[0] = graphic_combined_module(
|
||||||
$modules,
|
$modules,
|
||||||
@ -2316,7 +2316,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
0,
|
0,
|
||||||
$graph["stacked"],
|
$graph["stacked"],
|
||||||
$report["datetime"],
|
$report["datetime"],
|
||||||
true);
|
true,
|
||||||
|
$config['homeurl'] . "/");
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -2398,7 +2399,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
foreach ($slas as $sla) {
|
foreach ($slas as $sla) {
|
||||||
$server_name = $sla ['server_name'];
|
$server_name = $sla ['server_name'];
|
||||||
//Metaconsole connection
|
//Metaconsole connection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (!metaconsole_load_external_db($connection)) {
|
if (!metaconsole_load_external_db($connection)) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -2439,7 +2440,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
|
|
||||||
$server_name = $sla ['server_name'];
|
$server_name = $sla ['server_name'];
|
||||||
//Metaconsole connection
|
//Metaconsole connection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (!metaconsole_load_external_db($connection)) {
|
if (!metaconsole_load_external_db($connection)) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -2530,12 +2531,12 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
|
|
||||||
$dataslice[1] = graph_sla_slicebar ($sla['id_agent_module'], $content['period'],
|
$dataslice[1] = graph_sla_slicebar ($sla['id_agent_module'], $content['period'],
|
||||||
$sla['sla_min'], $sla['sla_max'], $report['datetime'], $content, $content['time_from'],
|
$sla['sla_min'], $sla['sla_max'], $report['datetime'], $content, $content['time_from'],
|
||||||
$content['time_to'], 650, 25,'');
|
$content['time_to'], 650, 25, $config['homeurl'] . '/');
|
||||||
|
|
||||||
array_push ($tableslice->data, $dataslice);
|
array_push ($tableslice->data, $dataslice);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config ['metaconsole'] == 1) {
|
if ($config ['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
@ -2553,7 +2554,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
$data_pie_graph = json_encode ($data_graph);
|
$data_pie_graph = json_encode ($data_graph);
|
||||||
if ($show_graphs && !empty($slas)) {
|
if ($show_graphs && !empty($slas)) {
|
||||||
$data[0] = pie3d_graph(false, $data_graph,
|
$data[0] = pie3d_graph(false, $data_graph,
|
||||||
500, 150, __("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
|
500, 150, __("other"), $config['homeurl'] . '/', $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'], $config['font_size']);
|
||||||
|
|
||||||
|
|
||||||
@ -2867,7 +2868,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
|
|
||||||
$data = array ();
|
$data = array ();
|
||||||
|
|
||||||
$data[0] = graph_custom_sql_graph($content["id_rc"], $sizgraph_w, 200, $content["type"], true);
|
$data[0] = graph_custom_sql_graph($content["id_rc"], $sizgraph_w, 200, $content["type"], true, $config['homeurl'] . '/');
|
||||||
|
|
||||||
array_push($table->data, $data);
|
array_push($table->data, $data);
|
||||||
break;
|
break;
|
||||||
@ -3258,7 +3259,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
foreach ($generals as $key => $row) {
|
foreach ($generals as $key => $row) {
|
||||||
//Metaconsole connection
|
//Metaconsole connection
|
||||||
$server_name = $row ['server_name'];
|
$server_name = $row ['server_name'];
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -3294,7 +3295,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
$operations[$key] = $row['operation'];
|
$operations[$key] = $row['operation'];
|
||||||
|
|
||||||
//Restore dbconnection
|
//Restore dbconnection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3303,11 +3304,11 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
switch ($order_uptodown) {
|
switch ($order_uptodown) {
|
||||||
//Descending
|
//Descending
|
||||||
case 1:
|
case 1:
|
||||||
array_multisort($data_res, SORT_DESC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC);
|
array_multisort($data_res, SORT_DESC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC, $operations, SORT_ASC);
|
||||||
break;
|
break;
|
||||||
//Ascending
|
//Ascending
|
||||||
case 2:
|
case 2:
|
||||||
array_multisort($data_res, SORT_ASC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC);
|
array_multisort($data_res, SORT_ASC, $agent_name, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC, $operations, SORT_ASC);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$i=0;
|
$i=0;
|
||||||
@ -3345,17 +3346,36 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
}
|
}
|
||||||
//Order by agent name
|
//Order by agent name
|
||||||
elseif ($order_uptodown == 3) {
|
elseif ($order_uptodown == 3) {
|
||||||
array_multisort($agent_name, SORT_ASC, $data_avg, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC);
|
array_multisort($agent_name, SORT_ASC, $data_res, SORT_ASC, $module_name, SORT_ASC, $id_agent_module, SORT_ASC, $operations, SORT_ASC);
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach ($agent_name as $a) {
|
foreach ($agent_name as $a) {
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = $agent_name[$i];
|
$data[0] = $agent_name[$i];
|
||||||
$data[1] = $module_name[$i];
|
$data[1] = $module_name[$i];
|
||||||
|
|
||||||
|
switch ($operations[$i]) {
|
||||||
|
case 'sum':
|
||||||
|
$op = __('Summatory');
|
||||||
|
break;
|
||||||
|
case 'min':
|
||||||
|
$op = __('Minimal');
|
||||||
|
break;
|
||||||
|
case 'max':
|
||||||
|
$op = __('Maximun');
|
||||||
|
break;
|
||||||
|
case 'avg':
|
||||||
|
default:
|
||||||
|
$op = __('Average');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$data[2] = $op;
|
||||||
|
|
||||||
|
|
||||||
if ($data_res[$i] === false) {
|
if ($data_res[$i] === false) {
|
||||||
$data[2] = '--';
|
$data[3] = '--';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$data[2] = format_for_graph($data_res[$i], 2) . " " . $units[$i];
|
$data[3] = format_for_graph($data_res[$i], 2) . " " . $units[$i];
|
||||||
}
|
}
|
||||||
array_push ($table1->data, $data);
|
array_push ($table1->data, $data);
|
||||||
$i++;
|
$i++;
|
||||||
@ -3388,7 +3408,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
foreach ($generals as $general) {
|
foreach ($generals as $general) {
|
||||||
//Metaconsole connection
|
//Metaconsole connection
|
||||||
$server_name = $general ['server_name'];
|
$server_name = $general ['server_name'];
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -3404,11 +3424,11 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
if (!in_array ($mod_name, $modules_list)) {
|
if (!in_array ($mod_name, $modules_list)) {
|
||||||
array_push ($modules_list, $mod_name);
|
array_push ($modules_list, $mod_name);
|
||||||
}
|
}
|
||||||
if (!in_array ($general['operation'], $operation_list)) {
|
//if (!in_array ($general['operation'], $operation_list)) {
|
||||||
array_push ($operation_list, $general['operation']);
|
array_push ($operation_list, $general['operation']);
|
||||||
}
|
//}
|
||||||
//Restore dbconnection
|
//Restore dbconnection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3435,7 +3455,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
foreach ($generals as $g) {
|
foreach ($generals as $g) {
|
||||||
//Metaconsole connection
|
//Metaconsole connection
|
||||||
$server_name = $g ['server_name'];
|
$server_name = $g ['server_name'];
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -3474,10 +3494,20 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
else {
|
else {
|
||||||
$data[$i] = '--';
|
$data[$i] = '--';
|
||||||
}
|
}
|
||||||
if ($found == true) break;
|
|
||||||
|
if ($found == true) {
|
||||||
|
|
||||||
|
//Restore dbconnection
|
||||||
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
|
metaconsole_restore_db();
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//Restore dbconnection
|
//Restore dbconnection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3500,7 +3530,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
do {
|
do {
|
||||||
//Metaconsole connection
|
//Metaconsole connection
|
||||||
$server_name = $generals[$i]['server_name'];
|
$server_name = $generals[$i]['server_name'];
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -3525,7 +3555,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
//Restore dbconnection
|
//Restore dbconnection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
} while ($min === false && $i < count($generals));
|
} while ($min === false && $i < count($generals));
|
||||||
@ -3540,7 +3570,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
foreach ($generals as $g) {
|
foreach ($generals as $g) {
|
||||||
//Metaconsole connection
|
//Metaconsole connection
|
||||||
$server_name = $g['server_name'];
|
$server_name = $g['server_name'];
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -3575,7 +3605,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Restore dbconnection
|
//Restore dbconnection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3677,7 +3707,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
|
|
||||||
//Metaconsole connection
|
//Metaconsole connection
|
||||||
$server_name = $row['server_name'];
|
$server_name = $row['server_name'];
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -3716,7 +3746,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Restore dbconnection
|
//Restore dbconnection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3826,7 +3856,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
$data = array();
|
$data = array();
|
||||||
if ($show_graph == 1 || $show_graph == 2) {
|
if ($show_graph == 1 || $show_graph == 2) {
|
||||||
$data[0] = pie3d_graph(false, $data_pie_graph,
|
$data[0] = pie3d_graph(false, $data_pie_graph,
|
||||||
$sizgraph_w, $sizgraph_h, __("other"),"", $config['homedir'] . "/images/logo_vertical_water.png",
|
$sizgraph_w, $sizgraph_h, __("other"),$config['homeurl'] . "/", $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'], $config['font_size']);
|
||||||
|
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
@ -3835,7 +3865,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
$table->style[0] .= 'text-align:center';
|
$table->style[0] .= 'text-align:center';
|
||||||
$height = count($data_pie_graph)*20+35;
|
$height = count($data_pie_graph)*20+35;
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = hbar_graph(false, $data_hbar, $sizgraph_w, $height, array(), array(), "", "", true, "", $config['homedir'] . "/images/logo_vertical_water.png", $config['fontpath'], $config['font_size'], true, 1, true);
|
$data[0] = hbar_graph(false, $data_hbar, $sizgraph_w, $height, array(), array(), "", "", true, $config['homeurl'] . "/", $config['homedir'] . "/images/logo_vertical_water.png", $config['fontpath'], $config['font_size'], true, 1, true);
|
||||||
|
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
}
|
}
|
||||||
@ -3944,7 +3974,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
do {
|
do {
|
||||||
//Metaconsole connection
|
//Metaconsole connection
|
||||||
$server_name = $exceptions[$i]['server_name'];
|
$server_name = $exceptions[$i]['server_name'];
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -3956,7 +3986,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
//Restore dbconnection
|
//Restore dbconnection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
} while ($min === false && $i < count($exceptions));
|
} while ($min === false && $i < count($exceptions));
|
||||||
@ -3967,7 +3997,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
foreach ($exceptions as $exc) {
|
foreach ($exceptions as $exc) {
|
||||||
//Metaconsole connection
|
//Metaconsole connection
|
||||||
$server_name = $exc['server_name'];
|
$server_name = $exc['server_name'];
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
@ -4025,7 +4055,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
$units[] = $unit;
|
$units[] = $unit;
|
||||||
}
|
}
|
||||||
//Restore dbconnection
|
//Restore dbconnection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4122,7 +4152,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
$data = array();
|
$data = array();
|
||||||
if ($show_graph == 1 || $show_graph == 2) {
|
if ($show_graph == 1 || $show_graph == 2) {
|
||||||
$data[0] = pie3d_graph(false, $data_pie_graph,
|
$data[0] = pie3d_graph(false, $data_pie_graph,
|
||||||
600, 150, __("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
|
600, 150, __("other"), $config['homeurl'] . "/", $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'], $config['font_size']);
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
//Display bars graph
|
//Display bars graph
|
||||||
@ -4424,8 +4454,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//Restore dbconnection
|
//Restore dbconnection
|
||||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db_force();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($chart_data)) {
|
if (empty($chart_data)) {
|
||||||
return html_print_image($no_data_image, true, array("border" => '0'));
|
return '<img src="'.$no_data_image.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($flash_chart) {
|
if ($flash_chart) {
|
||||||
@ -279,7 +279,7 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color,
|
|||||||
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
||||||
|
|
||||||
if (empty($chart_data)) {
|
if (empty($chart_data)) {
|
||||||
return html_print_image($no_data_image, true, array("border" => '0'));
|
return '<img src="'.$no_data_image.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($flash_chart) {
|
if($flash_chart) {
|
||||||
@ -314,7 +314,7 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height, $color,
|
|||||||
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
||||||
|
|
||||||
if (empty($chart_data)) {
|
if (empty($chart_data)) {
|
||||||
return html_print_image($no_data_image, true, array("border" => '0'));
|
return '<img src="'.$no_data_image.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($flash_chart) {
|
if($flash_chart) {
|
||||||
@ -349,7 +349,7 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
|
|||||||
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
||||||
|
|
||||||
if (empty($chart_data)) {
|
if (empty($chart_data)) {
|
||||||
return html_print_image($no_data_image, true, array("border" => '0'));
|
return '<img src="'.$no_data_image.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($flash_chart) {
|
if($flash_chart) {
|
||||||
@ -376,7 +376,7 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
|
|||||||
|
|
||||||
function kiviat_graph($graph_type, $flash_chart, $chart_data, $width, $height, $no_data_image, $ttl = 1, $homedir="") {
|
function kiviat_graph($graph_type, $flash_chart, $chart_data, $width, $height, $no_data_image, $ttl = 1, $homedir="") {
|
||||||
if (empty($chart_data)) {
|
if (empty($chart_data)) {
|
||||||
return html_print_image($no_data_image, true, array("border" => '0'));
|
return '<img src="'.$no_data_image.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
$graph = array();
|
$graph = array();
|
||||||
|
@ -132,6 +132,7 @@ function isEmptyObject(obj) {
|
|||||||
* @param selected Which module(s) have to be selected
|
* @param selected Which module(s) have to be selected
|
||||||
*/
|
*/
|
||||||
function agent_changed_by_multiple_agents (event, id_agent, selected) {
|
function agent_changed_by_multiple_agents (event, id_agent, selected) {
|
||||||
|
|
||||||
// Hack to add custom condition
|
// Hack to add custom condition
|
||||||
if($("#hidden-custom_condition").val() != undefined) {
|
if($("#hidden-custom_condition").val() != undefined) {
|
||||||
custom_condition = $("#hidden-custom_condition").val();
|
custom_condition = $("#hidden-custom_condition").val();
|
||||||
@ -164,7 +165,15 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) {
|
|||||||
$('#module').attr ('disabled', 1);
|
$('#module').attr ('disabled', 1);
|
||||||
$('#module').empty ();
|
$('#module').empty ();
|
||||||
$('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0));
|
$('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0));
|
||||||
jQuery.post ('ajax.php',
|
|
||||||
|
// Check if homedir was received like a JSON
|
||||||
|
homedir = '';
|
||||||
|
if (event.data == null)
|
||||||
|
homedir += '.';
|
||||||
|
else
|
||||||
|
homedir = event.data.homedir;
|
||||||
|
|
||||||
|
jQuery.post (homedir + '/ajax.php',
|
||||||
{"page": "operation/agentes/ver_agente",
|
{"page": "operation/agentes/ver_agente",
|
||||||
"get_agent_modules_json_for_multiple_agents": 1,
|
"get_agent_modules_json_for_multiple_agents": 1,
|
||||||
"id_agent[]": idAgents,
|
"id_agent[]": idAgents,
|
||||||
@ -206,7 +215,7 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) {
|
|||||||
}
|
}
|
||||||
jQuery.each (data, function (i, val) {
|
jQuery.each (data, function (i, val) {
|
||||||
s = js_html_entity_decode(val);
|
s = js_html_entity_decode(val);
|
||||||
$('#module').append ($('<option></option>').html (s).attr ("value", val));
|
$('#module').append ($('<option></option>').html (s).attr ("value", i));
|
||||||
$('#module').fadeIn ('normal');
|
$('#module').fadeIn ('normal');
|
||||||
});
|
});
|
||||||
if (selected != undefined)
|
if (selected != undefined)
|
||||||
@ -433,7 +442,7 @@ function agent_changed_by_multiple_agents_id (event, id_agent, selected) {
|
|||||||
* @param id_agent_id id of the hidden field to store the agent id
|
* @param id_agent_id id of the hidden field to store the agent id
|
||||||
* @param id_agent_module_selector id of the selector for the modules of the agent.
|
* @param id_agent_module_selector id of the selector for the modules of the agent.
|
||||||
*/
|
*/
|
||||||
function agent_module_autocomplete (id_agent_name, id_agent_id, id_agent_module_selector, id_server_name, noneValue) {
|
function agent_module_autocomplete (id_agent_name, id_agent_id, id_agent_module_selector, id_server_name, noneValue, homedir = '.') {
|
||||||
//Check exist the field with id in the var id_agent_name.
|
//Check exist the field with id in the var id_agent_name.
|
||||||
if ($(id_agent_name).length == 0)
|
if ($(id_agent_name).length == 0)
|
||||||
return;
|
return;
|
||||||
@ -450,7 +459,7 @@ function agent_module_autocomplete (id_agent_name, id_agent_id, id_agent_module_
|
|||||||
data: data_params,
|
data: data_params,
|
||||||
async: false,
|
async: false,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= homedir + "/ajax.php",
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@ -496,7 +505,7 @@ function agent_module_autocomplete (id_agent_name, id_agent_id, id_agent_module_
|
|||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: data_params,
|
data: data_params,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: action="ajax.php",
|
url: action= homedir + "/ajax.php",
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
@ -178,16 +178,22 @@ if (is_ajax ()) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config ['metaconsole'] == 1) {
|
if ($config ['metaconsole'] == 1 and defined('METACONSOLE')) {
|
||||||
$result = array();
|
$result = array();
|
||||||
$nameModules = array();
|
$nameModules = array();
|
||||||
$temp = array();
|
$temp = array();
|
||||||
$first = true;
|
$first = true;
|
||||||
|
$temp_element = array();
|
||||||
|
$counter = 0;
|
||||||
|
$first_elements = array();
|
||||||
|
|
||||||
foreach ($idAgents as $idA) {
|
foreach ($idAgents as $idA) {
|
||||||
|
|
||||||
$row = explode ('|', $idA);
|
$row = explode ('|', $idA);
|
||||||
$server_name = $row[0];
|
$server_name = $row[0];
|
||||||
$id_agent = $row [1];
|
$id_agent = $row [1];
|
||||||
|
// New iteration
|
||||||
|
$counter++;
|
||||||
|
|
||||||
//Metaconsole db connection
|
//Metaconsole db connection
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
@ -195,30 +201,65 @@ if (is_ajax ()) {
|
|||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get agent's modules
|
//Get agent's modules
|
||||||
$temp = agents_get_modules ($id_agent);
|
$temp = agents_get_modules ($id_agent);
|
||||||
|
|
||||||
//Copy only the very first result to $nameModules
|
// Keep first element to search for common modules in next iterations
|
||||||
if (empty($nameModules) && $first == true) {
|
if (empty($nameModules) && $first == true) {
|
||||||
|
$first_elements = $temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
$temp = array_intersect($temp, $first_elements);
|
||||||
|
|
||||||
|
// Add elements to array
|
||||||
|
if (!empty($temp)) {
|
||||||
|
|
||||||
|
// Add agent and server
|
||||||
|
foreach ($temp as $element_key => $element_value) {
|
||||||
|
|
||||||
|
//$temp_element[$element_key . '|' . $id_agent . '|' . $server_name] = $element_value;
|
||||||
|
if (!isset($temp_element[$element_value]) && $first)
|
||||||
|
$temp_element[$element_value] = $element_key . '|' . $id_agent . '|' . $server_name;
|
||||||
|
else if (isset($temp_element[$element_value]))
|
||||||
|
$temp_element[$element_value] .= ';' . $element_key . '|' . $id_agent . '|' . $server_name;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// If the result array is empty then there aren't common modules
|
||||||
|
else if (!$first)
|
||||||
|
unset($temp_element);
|
||||||
|
|
||||||
|
|
||||||
|
// First iteration flag
|
||||||
|
if (empty($nameModules) && $first == true)
|
||||||
$first = false;
|
$first = false;
|
||||||
$nameModules = $temp;
|
|
||||||
|
// In last iteration we have all elements agents-servers serialized and ready to be used
|
||||||
|
if ($counter == count($idAgents)) {
|
||||||
|
if (!empty($temp_element))
|
||||||
|
|
||||||
|
foreach ($temp_element as $temp_ele_key => $temp_ele_val) {
|
||||||
|
$nameModules[$temp_ele_val] = $temp_ele_key;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//If there's only one agent selected, get out of this loop
|
//If there's only one agent selected, get out of this loop
|
||||||
if (count($idAgents) <= 1) {
|
/*if (count($idAgents) <= 1) {
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
break;
|
break;
|
||||||
}
|
}*/
|
||||||
$nameModules = array_intersect ($nameModules, $temp);
|
//$nameModules = array_intersect ($nameModules, $temp);
|
||||||
|
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($nameModules as $nameModule) {
|
foreach ($nameModules as $nameModule_key => $nameModule_value) {
|
||||||
$result[] = io_safe_output($nameModule);
|
$result[$nameModule_key] = io_safe_output($nameModule_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -247,10 +288,10 @@ if (is_ajax ()) {
|
|||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach($nameModules as $nameModule) {
|
foreach($nameModules as $nameModule) {
|
||||||
$result[] = io_safe_output($nameModule['nombre']);
|
$result[$nameModule['nombre'].'$*$'.implode('|', $idAgents)] = io_safe_output($nameModule['nombre']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode($result);
|
echo json_encode($result);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -272,7 +313,7 @@ if (is_ajax ()) {
|
|||||||
else
|
else
|
||||||
$search = false;
|
$search = false;
|
||||||
|
|
||||||
if ($config ['metaconsole'] == 1 and !$force_local_modules) {
|
if ($config ['metaconsole'] == 1 and !$force_local_modules and defined('METACONSOLE')) {
|
||||||
if (enterprise_include_once ('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
|
if (enterprise_include_once ('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
if (metaconsole_load_external_db($connection) == NOERR) {
|
if (metaconsole_load_external_db($connection) == NOERR) {
|
||||||
|
@ -38,8 +38,8 @@ if (! check_acl ($config['id_user'], $report['id_group'], "AR")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Include with the functions to calculate each kind of report.
|
// Include with the functions to calculate each kind of report.
|
||||||
require_once ('include/functions_reporting.php');
|
require_once ($config['homedir'] . '/include/functions_reporting.php');
|
||||||
require_once ('include/functions_groups.php');
|
require_once ($config['homedir'] . '/include/functions_groups.php');
|
||||||
|
|
||||||
enterprise_include("include/functions_reporting.php");
|
enterprise_include("include/functions_reporting.php");
|
||||||
|
|
||||||
@ -65,9 +65,15 @@ $enable_init_date = get_parameter('enable_init_date', 0);
|
|||||||
|
|
||||||
// Standard header
|
// Standard header
|
||||||
|
|
||||||
$url = "index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=$id_report&date=$date&time=$time";
|
// Build link for sort actions: metaconsole and normal console
|
||||||
|
$variable_link = ui_get_full_url(false);
|
||||||
|
// Metaconsole
|
||||||
|
if ($config['metaconsole'] == 1 and defined('METACONSOLE'))
|
||||||
|
$variable_link .= '/enterprise/meta/';
|
||||||
|
|
||||||
$options['setup'] = "<a href='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&action=new&tab=item_editor&id_report=$id_report'>"
|
$url = $variable_link . "index.php?sec=reporting&sec2=" . $config['homedir'] . "/operation/reporting/reporting_viewer&id=$id_report&date=$date&time=$time";
|
||||||
|
|
||||||
|
$options['setup'] = "<a href='" . $variable_link . "index.php?sec=reporting&sec2=" . $config['homedir'] . "/godmode/reporting/reporting_builder&action=new&tab=item_editor&id_report=$id_report'>"
|
||||||
. html_print_image ("images/setup.png", true, array ("title" => __('Setup')))
|
. html_print_image ("images/setup.png", true, array ("title" => __('Setup')))
|
||||||
. "</a>";
|
. "</a>";
|
||||||
|
|
||||||
@ -82,8 +88,19 @@ else {
|
|||||||
. "</a>";
|
. "</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_print_page_header (__('Reporting'). " » ". __('Custom reporting'). " - ".$report["name"],
|
// Page header for metaconsole
|
||||||
"images/reporting.png", false, "", false, $options);
|
if ($config['metaconsole'] == 1 and defined('METACONSOLE')) {
|
||||||
|
// Bread crumbs
|
||||||
|
ui_meta_add_breadcrumb(array('link' => 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder', 'text' => __('Reporting')));
|
||||||
|
|
||||||
|
ui_meta_print_page_header($nav_bar);
|
||||||
|
|
||||||
|
// Print header
|
||||||
|
ui_meta_print_header(__('Reporting'), "", $options);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ui_print_page_header (__('Reporting'). " » ". __('Custom reporting'). " - ".$report["name"],
|
||||||
|
"images/reporting.png", false, "", false, $options);
|
||||||
|
|
||||||
if ($enable_init_date) {
|
if ($enable_init_date) {
|
||||||
if ($datetime_init > $datetime) {
|
if ($datetime_init > $datetime) {
|
||||||
|
@ -984,7 +984,8 @@ CREATE TABLE treport (
|
|||||||
footer CLOB default NULL,
|
footer CLOB default NULL,
|
||||||
custom_font VARCHAR2(200) default NULL,
|
custom_font VARCHAR2(200) default NULL,
|
||||||
id_template NUMBER(10, 0) default 0 NOT NULL,
|
id_template NUMBER(10, 0) default 0 NOT NULL,
|
||||||
id_group_edit NUMBER(19, 0) default 0 NOT NULL
|
id_group_edit NUMBER(19, 0) default 0 NOT NULL,
|
||||||
|
metaconsole NUMBER(5, 0) DEFAULT 0
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE SEQUENCE treport_s INCREMENT BY 1 START WITH 1;
|
CREATE SEQUENCE treport_s INCREMENT BY 1 START WITH 1;
|
||||||
|
@ -828,7 +828,8 @@ CREATE TABLE "treport" (
|
|||||||
"footer" TEXT default NULL,
|
"footer" TEXT default NULL,
|
||||||
"custom_font" varchar(200) default NULL,
|
"custom_font" varchar(200) default NULL,
|
||||||
"id_template" BIGINT NOT NULL default 0,
|
"id_template" BIGINT NOT NULL default 0,
|
||||||
"id_group_edit" BIGINT NOT NULL default 0
|
"id_group_edit" BIGINT NOT NULL default 0,
|
||||||
|
"metaconsole" SMALLINT DEFAULT 0
|
||||||
);
|
);
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
|
@ -956,6 +956,7 @@ CREATE TABLE IF NOT EXISTS `treport` (
|
|||||||
`custom_font` varchar(200) default NULL,
|
`custom_font` varchar(200) default NULL,
|
||||||
`id_template` INTEGER UNSIGNED DEFAULT 0,
|
`id_template` INTEGER UNSIGNED DEFAULT 0,
|
||||||
`id_group_edit` mediumint(8) unsigned NULL DEFAULT 0,
|
`id_group_edit` mediumint(8) unsigned NULL DEFAULT 0,
|
||||||
|
`metaconsole` tinyint(1) DEFAULT 0,
|
||||||
PRIMARY KEY(`id_report`)
|
PRIMARY KEY(`id_report`)
|
||||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user