2014-04-10 Alejandro Gallardo <alejandro.gallardo@artica.es>

* pandoradb.sql,
	  pandoradb.oracle.sql,
	  pandoradb.postgreSQL.sql,
	  extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
	  extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
	  extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql:
	Added the column "name"to the table "treport_content".

	* godmode/reporting/reporting_builder.item_editor.php,
	  godmode/reporting/reporting_builder.php: Now is posible
	to add a name to the report items.

	* godmode/reporting/reporting_builder.list_items.php: Now
	the list shows the name of the item or the description if
	the name is empty.

	* operation/reporting/reporting_xml.php,
	  include/functions_reporting.php: Now the XML and common
	reports show the item name if exists.

	* extensions/files_repo/files_repo_list.php: Improved
	the description.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9751 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
alexhigh 2014-04-10 10:19:02 +00:00
parent ff04697d29
commit 40c3a501b9
13 changed files with 208 additions and 54 deletions

View File

@ -1,3 +1,28 @@
2014-04-10 Alejandro Gallardo <alejandro.gallardo@artica.es>
* pandoradb.sql,
pandoradb.oracle.sql,
pandoradb.postgreSQL.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql:
Added the column "name"to the table "treport_content".
* godmode/reporting/reporting_builder.item_editor.php,
godmode/reporting/reporting_builder.php: Now is posible
to add a name to the report items.
* godmode/reporting/reporting_builder.list_items.php: Now
the list shows the name of the item or the description if
the name is empty.
* operation/reporting/reporting_xml.php,
include/functions_reporting.php: Now the XML and common
reports show the item name if exists.
* extensions/files_repo/files_repo_list.php: Improved
the description.
2014-04-09 Vanessa Gil <vanessa.gil@artica.es> 2014-04-09 Vanessa Gil <vanessa.gil@artica.es>
* godmode/servers/plugin.php * godmode/servers/plugin.php

View File

