2014-07-17 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_groups.php: added parameter to avoid the check the propagation in the function "groups_get_childrens". * include/functions_networkmap.php, operation/agentes/networkmap.php, operation/agentes/networkmap.topology.php: added feature to show the agents in subgroups (or not). INCIDENT: #1018 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
23a2b75bb3
commit
9b978f6674
|
@ -1,3 +1,15 @@
|
||||||
|
2014-07-17 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_groups.php: added parameter to avoid the check
|
||||||
|
the propagation in the function "groups_get_childrens".
|
||||||
|
|
||||||
|
* include/functions_networkmap.php,
|
||||||
|
operation/agentes/networkmap.php,
|
||||||
|
operation/agentes/networkmap.topology.php: added feature to show the
|
||||||
|
agents in subgroups (or not).
|
||||||
|
|
||||||
|
INCIDENT: #1018
|
||||||
|
|
||||||
2014-07-14 Vanessa Gil <vanessa.gil@artica.es>
|
2014-07-14 Vanessa Gil <vanessa.gil@artica.es>
|
||||||
|
|
||||||
* godmode/admin_access_log.php
|
* godmode/admin_access_log.php
|
||||||
|
|
|
@ -236,7 +236,7 @@ function groups_check_used($idGroup) {
|
||||||
* @param integer $parent The id_group parent to search the childrens.
|
* @param integer $parent The id_group parent to search the childrens.
|
||||||
* @param array $groups The groups, its for optimize the querys to DB.
|
* @param array $groups The groups, its for optimize the querys to DB.
|
||||||
*/
|
*/
|
||||||
function groups_get_childrens($parent, $groups = null) {
|
function groups_get_childrens($parent, $groups = null, $onlyPropagate = false) {
|
||||||
if (empty($groups)) {
|
if (empty($groups)) {
|
||||||
$groups = db_get_all_rows_in_table('tgrupo');
|
$groups = db_get_all_rows_in_table('tgrupo');
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ function groups_get_childrens($parent, $groups = null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($group['propagate']) {
|
if ($group['propagate'] || $onlyPropagate) {
|
||||||
if ($group['parent'] == $parent) {
|
if ($group['parent'] == $parent) {
|
||||||
$return = $return + array($group['id_grupo'] => $group) + groups_get_childrens($group['id_grupo'], $groups);
|
$return = $return + array($group['id_grupo'] => $group) + groups_get_childrens($group['id_grupo'], $groups);
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,7 +233,8 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
||||||
$simple = 0, $font_size = 12, $layout = 'radial', $nooverlap = 0,
|
$simple = 0, $font_size = 12, $layout = 'radial', $nooverlap = 0,
|
||||||
$zoom = 1, $ranksep = 2.5, $center = 0, $regen = 1, $pure = 0,
|
$zoom = 1, $ranksep = 2.5, $center = 0, $regen = 1, $pure = 0,
|
||||||
$id_networkmap = 0, $show_snmp_modules = 0, $cut_names = true,
|
$id_networkmap = 0, $show_snmp_modules = 0, $cut_names = true,
|
||||||
$relative = false, $text_filter = '', $l2_network = false, $ip_mask = null) {
|
$relative = false, $text_filter = '', $l2_network = false, $ip_mask = null,
|
||||||
|
$dont_show_subgroups = false) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
@ -262,7 +263,20 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($group >= 1) {
|
if ($group >= 1) {
|
||||||
|
if ($dont_show_subgroups)
|
||||||
$filter['id_grupo'] = $group;
|
$filter['id_grupo'] = $group;
|
||||||
|
else {
|
||||||
|
$childrens = groups_get_childrens($group, null, true);
|
||||||
|
if (!empty($childrens)) {
|
||||||
|
$childrens = array_keys($childrens);
|
||||||
|
|
||||||
|
$filter['id_grupo'] = $childrens;
|
||||||
|
$filter['id_grupo'][] = $group;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$filter['id_grupo'] = $group;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Order by id_parent ascendant for to avoid the bugs
|
//Order by id_parent ascendant for to avoid the bugs
|
||||||
//because the first agents to process in the next
|
//because the first agents to process in the next
|
||||||
|
@ -589,7 +603,13 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate a dot graph definition for graphviz with groups
|
// Generate a dot graph definition for graphviz with groups
|
||||||
function networkmap_generate_dot_groups ($pandora_name, $group = 0, $simple = 0, $font_size = 12, $layout = 'radial', $nooverlap = 0, $zoom = 1, $ranksep = 2.5, $center = 0, $regen = 1, $pure = 0, $modwithalerts = 0, $module_group = 0, $hidepolicymodules = 0, $depth = 'all', $id_networkmap = 0, $dont_show_subgroups = 0, $text_filter = '') {
|
function networkmap_generate_dot_groups ($pandora_name, $group = 0,
|
||||||
|
$simple = 0, $font_size = 12, $layout = 'radial', $nooverlap = 0,
|
||||||
|
$zoom = 1, $ranksep = 2.5, $center = 0, $regen = 1, $pure = 0,
|
||||||
|
$modwithalerts = 0, $module_group = 0, $hidepolicymodules = 0,
|
||||||
|
$depth = 'all', $id_networkmap = 0, $dont_show_subgroups = 0,
|
||||||
|
$text_filter = '') {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$parents = array();
|
$parents = array();
|
||||||
|
@ -682,7 +702,8 @@ function networkmap_generate_dot_groups ($pandora_name, $group = 0, $simple = 0,
|
||||||
// Get agents data
|
// Get agents data
|
||||||
$agents = agents_get_agents ($filter,
|
$agents = agents_get_agents ($filter,
|
||||||
array ('id_grupo, nombre, id_os, id_agente,
|
array ('id_grupo, nombre, id_os, id_agente,
|
||||||
normal_count, warning_count, critical_count, unknown_count, total_count, notinit_count'));
|
normal_count, warning_count, critical_count,
|
||||||
|
unknown_count, total_count, notinit_count'));
|
||||||
|
|
||||||
if ($agents === false)
|
if ($agents === false)
|
||||||
$agents = array();
|
$agents = array();
|
||||||
|
|
|
@ -320,7 +320,7 @@ $options_form = '<form action="index.php?sec=network&sec2=operation/agentes/
|
||||||
|
|
||||||
|
|
||||||
unset($table);
|
unset($table);
|
||||||
$table->width = '95%';
|
$table->width = '98%';
|
||||||
$table->class = 'databox';
|
$table->class = 'databox';
|
||||||
$table->data = array();
|
$table->data = array();
|
||||||
$table->data[0][] = __('Name:') . ' ' .
|
$table->data[0][] = __('Name:') . ' ' .
|
||||||
|
@ -329,7 +329,9 @@ $table->data[0][] = __('Group:') . ' ' .
|
||||||
html_print_select_groups(false, 'AR', false, 'group', $group, '', 'All', 0, true);
|
html_print_select_groups(false, 'AR', false, 'group', $group, '', 'All', 0, true);
|
||||||
if ($activeTab == 'groups' || $activeTab == 'policies') {
|
if ($activeTab == 'groups' || $activeTab == 'policies') {
|
||||||
$table->data[0][] = __('Module group') . ' ' .
|
$table->data[0][] = __('Module group') . ' ' .
|
||||||
html_print_select_from_sql ('SELECT id_mg, name FROM tmodule_group', 'module_group', $module_group, '', 'All', 0, true);
|
html_print_select_from_sql ('
|
||||||
|
SELECT id_mg, name
|
||||||
|
FROM tmodule_group', 'module_group', $module_group, '', 'All', 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($activeTab == 'topology') {
|
if ($activeTab == 'topology') {
|
||||||
|
@ -411,7 +413,7 @@ if ($activeTab != 'dinamic') {
|
||||||
|
|
||||||
$table->data[2][] = __('Free text for search (*):') . ' ' .
|
$table->data[2][] = __('Free text for search (*):') . ' ' .
|
||||||
html_print_input_text('text_filter', $text_filter, '', 30, 100, true);
|
html_print_input_text('text_filter', $text_filter, '', 30, 100, true);
|
||||||
if ($activeTab == 'groups') {
|
if (($activeTab == 'groups') || ($activeTab == 'topology')) {
|
||||||
$table->data[2][] = __('Don\'t show subgroups:') .
|
$table->data[2][] = __('Don\'t show subgroups:') .
|
||||||
ui_print_help_tip(__('Only run with it is filter for any group'), true) .
|
ui_print_help_tip(__('Only run with it is filter for any group'), true) .
|
||||||
' ' .
|
' ' .
|
||||||
|
|
|
@ -39,7 +39,7 @@ if (!isset($text_filter)) {
|
||||||
$graph = networkmap_generate_dot(__('Pandora FMS'), $group, $simple,
|
$graph = networkmap_generate_dot(__('Pandora FMS'), $group, $simple,
|
||||||
$font_size, $layout, $nooverlap, $zoom, $ranksep, $center, $regen,
|
$font_size, $layout, $nooverlap, $zoom, $ranksep, $center, $regen,
|
||||||
$pure, $id_networkmap, $show_snmp_modules, true, true,
|
$pure, $id_networkmap, $show_snmp_modules, true, true,
|
||||||
$text_filter, $l2_network);
|
$text_filter, $l2_network, null, $dont_show_subgroups);
|
||||||
|
|
||||||
if ($graph === false) {
|
if ($graph === false) {
|
||||||
ui_print_error_message (__('Map could not be generated'));
|
ui_print_error_message (__('Map could not be generated'));
|
||||||
|
|
Loading…
Reference in New Issue