mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
2012-12-04 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/reporting_builder.php, godmode/reporting/map_builder.php, godmode/reporting/visual_console_builder.php, godmode/reporting/visual_console_builder.data.php, include/functions_visual_map_editor.php, operation/reporting/reporting_xml.php, operation/agentes/exportdata.excel.php, operation/agentes/ver_agente.php, operation/agentes/status_monitor.php, operation/agentes/alerts_status.php, operation/agentes/exportdata.csv.php: uploaded the changes of source code style previous to my next commit for to make the next commit more easy. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7224 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
25799f0bbb
commit
c840569e80
@ -1,3 +1,19 @@
|
|||||||
|
2012-12-04 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* godmode/reporting/reporting_builder.php,
|
||||||
|
godmode/reporting/map_builder.php,
|
||||||
|
godmode/reporting/visual_console_builder.php,
|
||||||
|
godmode/reporting/visual_console_builder.data.php,
|
||||||
|
include/functions_visual_map_editor.php,
|
||||||
|
operation/reporting/reporting_xml.php,
|
||||||
|
operation/agentes/exportdata.excel.php,
|
||||||
|
operation/agentes/ver_agente.php,
|
||||||
|
operation/agentes/status_monitor.php,
|
||||||
|
operation/agentes/alerts_status.php,
|
||||||
|
operation/agentes/exportdata.csv.php: uploaded the changes of source
|
||||||
|
code style previous to my next commit for to make the next commit
|
||||||
|
more easy.
|
||||||
|
|
||||||
2012-12-03 Ramon Novoa <rnovoa@artica.es>
|
2012-12-03 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* include/functions_treeview.php: Fixed id decoding under the
|
* include/functions_treeview.php: Fixed id decoding under the
|
||||||
|
@ -61,13 +61,13 @@ if ($copy_layout) {
|
|||||||
|
|
||||||
$idNewVisualConsole = $result;
|
$idNewVisualConsole = $result;
|
||||||
|
|
||||||
if($result) {
|
if ($result) {
|
||||||
$ninsert = 1;
|
$ninsert = 1;
|
||||||
|
|
||||||
// Return from DB the items of the source layout
|
// Return from DB the items of the source layout
|
||||||
$data_layout_src = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $id_layout);
|
$data_layout_src = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $id_layout);
|
||||||
|
|
||||||
if(!empty($data_layout_src)) {
|
if (!empty($data_layout_src)) {
|
||||||
|
|
||||||
//By default the id parent 0 is always 0.
|
//By default the id parent 0 is always 0.
|
||||||
$id_relations = array(0 => 0);
|
$id_relations = array(0 => 0);
|
||||||
@ -91,7 +91,7 @@ if ($copy_layout) {
|
|||||||
$id_relations[$old_id] = $result;
|
$id_relations[$old_id] = $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($result)
|
if ($result)
|
||||||
$ninsert++;
|
$ninsert++;
|
||||||
}// for each item of console
|
}// for each item of console
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ if ($copy_layout) {
|
|||||||
else {
|
else {
|
||||||
echo '<h3 class="error">'.__('Not copied. Error copying data').'</h3>';
|
echo '<h3 class="error">'.__('Not copied. Error copying data').'</h3>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->width = '98%';
|
$table->width = '98%';
|
||||||
@ -138,7 +138,7 @@ $table->head[1] = __('Group');
|
|||||||
$table->head[2] = __('Items');
|
$table->head[2] = __('Items');
|
||||||
|
|
||||||
//Only for IW flag
|
//Only for IW flag
|
||||||
if(check_acl ($config['id_user'], 0, "IW")) {
|
if (check_acl ($config['id_user'], 0, "IW")) {
|
||||||
$table->head[3] = __('Copy');
|
$table->head[3] = __('Copy');
|
||||||
$table->head[4] = __('Delete');
|
$table->head[4] = __('Delete');
|
||||||
}
|
}
|
||||||
|
@ -1164,9 +1164,12 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
// Type case only depends of local database
|
// Type case only depends of local database
|
||||||
case 'type':
|
case 'type':
|
||||||
$sql = "SELECT id_rc FROM treport_content WHERE %s ORDER BY type %s";
|
$sql = "SELECT id_rc
|
||||||
|
FROM treport_content
|
||||||
|
WHERE %s ORDER BY type %s";
|
||||||
|
|
||||||
$sql = sprintf($sql, 'id_report = ' . $idReport, '%s');
|
$sql = sprintf($sql,
|
||||||
|
'id_report = ' . $idReport, '%s');
|
||||||
switch ($dir) {
|
switch ($dir) {
|
||||||
case 'up':
|
case 'up':
|
||||||
$sql = sprintf($sql, 'ASC');
|
$sql = sprintf($sql, 'ASC');
|
||||||
@ -1224,15 +1227,18 @@ switch ($action) {
|
|||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
$resultOperationDB = db_process_sql_update('treport_content',
|
$resultOperationDB = db_process_sql_update('treport_content',
|
||||||
array('`order`' => $oldOrder), array('`order`' => $newOrder, 'id_report' => $idReport));
|
array('`order`' => $oldOrder),
|
||||||
|
array('`order`' => $newOrder, 'id_report' => $idReport));
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
$resultOperationDB = db_process_sql_update('treport_content',
|
$resultOperationDB = db_process_sql_update('treport_content',
|
||||||
array('"order"' => $oldOrder), array('"order"' => $newOrder, 'id_report' => $idReport));
|
array('"order"' => $oldOrder),
|
||||||
|
array('"order"' => $newOrder, 'id_report' => $idReport));
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$resultOperationDB = db_process_sql_update('treport_content',
|
$resultOperationDB = db_process_sql_update('treport_content',
|
||||||
array('"order"' => $oldOrder), array('"order"' => $newOrder, 'id_report' => $idReport), 'AND', false);
|
array('"order"' => $oldOrder),
|
||||||
|
array('"order"' => $newOrder, 'id_report' => $idReport), 'AND', false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ($resultOperationDB !== false) {
|
if ($resultOperationDB !== false) {
|
||||||
@ -1362,4 +1368,4 @@ switch ($activeTab) {
|
|||||||
reporting_enterprise_select_tab($activeTab);
|
reporting_enterprise_select_tab($activeTab);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@ -37,7 +37,7 @@ switch ($action) {
|
|||||||
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "'>";
|
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "'>";
|
||||||
html_print_input_hidden('action', 'update');
|
html_print_input_hidden('action', 'update');
|
||||||
break;
|
break;
|
||||||
case 'edit':
|
case 'edit':
|
||||||
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "'>";
|
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "'>";
|
||||||
html_print_input_hidden('action', 'update');
|
html_print_input_hidden('action', 'update');
|
||||||
break;
|
break;
|
||||||
|
@ -42,6 +42,7 @@ switch ($activeTab) {
|
|||||||
$background = '';
|
$background = '';
|
||||||
$visualConsoleName = '';
|
$visualConsoleName = '';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'update':
|
case 'update':
|
||||||
case 'save':
|
case 'save':
|
||||||
$idGroup = get_parameter('id_group');
|
$idGroup = get_parameter('id_group');
|
||||||
@ -50,10 +51,10 @@ switch ($activeTab) {
|
|||||||
|
|
||||||
$values = array('name' => $visualConsoleName, 'id_group' => $idGroup, 'background' => $background);
|
$values = array('name' => $visualConsoleName, 'id_group' => $idGroup, 'background' => $background);
|
||||||
|
|
||||||
// If the background is changed the size is reseted
|
// If the background is changed the size is reseted
|
||||||
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
||||||
$background_now = $visualConsole['background'];
|
$background_now = $visualConsole['background'];
|
||||||
if($background_now != $background && $background) {
|
if ($background_now != $background && $background) {
|
||||||
$sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background);
|
$sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background);
|
||||||
$values['width'] = $sizeBackground[0];
|
$values['width'] = $sizeBackground[0];
|
||||||
$values['height'] = $sizeBackground[1];
|
$values['height'] = $sizeBackground[1];
|
||||||
@ -74,8 +75,8 @@ switch ($activeTab) {
|
|||||||
$statusProcessInDB = array('flag' => false, 'message' => '<h3 class="error">'.__('Could not be update.').'</h3>');
|
$statusProcessInDB = array('flag' => false, 'message' => '<h3 class="error">'.__('Could not be update.').'</h3>');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'save':
|
case 'save':
|
||||||
|
|
||||||
if($values['name'] != "" && $values['background'])
|
if($values['name'] != "" && $values['background'])
|
||||||
$idVisualConsole = db_process_sql_insert('tlayout', $values);
|
$idVisualConsole = db_process_sql_insert('tlayout', $values);
|
||||||
else
|
else
|
||||||
@ -94,6 +95,7 @@ switch ($activeTab) {
|
|||||||
}
|
}
|
||||||
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'edit':
|
case 'edit':
|
||||||
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
||||||
$visualConsoleName = $visualConsole['name'];
|
$visualConsoleName = $visualConsole['name'];
|
||||||
@ -102,6 +104,7 @@ switch ($activeTab) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'list_elements':
|
case 'list_elements':
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'update':
|
case 'update':
|
||||||
|
@ -85,14 +85,14 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
$form_items['image_row']['items'] = array('static_graph', 'icon', 'datos');
|
$form_items['image_row']['items'] = array('static_graph', 'icon', 'datos');
|
||||||
$form_items['image_row']['html'] = '<td>' . __('Image') . '</td>
|
$form_items['image_row']['html'] = '<td>' . __('Image') . '</td>
|
||||||
<td>'. html_print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', '', true) .'</td>';
|
<td>'. html_print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', '', true) .'</td>';
|
||||||
|
|
||||||
$form_items['enable_link_row'] = array();
|
$form_items['enable_link_row'] = array();
|
||||||
$form_items['enable_link_row']['items'] = array('static_graph',
|
$form_items['enable_link_row']['items'] = array('static_graph',
|
||||||
'percentile_bar', 'percentile_item', 'module_graph',
|
'percentile_bar', 'percentile_item', 'module_graph',
|
||||||
'simple_value', 'label', 'datos'. 'icon');
|
'simple_value', 'label', 'datos'. 'icon');
|
||||||
$form_items['enable_link_row']['html'] = '<td style="">' . __('Enable link') .'</td>
|
$form_items['enable_link_row']['html'] = '<td style="">' . __('Enable link') .'</td>
|
||||||
<td style="">'. html_print_checkbox('enable_link', '', 'enable_link', true) .'</td>';
|
<td style="">'. html_print_checkbox('enable_link', '', 'enable_link', true) .'</td>';
|
||||||
|
|
||||||
$form_items['preview_row'] = array();
|
$form_items['preview_row'] = array();
|
||||||
$form_items['preview_row']['items'] = array('static_graph', 'datos icon');
|
$form_items['preview_row']['items'] = array('static_graph', 'datos icon');
|
||||||
$form_items['preview_row']['html'] = '<td colspan="2" style="text-align: right;"><div id="preview" style="text-align: right;"></div></td>';
|
$form_items['preview_row']['html'] = '<td colspan="2" style="text-align: right;"><div id="preview" style="text-align: right;"></div></td>';
|
||||||
|
@ -417,7 +417,7 @@ $table->data = array ();
|
|||||||
|
|
||||||
foreach ($alerts['alerts_combined'] as $alert) {
|
foreach ($alerts['alerts_combined'] as $alert) {
|
||||||
array_push ($table->data, ui_format_alert_row ($alert, true, $print_agent));
|
array_push ($table->data, ui_format_alert_row ($alert, true, $print_agent));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty ($table->data)) {
|
if (!empty ($table->data)) {
|
||||||
ui_pagination ($countAlertsCombined, $url, $offset_combined, 0, false, 'offset_combined');
|
ui_pagination ($countAlertsCombined, $url, $offset_combined, 0, false, 'offset_combined');
|
||||||
|
@ -101,27 +101,27 @@ if (!empty ($module)) {
|
|||||||
|
|
||||||
// Show header
|
// Show header
|
||||||
echo $datastart;
|
echo $datastart;
|
||||||
|
|
||||||
foreach ($module as $selected) {
|
foreach ($module as $selected) {
|
||||||
|
|
||||||
$output = "";
|
$output = "";
|
||||||
$work_period = 120000;
|
$work_period = 120000;
|
||||||
if ($work_period > $period) {
|
if ($work_period > $period) {
|
||||||
$work_period = $period;
|
$work_period = $period;
|
||||||
}
|
}
|
||||||
|
|
||||||
$work_end = $end - $period + $work_period;
|
$work_end = $end - $period + $work_period;
|
||||||
//Buffer to get data, anyway this will report a memory exhaustin
|
//Buffer to get data, anyway this will report a memory exhaustin
|
||||||
|
|
||||||
while ($work_end <= $end) {
|
while ($work_end <= $end) {
|
||||||
|
|
||||||
$data = array (); // Reinitialize array for each module chunk
|
$data = array (); // Reinitialize array for each module chunk
|
||||||
if ($export_type == "avg") {
|
if ($export_type == "avg") {
|
||||||
$arr = array ();
|
$arr = array ();
|
||||||
$arr["data"] = reporting_get_agentmodule_data_average ($selected, $work_period, $work_end);
|
$arr["data"] = reporting_get_agentmodule_data_average ($selected, $work_period, $work_end);
|
||||||
if ($arr["data"] === false) {
|
if ($arr["data"] === false) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$arr["module_name"] = modules_get_agentmodule_name ($selected);
|
$arr["module_name"] = modules_get_agentmodule_name ($selected);
|
||||||
$arr["agent_name"] = modules_get_agentmodule_agent_name ($selected);
|
$arr["agent_name"] = modules_get_agentmodule_agent_name ($selected);
|
||||||
$arr["agent_id"] = modules_get_agentmodule_agent ($selected);
|
$arr["agent_id"] = modules_get_agentmodule_agent ($selected);
|
||||||
@ -160,9 +160,9 @@ if (!empty ($module)) {
|
|||||||
$output = "";
|
$output = "";
|
||||||
} // main foreach
|
} // main foreach
|
||||||
echo $dataend;
|
echo $dataend;
|
||||||
|
|
||||||
exit; // Necesary for CSV export, if not give problems
|
exit; // Necesary for CSV export, if not give problems
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
@ -120,7 +120,7 @@ if (!empty ($module)) {
|
|||||||
$arr["data"] = reporting_get_agentmodule_data_average ($selected, $work_period, $work_end);
|
$arr["data"] = reporting_get_agentmodule_data_average ($selected, $work_period, $work_end);
|
||||||
if ($arr["data"] === false) {
|
if ($arr["data"] === false) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$arr["module_name"] = modules_get_agentmodule_name ($selected);
|
$arr["module_name"] = modules_get_agentmodule_name ($selected);
|
||||||
$arr["agent_name"] = modules_get_agentmodule_agent_name ($selected);
|
$arr["agent_name"] = modules_get_agentmodule_agent_name ($selected);
|
||||||
$arr["agent_id"] = modules_get_agentmodule_agent ($selected);
|
$arr["agent_id"] = modules_get_agentmodule_agent ($selected);
|
||||||
@ -147,7 +147,7 @@ if (!empty ($module)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo $output;
|
echo $output;
|
||||||
|
|
||||||
unset($output);
|
unset($output);
|
||||||
$output = "";
|
$output = "";
|
||||||
unset($data);
|
unset($data);
|
||||||
|
@ -203,12 +203,12 @@ if (defined('METACONSOLE')) {
|
|||||||
if (!empty($rows_temp)) {
|
if (!empty($rows_temp)) {
|
||||||
foreach ($rows_temp as $module_group_key => $modules_group_val)
|
foreach ($rows_temp as $module_group_key => $modules_group_val)
|
||||||
$rows_temp_processed[$modules_group_val['name']] = $modules_group_val['name'];
|
$rows_temp_processed[$modules_group_val['name']] = $modules_group_val['name'];
|
||||||
|
|
||||||
$rows_select = array_unique(array_merge($rows_select, $rows_temp_processed));
|
$rows_select = array_unique(array_merge($rows_select, $rows_temp_processed));
|
||||||
}
|
}
|
||||||
|
|
||||||
$groups_temp = users_get_groups_for_select(false, "AR", true, true, false);
|
$groups_temp = users_get_groups_for_select(false, "AR", true, true, false);
|
||||||
|
|
||||||
$groups_temp_processed = array();
|
$groups_temp_processed = array();
|
||||||
|
|
||||||
foreach ($groups_temp as $group_temp_key => $group_temp_val) {
|
foreach ($groups_temp as $group_temp_key => $group_temp_val) {
|
||||||
@ -219,7 +219,7 @@ if (defined('METACONSOLE')) {
|
|||||||
if (!empty($groups_temp_processed)) {
|
if (!empty($groups_temp_processed)) {
|
||||||
$groups_select = array_unique(array_merge($groups_select, $groups_temp_processed));
|
$groups_select = array_unique(array_merge($groups_select, $groups_temp_processed));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($modules_temp))
|
if (!empty($modules_temp))
|
||||||
$modules = array_merge($modules, $modules_temp);
|
$modules = array_merge($modules, $modules_temp);
|
||||||
if (!empty($tags_temp))
|
if (!empty($tags_temp))
|
||||||
@ -228,11 +228,11 @@ if (defined('METACONSOLE')) {
|
|||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
unset($groups_select[__('All')]);
|
unset($groups_select[__('All')]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('METACONSOLE')) {
|
if (!defined('METACONSOLE')) {
|
||||||
echo '
|
echo '
|
||||||
<td valign="middle">' . __('Group') . '</td>
|
<td valign="middle">' . __('Group') . '</td>
|
||||||
<td valign="middle">' .
|
<td valign="middle">' .
|
||||||
html_print_select_groups(false, "AR", true, "ag_group",
|
html_print_select_groups(false, "AR", true, "ag_group",
|
||||||
@ -241,15 +241,15 @@ echo '
|
|||||||
</td>';
|
</td>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo '
|
echo '
|
||||||
<td valign="middle">' . __('Group') . '</td>
|
<td valign="middle">' . __('Group') . '</td>
|
||||||
<td valign="middle">' .
|
<td valign="middle">' .
|
||||||
html_print_select($groups_select, "ag_group",
|
html_print_select($groups_select, "ag_group",
|
||||||
io_safe_output($ag_group), '', '', '0', true, false, false, 'w130',
|
io_safe_output($ag_group), '', '', '0', true, false, false, 'w130',
|
||||||
false, 'width:150px;') . '
|
false, 'width:150px;') . '
|
||||||
</td>';
|
</td>';
|
||||||
}
|
}
|
||||||
echo '<td>' . __('Monitor status') . "</td>";
|
echo '<td>' . __('Monitor status') . "</td>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -500,14 +500,14 @@ else {
|
|||||||
elseif($user_groups != '') {
|
elseif($user_groups != '') {
|
||||||
// User has explicit permission on group 1 ?
|
// User has explicit permission on group 1 ?
|
||||||
$sql .= " AND tagente.id_grupo IN (".$user_groups.")";
|
$sql .= " AND tagente.id_grupo IN (".$user_groups.")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module group
|
// Module group
|
||||||
if (defined('METACONSOLE')) {
|
if (defined('METACONSOLE')) {
|
||||||
if ($modulegroup != '-1')
|
if ($modulegroup != '-1')
|
||||||
$sql .= sprintf (" AND tagente_modulo.id_module_group IN (SELECT id_mg
|
$sql .= sprintf (" AND tagente_modulo.id_module_group IN (SELECT id_mg
|
||||||
FROM tmodule_group WHERE name = '%s')", $modulegroup);
|
FROM tmodule_group WHERE name = '%s')", $modulegroup);
|
||||||
}
|
}
|
||||||
else if ($modulegroup > -1) {
|
else if ($modulegroup > -1) {
|
||||||
$sql .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup);
|
$sql .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup);
|
||||||
@ -564,7 +564,7 @@ if ($tag_filter !== 0) {
|
|||||||
FROM ttag_module
|
FROM ttag_module
|
||||||
WHERE ttag_module.id_tag = " . $tag_filter . "
|
WHERE ttag_module.id_tag = " . $tag_filter . "
|
||||||
)";
|
)";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,7 +572,7 @@ if ($tag_filter !== 0) {
|
|||||||
if (!defined('METACONSOLE'))
|
if (!defined('METACONSOLE'))
|
||||||
$count = db_get_sql ("SELECT COUNT(tagente_modulo.id_agente_modulo) " .
|
$count = db_get_sql ("SELECT COUNT(tagente_modulo.id_agente_modulo) " .
|
||||||
$sql . ")");
|
$sql . ")");
|
||||||
|
|
||||||
if (defined('METACONSOLE')) {
|
if (defined('METACONSOLE')) {
|
||||||
// Offset will be used to get the subset of modules
|
// Offset will be used to get the subset of modules
|
||||||
$inferior_limit = $offset;
|
$inferior_limit = $offset;
|
||||||
@ -581,12 +581,12 @@ if (defined('METACONSOLE')) {
|
|||||||
$offset = 0;
|
$offset = 0;
|
||||||
if (!isset($config["meta_num_elements"]))
|
if (!isset($config["meta_num_elements"]))
|
||||||
$config["meta_num_elements"] = 100;
|
$config["meta_num_elements"] = 100;
|
||||||
|
|
||||||
$limit_sql = $config["meta_num_elements"];
|
$limit_sql = $config["meta_num_elements"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$limit_sql = $config["block_size"];
|
$limit_sql = $config["block_size"];
|
||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
$sql = "SELECT
|
$sql = "SELECT
|
||||||
@ -707,11 +707,11 @@ switch ($config["dbtype"]) {
|
|||||||
|
|
||||||
if (! defined ('METACONSOLE')) {
|
if (! defined ('METACONSOLE')) {
|
||||||
$result = db_get_all_rows_sql ($sql);
|
$result = db_get_all_rows_sql ($sql);
|
||||||
|
|
||||||
if ($count > $config["block_size"]) {
|
if ($count > $config["block_size"]) {
|
||||||
ui_pagination ($count, false, $offset);
|
ui_pagination ($count, false, $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
$result = array ();
|
$result = array ();
|
||||||
}
|
}
|
||||||
@ -722,7 +722,7 @@ else {
|
|||||||
if ($servers === false)
|
if ($servers === false)
|
||||||
$servers = array();
|
$servers = array();
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
$count_modules = 0;
|
$count_modules = 0;
|
||||||
foreach($servers as $server) {
|
foreach($servers as $server) {
|
||||||
// If connection was good then retrieve all data server
|
// If connection was good then retrieve all data server
|
||||||
@ -730,14 +730,15 @@ else {
|
|||||||
$connection = true;
|
$connection = true;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$connection = false;
|
$connection = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result_server = db_get_all_rows_sql ($sql);
|
$result_server = db_get_all_rows_sql ($sql);
|
||||||
|
|
||||||
if(!empty($result_server)) {
|
if (!empty($result_server)) {
|
||||||
|
|
||||||
$pwd = $server["auth_token"]; // Create HASH login info
|
// Create HASH login info
|
||||||
|
$pwd = $server["auth_token"];
|
||||||
$auth_serialized = json_decode($pwd,true);
|
$auth_serialized = json_decode($pwd,true);
|
||||||
|
|
||||||
if (is_array($auth_serialized)) {
|
if (is_array($auth_serialized)) {
|
||||||
@ -753,7 +754,7 @@ else {
|
|||||||
$url_hash = "&loginhash=auto&loginhash_data=$hashdata&loginhash_user=$user";
|
$url_hash = "&loginhash=auto&loginhash_data=$hashdata&loginhash_user=$user";
|
||||||
|
|
||||||
foreach ($result_server as $result_element_key => $result_element_value) {
|
foreach ($result_server as $result_element_key => $result_element_value) {
|
||||||
|
|
||||||
$result_server[$result_element_key]['server_name'] = $server["server_name"];
|
$result_server[$result_element_key]['server_name'] = $server["server_name"];
|
||||||
$result_server[$result_element_key]['server_url'] = $server["server_url"]."/";
|
$result_server[$result_element_key]['server_url'] = $server["server_url"]."/";
|
||||||
$result_server[$result_element_key]['hashdata'] = $hashdata;
|
$result_server[$result_element_key]['hashdata'] = $hashdata;
|
||||||
@ -768,12 +769,12 @@ else {
|
|||||||
|
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($count_modules > $config["block_size"]) {
|
if ($count_modules > $config["block_size"]) {
|
||||||
ui_pagination ($count_modules, false, $offset);
|
ui_pagination ($count_modules, false, $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get number of elements of the pagination
|
// Get number of elements of the pagination
|
||||||
$result = ui_meta_get_subset_array($result, $inferior_limit, $superior_limit);
|
$result = ui_meta_get_subset_array($result, $inferior_limit, $superior_limit);
|
||||||
}
|
}
|
||||||
@ -1039,11 +1040,11 @@ else {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function toggle_full_value(id) {
|
function toggle_full_value(id) {
|
||||||
value_title = $("#hidden-value_replace_module_" + id).val();
|
value_title = $("#hidden-value_replace_module_" + id).val();
|
||||||
|
|
||||||
$("#hidden-value_replace_module_" + id).val($("#value_module_text_" + id).html());
|
$("#hidden-value_replace_module_" + id).val($("#value_module_text_" + id).html());
|
||||||
|
|
||||||
$("#value_module_text_" + id).html(value_title);
|
$("#value_module_text_" + id).html(value_title);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -317,11 +317,12 @@ if (is_ajax ()) {
|
|||||||
else
|
else
|
||||||
$search = false;
|
$search = false;
|
||||||
|
|
||||||
if ($config ['metaconsole'] == 1 and !$force_local_modules and defined('METACONSOLE')) {
|
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) {
|
||||||
|
|
||||||
/* Get all agents if no agent was given */
|
/* Get all agents if no agent was given */
|
||||||
if ($id_agent == 0)
|
if ($id_agent == 0)
|
||||||
$id_agent = array_keys (
|
$id_agent = array_keys (
|
||||||
@ -332,6 +333,7 @@ if (is_ajax ()) {
|
|||||||
$agent_modules = agents_get_modules ($id_agent,
|
$agent_modules = agents_get_modules ($id_agent,
|
||||||
($fields != '' ? explode (',', $fields) : "*"),
|
($fields != '' ? explode (',', $fields) : "*"),
|
||||||
($filter != '' ? $filter : false), $indexed);
|
($filter != '' ? $filter : false), $indexed);
|
||||||
|
|
||||||
}
|
}
|
||||||
// Restore db connection
|
// Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
@ -351,6 +353,7 @@ if (is_ajax ()) {
|
|||||||
$agent_modules[$key]['nombre'] = io_safe_output($module['nombre']);
|
$agent_modules[$key]['nombre'] = io_safe_output($module['nombre']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Hack to translate text "any" in PHP to javascript
|
//Hack to translate text "any" in PHP to javascript
|
||||||
//$agent_modules['any_text'] = __('Any');
|
//$agent_modules['any_text'] = __('Any');
|
||||||
|
|
||||||
|
@ -469,7 +469,7 @@ foreach ($contents as $content) {
|
|||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sla_data = array ();
|
$sla_data = array ();
|
||||||
$sla_data["agent"] = modules_get_agentmodule_agent_name ($sla['id_agent_module']);
|
$sla_data["agent"] = modules_get_agentmodule_agent_name ($sla['id_agent_module']);
|
||||||
@ -491,8 +491,8 @@ foreach ($contents as $content) {
|
|||||||
if (($config ['metaconsole'] == 1) && defined('METACONSOLE')) {
|
if (($config ['metaconsole'] == 1) && defined('METACONSOLE')) {
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
@ -592,7 +592,8 @@ foreach ($contents as $content) {
|
|||||||
$content_report = " <event_report_agent/>\n";
|
$content_report = " <event_report_agent/>\n";
|
||||||
$result = fwrite($file, $content_report);
|
$result = fwrite($file, $content_report);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
} else if ($data_count <= $limit) {
|
}
|
||||||
|
else if ($data_count <= $limit) {
|
||||||
$content_report = " <event_report_agent>\n";
|
$content_report = " <event_report_agent>\n";
|
||||||
$result = fwrite($file, $content_report);
|
$result = fwrite($file, $content_report);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
@ -603,7 +604,7 @@ foreach ($contents as $content) {
|
|||||||
WHERE id_agente = %d AND utimestamp > %d AND utimestamp <= %d
|
WHERE id_agente = %d AND utimestamp > %d AND utimestamp <= %d
|
||||||
GROUP BY id_agentmodule, evento
|
GROUP BY id_agentmodule, evento
|
||||||
ORDER BY time2 DESC', $content['id_agent'], $datelimit, $date);
|
ORDER BY time2 DESC', $content['id_agent'], $datelimit, $date);
|
||||||
|
|
||||||
$events = db_get_all_rows_sql ($sql);
|
$events = db_get_all_rows_sql ($sql);
|
||||||
xml_file_event ($events, $temp_file,0, $content['id_agent']);
|
xml_file_event ($events, $temp_file,0, $content['id_agent']);
|
||||||
|
|
||||||
@ -611,8 +612,9 @@ foreach ($contents as $content) {
|
|||||||
$content_report = " </event_report_agent>\n";
|
$content_report = " </event_report_agent>\n";
|
||||||
$result = fwrite($file, $content_report);
|
$result = fwrite($file, $content_report);
|
||||||
|
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$content_report = " <event_report_agent>\n";
|
$content_report = " <event_report_agent>\n";
|
||||||
$result = fwrite($file, $content_report);
|
$result = fwrite($file, $content_report);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user