@ -65,7 +65,7 @@ if (!empty($files)) {
$url = ui_get_full_url("include/get_file.php?file=$file_path&hash=$hash"); $url = ui_get_full_url("include/get_file.php?file=$file_path&hash=$hash");
$data[0] = "<a href=\"$url\" target=\"_blank\">" . $file['name'] . "</a>"; // Name $data[0] = "<a href=\"$url\" target=\"_blank\">" . $file['name'] . "</a>"; // Name
$data[1] = $file['description']; // Description $data[1] = ui_print_truncate_text($file['description'], 'description', true, true); // Description
$data[2] = ui_format_filesize($file['size']); // Size $data[2] = ui_format_filesize($file['size']); // Size
$data[3] = date('F j, Y - H:m', $file['mtime']); // Last modification $data[3] = date('F j, Y - H:m', $file['mtime']); // Last modification

View File

@ -145,3 +145,5 @@ ALTER TABLE `treport` ADD COLUMN `non_interactive` tinyint(1) UNSIGNED NOT NULL
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
INSERT INTO `trecon_script` VALUES (4,'SNMP&#x20;L2&#x20;Recon','Pandora&#x20;FMS&#x20;SNMP&#x20;Recon&#x20;Plugin&#x20;for&#x20;level&#x20;2&#x20;network&#x20;topology&#x20;discovery.&#x0d;&#x0a;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2014&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x0d;&#x0a;&#x0d;&#x0a;&#x20;&#x20;&#x20;./snmp-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;create_incident&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;[custom_field3]&#x20;[custom_field4]&#x0d;&#x0a;&#x0d;&#x0a;&#x20;*&#x20;custom_field1&#x20;=&#x20;comma&#x20;separated&#x20;list&#x20;of&#x20;networks&#x20;&#40;i.e.:&#x20;192.168.1.0/24,192.168.2.0/24&#41;&#x0d;&#x0a;&#x20;*&#x20;custom_field2&#x20;=&#x20;comma&#x20;separated&#x20;list&#x20;of&#x20;snmp&#x20;communities&#x20;to&#x20;try.&#x0d;&#x0a;&#x20;*&#x20;custom_field3&#x20;=&#x20;a&#x20;router&#x20;in&#x20;the&#x20;network.&#x20;Optional&#x20;but&#x20;recommended.&#x0d;&#x0a;&#x0d;&#x0a;&#x20;*&#x20;custom_field4&#x20;=&#x20;set&#x20;to&#x20;-a&#x20;to&#x20;add&#x20;all&#x20;network&#x20;interfaces&#x20;&#40;by&#x20;default&#x20;only&#x20;interfaces&#x20;that&#x20;are&#x20;up&#x20;are&#x20;added&#41;.&#x0d;&#x0a;&#x0d;&#x0a;&#x20;Additional&#x20;information:&#x0d;&#x0a;When&#x20;the&#x20;script&#x20;is&#x20;called&#x20;from&#x20;a&#x20;recon&#x20;task&#x20;the&#x20;task_id,&#x20;group_id&#x20;and&#x20;create_incident&#x20;parameters&#x20;are&#x20;automatically&#x20;filled&#x20;by&#x20;the&#x20;Pandora&#x20;FMS&#x20;Server.','/usr/share/pandora_server/util/recon_scripts/snmp-recon.pl'); INSERT INTO `trecon_script` VALUES (4,'SNMP&#x20;L2&#x20;Recon','Pandora&#x20;FMS&#x20;SNMP&#x20;Recon&#x20;Plugin&#x20;for&#x20;level&#x20;2&#x20;network&#x20;topology&#x20;discovery.&#x0d;&#x0a;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2014&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x0d;&#x0a;&#x0d;&#x0a;&#x20;&#x20;&#x20;./snmp-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;create_incident&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;[custom_field3]&#x20;[custom_field4]&#x0d;&#x0a;&#x0d;&#x0a;&#x20;*&#x20;custom_field1&#x20;=&#x20;comma&#x20;separated&#x20;list&#x20;of&#x20;networks&#x20;&#40;i.e.:&#x20;192.168.1.0/24,192.168.2.0/24&#41;&#x0d;&#x0a;&#x20;*&#x20;custom_field2&#x20;=&#x20;comma&#x20;separated&#x20;list&#x20;of&#x20;snmp&#x20;communities&#x20;to&#x20;try.&#x0d;&#x0a;&#x20;*&#x20;custom_field3&#x20;=&#x20;a&#x20;router&#x20;in&#x20;the&#x20;network.&#x20;Optional&#x20;but&#x20;recommended.&#x0d;&#x0a;&#x0d;&#x0a;&#x20;*&#x20;custom_field4&#x20;=&#x20;set&#x20;to&#x20;-a&#x20;to&#x20;add&#x20;all&#x20;network&#x20;interfaces&#x20;&#40;by&#x20;default&#x20;only&#x20;interfaces&#x20;that&#x20;are&#x20;up&#x20;are&#x20;added&#41;.&#x0d;&#x0a;&#x0d;&#x0a;&#x20;Additional&#x20;information:&#x0d;&#x0a;When&#x20;the&#x20;script&#x20;is&#x20;called&#x20;from&#x20;a&#x20;recon&#x20;task&#x20;the&#x20;task_id,&#x20;group_id&#x20;and&#x20;create_incident&#x20;parameters&#x20;are&#x20;automatically&#x20;filled&#x20;by&#x20;the&#x20;Pandora&#x20;FMS&#x20;Server.','/usr/share/pandora_server/util/recon_scripts/snmp-recon.pl');
/* 2014/04/10 */
ALTER TABLE `treport_content` ADD COLUMN `name` varchar(150) NULL;

View File

@ -128,3 +128,6 @@ CREATE TABLE talert_snmp_action (
-- Table treport -- Table treport
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE treport ADD (non_interactive NUMBER(5, 0) default 0 NOT NULL); ALTER TABLE treport ADD (non_interactive NUMBER(5, 0) default 0 NOT NULL);
/* 2014/04/10 */
ALTER TABLE treport_content ADD (name VARCHAR2(150) default NULL);

View File

@ -101,3 +101,6 @@ CREATE TABLE "talert_snmp_action" (
-- Table treport -- Table treport
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE "treport" ADD COLUMN "non_interactive" SMALLINT DEFAULT 0; ALTER TABLE "treport" ADD COLUMN "non_interactive" SMALLINT DEFAULT 0;
/* 2014/04/10 */
ALTER TABLE "treport_content" ADD COLUMN "name" varchar(150) NULL;

View File

@ -104,6 +104,7 @@ switch ($action) {
case 'new': case 'new':
$actionParameter = 'save'; $actionParameter = 'save';
$type = get_parameter('type', 'SLA'); $type = get_parameter('type', 'SLA');
$name = '';
$description = null; $description = null;
$sql = null; $sql = null;
$show_in_two_columns = 0; $show_in_two_columns = 0;
@ -129,6 +130,7 @@ switch ($action) {
$action = 'new'; $action = 'new';
$type = 'SLA'; $type = 'SLA';
$name = '';
$description = null; $description = null;
$sql = null; $sql = null;
$show_in_two_columns = 0; $show_in_two_columns = 0;
@ -157,6 +159,7 @@ switch ($action) {
$show_in_two_columns = $style['show_in_two_columns']; $show_in_two_columns = $style['show_in_two_columns'];
$show_in_landscape = $style['show_in_landscape']; $show_in_landscape = $style['show_in_landscape'];
$type = $item['type']; $type = $item['type'];
$name = $item['name'];
switch ($type) { switch ($type) {
case 'avg_value': case 'avg_value':
@ -475,6 +478,16 @@ html_print_input_hidden('id_item', $idItem);
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_name" style="" class="datos">
<td style="vertical-align: top;">
<?php echo __('Name'); ?>
</td>
<td style="">
<?php
html_print_input_text('name', $name, '', 80, 100);
?>
</td>
</tr>
<tr id="row_netflow_filter" style="" class="datos"> <tr id="row_netflow_filter" style="" class="datos">
<td><?php echo __('Filter');?></td> <td><?php echo __('Filter');?></td>
<td><?php <td><?php

View File

@ -258,7 +258,7 @@ if ($items) {
'<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 . '&pure=' . $config['pure'] . '">' . html_print_image("images/sort_down.png", true, array("title" => __('Descent'))) . '</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 . '&pure=' . $config['pure'] . '">' . 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] = __('Name') . " / " . __('Description');
if (check_acl ($config['id_user'], 0, "RM")) { if (check_acl ($config['id_user'], 0, "RM")) {
$table->head[6] = '<span title="' . __('Options') . '">' . __('Op.') . '</span>'; $table->head[6] = '<span title="' . __('Options') . '">' . __('Op.') . '</span>';
} }
@ -369,11 +369,12 @@ foreach ($items as $item) {
$row[4] = '-'; $row[4] = '-';
} }
if ($item['description'] == '') { if ($item['name'] == '' && $item['description'] == '') {
$row[5] = '-'; $row[5] = '-';
} }
else { else {
$row[5] = ui_print_truncate_text($item['description'], 'description', true, true); $text = empty($item['name']) ? $item['description'] : $item['name'];
$row[5] = ui_print_truncate_text($text, 'description', true, true);
} }
$row[6] = ''; $row[6] = '';

View File

@ -700,6 +700,7 @@ switch ($action) {
case 'update': case 'update':
$values = array(); $values = array();
$values['id_report'] = $idReport; $values['id_report'] = $idReport;
$values['name'] = (string) get_parameter('name');
$values['description'] = get_parameter('description'); $values['description'] = get_parameter('description');
$values['type'] = get_parameter('type', null); $values['type'] = get_parameter('type', null);
// Added support for projection graphs, prediction date and SLA reports // Added support for projection graphs, prediction date and SLA reports
@ -904,6 +905,7 @@ switch ($action) {
$values = array(); $values = array();
$values['id_report'] = $idReport; $values['id_report'] = $idReport;
$values['type'] = get_parameter('type', null); $values['type'] = get_parameter('type', null);
$values['name'] = (string) get_parameter('name');
$values['description'] = get_parameter('description'); $values['description'] = get_parameter('description');
// Support for projection graph, prediction date and SLA reports // Support for projection graph, prediction date and SLA reports
// 'top_n_value', 'top_n' and 'text' fields will be reused for these types of report // 'top_n_value', 'top_n' and 'text' fields will be reused for these types of report
@ -1485,10 +1487,6 @@ if ($enterpriseEnable) {
} }
} }
$buttons = array(
);
$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&pure='.$pure.'">' . 'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'">' .

View File

@ -3019,11 +3019,15 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$agent_name = agents_get_name($content['id_agent']); $agent_name = agents_get_name($content['id_agent']);
} }
$item_title = $content['name'];
switch ($content["type"]) { switch ($content["type"]) {
case 1: case 1:
case 'simple_graph': case 'simple_graph':
reporting_header_content($mini, $content, $report, $table, __('Simple graph'), if (empty($item_title)) {
$item_title = __('Simple graph');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false).' <br> ' . ui_print_truncate_text($agent_name, 'agent_medium', false).' <br> ' .
ui_print_truncate_text($module_name, 'module_medium', false)); ui_print_truncate_text($module_name, 'module_medium', false));
@ -3068,7 +3072,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'projection_graph': case 'projection_graph':
reporting_header_content($mini, $content, $report, $table, __('Projection graph'), if (empty($item_title)) {
$item_title = __('Projection graph');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false).' <br> ' . ui_print_truncate_text($agent_name, 'agent_medium', false).' <br> ' .
ui_print_truncate_text($module_name, 'module_medium', false)); ui_print_truncate_text($module_name, 'module_medium', false));
@ -3122,7 +3129,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'prediction_date': case 'prediction_date':
reporting_header_content($mini, $content, $report, $table, __('Prediction date'), if (empty($item_title)) {
$item_title = __('Prediction date');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false).' <br> ' . ui_print_truncate_text($agent_name, 'agent_medium', false).' <br> ' .
ui_print_truncate_text($module_name, 'module_medium', false)); ui_print_truncate_text($module_name, 'module_medium', false));
@ -3156,7 +3166,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'simple_baseline_graph': case 'simple_baseline_graph':
reporting_header_content($mini, $content, $report, $table, __('Simple baseline graph'), if (empty($item_title)) {
$item_title = __('Simple baseline graph');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false).' <br> ' . ui_print_truncate_text($agent_name, 'agent_medium', false).' <br> ' .
ui_print_truncate_text($module_name, 'module_medium', false)); ui_print_truncate_text($module_name, 'module_medium', false));
@ -3198,7 +3211,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
case 'automatic_custom_graph': case 'automatic_custom_graph':
$graph = db_get_row ("tgraph", "id_graph", $content['id_gs']); $graph = db_get_row ("tgraph", "id_graph", $content['id_gs']);
reporting_header_content($mini, $content, $report, $table, __('Custom graph'), if (empty($item_title)) {
$item_title = __('Custom graph');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($graph['name'], 'item_title', false)); ui_print_truncate_text($graph['name'], 'item_title', false));
//RUNNING //RUNNING
@ -3249,7 +3265,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
case 3: case 3:
case 'SLA': case 'SLA':
reporting_header_content($mini, $content, $report, $table, __('S.L.A.')); if (empty($item_title)) {
$item_title = __('S.L.A.');
}
reporting_header_content($mini, $content, $report, $table, $item_title);
$edge_interval = 10; $edge_interval = 10;
@ -3537,7 +3556,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
case 6: case 6:
case 'monitor_report': case 'monitor_report':
reporting_header_content($mini, $content, $report, $table, __('Monitor report'), if (empty($item_title)) {
$item_title = __('Monitor report');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false) . ui_print_truncate_text($agent_name, 'agent_medium', false) .
' <br> '.ui_print_truncate_text($module_name, 'module_medium', false)); ' <br> '.ui_print_truncate_text($module_name, 'module_medium', false));
@ -3575,7 +3597,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
case 7: case 7:
case 'avg_value': case 'avg_value':
reporting_header_content($mini, $content, $report, $table, __('Avg. Value'), if (empty($item_title)) {
$item_title = __('Avg. Value');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false) . ui_print_truncate_text($agent_name, 'agent_medium', false) .
' <br> '.ui_print_truncate_text($module_name, 'module_medium', false)); ' <br> '.ui_print_truncate_text($module_name, 'module_medium', false));
@ -3605,7 +3630,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
case 8: case 8:
case 'max_value': case 'max_value':
reporting_header_content($mini, $content, $report, $table, __('Max. Value'), if (empty($item_title)) {
$item_title = __('Max. Value');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false) . ui_print_truncate_text($agent_name, 'agent_medium', false) .
' <br> ' . ui_print_truncate_text($module_name, 'module_medium', false)); ' <br> ' . ui_print_truncate_text($module_name, 'module_medium', false));
@ -3632,7 +3660,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
case 9: case 9:
case 'min_value': case 'min_value':
reporting_header_content($mini, $content, $report, $table, __('Min. Value'), if (empty($item_title)) {
$item_title = __('Min. Value');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false) . ui_print_truncate_text($agent_name, 'agent_medium', false) .
' <br> '.ui_print_truncate_text($module_name, 'module_medium', false)); ' <br> '.ui_print_truncate_text($module_name, 'module_medium', false));
@ -3663,7 +3694,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
case 10: case 10:
case 'sumatory': case 'sumatory':
reporting_header_content($mini, $content, $report, $table, __('Summatory'), if (empty($item_title)) {
$item_title = __('Summatory');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false) . ui_print_truncate_text($agent_name, 'agent_medium', false) .
' <br> ' . ui_print_truncate_text($module_name, 'module_medium', false)); ' <br> ' . ui_print_truncate_text($module_name, 'module_medium', false));
@ -3699,7 +3733,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
case 'agent_detailed_event': case 'agent_detailed_event':
case 'event_report_agent': case 'event_report_agent':
reporting_header_content($mini, $content, $report, $table, __('Agent detailed event'), if (empty($item_title)) {
$item_title = __('Agent detailed event');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text(agents_get_name($content['id_agent']), 'agent_medium', false)); ui_print_truncate_text(agents_get_name($content['id_agent']), 'agent_medium', false));
$style = json_decode(io_safe_output($content['style']), true); $style = json_decode(io_safe_output($content['style']), true);
@ -3817,7 +3854,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
} }
break; break;
case 'text': case 'text':
reporting_header_content($mini, $content, $report, $table, __('Text'), if (empty($item_title)) {
$item_title = __('Text');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
"", ""); "", "");
$next_row = 1; $next_row = 1;
@ -3834,7 +3874,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$table->colspan[$next_row][0] = 3; $table->colspan[$next_row][0] = 3;
break; break;
case 'sql': case 'sql':
reporting_header_content($mini, $content, $report, $table, __('SQL'), if (empty($item_title)) {
$item_title = __('SQL');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
"", ""); "", "");
$next_row = 1; $next_row = 1;
@ -3918,7 +3961,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) if ($config['metaconsole'] == 1 && defined('METACONSOLE'))
metaconsole_restore_db(); metaconsole_restore_db();
reporting_header_content($mini, $content, $report, $table, __('User defined graph') . " (".__($content["type"]) .")", if (empty($item_title)) {
$item_title = __('User defined graph') . " (".__($content["type"]) .")";
}
reporting_header_content($mini, $content, $report, $table, $item_title,
"", ""); "", "");
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)
@ -3949,11 +3995,11 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push($table->data, $data); array_push($table->data, $data);
break; break;
case 'event_report_group': case 'event_report_group':
reporting_header_content($mini, $content, $report, $table, if (empty($item_title)) {
__('Group detailed event'), $item_title = __('Group detailed event');
ui_print_truncate_text( }
groups_get_name($content['id_group'], true), reporting_header_content($mini, $content, $report, $table, $item_title,
60, false)); ui_print_truncate_text(groups_get_name($content['id_group'], true), 60, false));
$next_row = 1; $next_row = 1;
@ -4091,7 +4137,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
} }
break; break;
case 'event_report_module': case 'event_report_module':
reporting_header_content($mini, $content, $report, $table, __('Module detailed event'), if (empty($item_title)) {
$item_title = __('Module detailed event');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false) . ui_print_truncate_text($agent_name, 'agent_medium', false) .
' <br> ' . ui_print_truncate_text($module_name, 'module_medium', false)); ' <br> ' . ui_print_truncate_text($module_name, 'module_medium', false));
@ -4109,7 +4158,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'alert_report_group': case 'alert_report_group':
reporting_header_content($mini, $content, $report, $table, __('Alert report group'), if (empty($item_title)) {
$item_title = __('Alert report group');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text( ui_print_truncate_text(
groups_get_name($content['id_group'], true), groups_get_name($content['id_group'], true),
60, false)); 60, false));
@ -4130,7 +4182,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'alert_report_module': case 'alert_report_module':
reporting_header_content($mini, $content, $report, $table, __('Alert report module'), if (empty($item_title)) {
$item_title = __('Alert report module');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false) . ui_print_truncate_text($agent_name, 'agent_medium', false) .
' <br> '.ui_print_truncate_text($module_name, 'module_medium', false)); ' <br> '.ui_print_truncate_text($module_name, 'module_medium', false));
@ -4148,7 +4203,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'alert_report_agent': case 'alert_report_agent':
reporting_header_content($mini, $content, $report, $table, __('Alert report agent'), if (empty($item_title)) {
$item_title = __('Alert report agent');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false)); ui_print_truncate_text($agent_name, 'agent_medium', false));
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)
@ -4165,7 +4223,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'url': case 'url':
reporting_header_content($mini, $content, $report, $table, __('Import text from URL'), if (empty($item_title)) {
$item_title = __('Import text from URL');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($content["external_source"], 'description', false)); ui_print_truncate_text($content["external_source"], 'description', false));
$next_row = 1; $next_row = 1;
@ -4190,7 +4251,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'database_serialized': case 'database_serialized':
reporting_header_content($mini, $content, $report, $table, __('Serialize data'), if (empty($item_title)) {
$item_title = __('Serialize data');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($module_name, 'module_medium', false)); ui_print_truncate_text($module_name, 'module_medium', false));
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)
@ -4266,7 +4330,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push($table->data, array($cellContent)); array_push($table->data, array($cellContent));
break; break;
case 'TTRT': case 'TTRT':
reporting_header_content($mini, $content, $report, $table, __('TTRT'), if (empty($item_title)) {
$item_title = __('TTRT');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false) . ui_print_truncate_text($agent_name, 'agent_medium', false) .
' <br> '.ui_print_truncate_text($module_name, 'module_medium', false)); ' <br> '.ui_print_truncate_text($module_name, 'module_medium', false));
@ -4294,7 +4361,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'TTO': case 'TTO':
reporting_header_content($mini, $content, $report, $table, __('TTO'), if (empty($item_title)) {
$item_title = __('TTO');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false) . ui_print_truncate_text($agent_name, 'agent_medium', false) .
' <br> '.ui_print_truncate_text($module_name, 'module_medium', false)); ' <br> '.ui_print_truncate_text($module_name, 'module_medium', false));
@ -4323,7 +4393,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'MTBF': case 'MTBF':
reporting_header_content($mini, $content, $report, $table, __('MTBF'), if (empty($item_title)) {
$item_title = __('MTBF');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false) . ui_print_truncate_text($agent_name, 'agent_medium', false) .
' <br> '.ui_print_truncate_text($module_name, 'module_medium', false)); ' <br> '.ui_print_truncate_text($module_name, 'module_medium', false));
@ -4351,7 +4424,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'MTTR': case 'MTTR':
reporting_header_content($mini, $content, $report, $table, __('MTTR'), if (empty($item_title)) {
$item_title = __('MTTR');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
ui_print_truncate_text($agent_name, 'agent_medium', false) . ui_print_truncate_text($agent_name, 'agent_medium', false) .
' <br> '.ui_print_truncate_text($module_name, 'module_medium', false)); ' <br> '.ui_print_truncate_text($module_name, 'module_medium', false));
@ -4388,8 +4464,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$events = array(); $events = array();
} }
reporting_header_content($mini, $content, $report, $table, if (empty($item_title)) {
__('Group report').': "'.$group_name.'"'); $item_title = __('Group report').': "'.$group_name.'"';
}
reporting_header_content($mini, $content, $report, $table, $item_title);
$table->colspan[1][0] = 3; $table->colspan[1][0] = 3;
@ -4479,8 +4557,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
case 'general': case 'general':
reporting_header_content($mini, $content, $report, $table, if (empty($item_title)) {
__('General')); $item_title = __('General');
}
reporting_header_content($mini, $content, $report, $table, $item_title);
$group_by_agent = $content['group_by_agent']; $group_by_agent = $content['group_by_agent'];
$order_uptodown = $content['order_uptodown']; $order_uptodown = $content['order_uptodown'];
@ -5006,8 +5086,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
} }
reporting_header_content($mini, $content, $report, $table, if (empty($item_title)) {
'Top '.$content['top_n_value'] . '<br>' . $type_top_n); $item_title = 'Top '.$content['top_n_value'] . '<br>' . $type_top_n;
}
reporting_header_content($mini, $content, $report, $table, $item_title);
$order_uptodown = $content['order_uptodown']; $order_uptodown = $content['order_uptodown'];
@ -5372,7 +5454,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
} }
reporting_header_content($mini, $content, $report, $table, $title_exeption); if (empty($item_title)) {
$item_title = $title_exeption;
}
reporting_header_content($mini, $content, $report, $table, $item_title);
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)
$table->colspan[1][0] = 3; $table->colspan[1][0] = 3;
@ -5701,8 +5786,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
'id_mg', $content['id_module_group']); 'id_mg', $content['id_module_group']);
} }
reporting_header_content($mini, $content, $report, $table, if (empty($item_title)) {
__('Agents/Modules'), $item_title = __('Agents/Modules');
}
reporting_header_content($mini, $content, $report, $table, $item_title,
$group_name . ' - ' . $module_group_name); $group_name . ' - ' . $module_group_name);
$id_group = $content['id_group']; $id_group = $content['id_group'];
@ -5895,7 +5982,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'inventory': case 'inventory':
reporting_header_content($mini, $content, $report, $table, __('Inventory')); if (empty($item_title)) {
$item_title = __('Inventory');
}
reporting_header_content($mini, $content, $report, $table, $item_title);
$es = json_decode($content['external_source'], true); $es = json_decode($content['external_source'], true);
@ -5926,7 +6016,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
case 'inventory_changes': case 'inventory_changes':
reporting_header_content($mini, $content, $report, $table, __('Inventory changes')); if (empty($item_title)) {
$item_title = __('Inventory changes');
}
reporting_header_content($mini, $content, $report, $table, $item_title);
$es = json_decode($content['external_source'], true); $es = json_decode($content['external_source'], true);
@ -5957,7 +6050,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
case 'agent_configuration': case 'agent_configuration':
reporting_header_content($mini, $content, $report, $table, __('Agent configuration: ').$agent_name); if (empty($item_title)) {
$item_title = __('Agent configuration: ').$agent_name;
}
reporting_header_content($mini, $content, $report, $table, $item_title);
$agent_name = agents_get_name ($content['id_agent']); $agent_name = agents_get_name ($content['id_agent']);
$modules = agents_get_modules ($content['id_agent']); $modules = agents_get_modules ($content['id_agent']);
@ -6089,7 +6185,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break; break;
case 'group_configuration': case 'group_configuration':
$group_name = groups_get_name($content['id_group']); $group_name = groups_get_name($content['id_group']);
reporting_header_content($mini, $content, $report, $table, __('Group configuration: ').$group_name); if (empty($item_title)) {
$item_title = __('Group configuration: ').$group_name;
}
reporting_header_content($mini, $content, $report, $table, $item_title);
$sql = "SELECT * FROM tagente WHERE id_grupo=".$content['id_group']; $sql = "SELECT * FROM tagente WHERE id_grupo=".$content['id_group'];
$agents_list = db_get_all_rows_sql($sql); $agents_list = db_get_all_rows_sql($sql);
@ -6273,8 +6372,12 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$description = $filter['id_name']; $description = $filter['id_name'];
} }
if (empty($item_title)) {
$item_title = $description;
}
$table->colspan[0][0] = 4; $table->colspan[0][0] = 4;
$table->data[0][0] = '<h4>' . $description . '</h4>'; $table->data[0][0] = '<h4>' . $item_title . '</h4>';
$table->colspan[1][0] = 4; $table->colspan[1][0] = 4;
$table->data[1][0] = netflow_draw_item ($start_date, $end_date, $resolution, $type, $filter, $max_aggregates, $server_name, 'HTML'); $table->data[1][0] = netflow_draw_item ($start_date, $end_date, $resolution, $type, $filter, $max_aggregates, $server_name, 'HTML');
break; break;

View File

@ -210,6 +210,9 @@ foreach ($contents as $content) {
$data["period"] = human_time_description_raw ($content['period']); $data["period"] = human_time_description_raw ($content['period']);
$data["uperiod"] = $content['period']; $data["uperiod"] = $content['period'];
$data["type"] = $content["type"]; $data["type"] = $content["type"];
if (isset($content['name']) && !empty($content['name'])) {
$data["name"] = io_safe_output_xml($content["name"]);
}
// Support for metaconsole // Support for metaconsole
$server_name = $content ['server_name']; $server_name = $content ['server_name'];

View File

@ -1115,7 +1115,8 @@ CREATE TABLE treport_content (
id_agent_module NUMBER(19, 0) default NULL, id_agent_module NUMBER(19, 0) default NULL,
type VARCHAR2(30) default 'simple_graph', type VARCHAR2(30) default 'simple_graph',
period NUMBER(19, 0) default 0 NOT NULL, period NUMBER(19, 0) default 0 NOT NULL,
"order" NUMBER(19, 0) default 0 NOT NULL, order NUMBER(19, 0) default 0 NOT NULL,
name VARCHAR2(150) default NULL,
description CLOB, description CLOB,
id_agent NUMBER(19, 0) default 0 NOT NULL, id_agent NUMBER(19, 0) default 0 NOT NULL,
text CLOB default NULL, text CLOB default NULL,

View File

@ -984,6 +984,7 @@ CREATE TABLE "treport_content" (
"type" varchar(30) default 'simple_graph', "type" varchar(30) default 'simple_graph',
"period" BIGINT NOT NULL default 0, "period" BIGINT NOT NULL default 0,
"order" BIGINT NOT NULL default 0, "order" BIGINT NOT NULL default 0,
"name" varchar(150) NULL,
"description" TEXT, "description" TEXT,
"id_agent" BIGINT NOT NULL default 0, "id_agent" BIGINT NOT NULL default 0,
"text" TEXT default NULL, "text" TEXT default NULL,

View File

@ -1062,6 +1062,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
`type` varchar(30) default 'simple_graph', `type` varchar(30) default 'simple_graph',
`period` int(11) NOT NULL default 0, `period` int(11) NOT NULL default 0,
`order` int (11) NOT NULL default 0, `order` int (11) NOT NULL default 0,
`name` varchar(150) NULL,
`description` mediumtext, `description` mediumtext,
`id_agent` int(10) unsigned NOT NULL default 0, `id_agent` int(10) unsigned NOT NULL default 0,
`text` TEXT, `text` TEXT,