Starting to fixing the networkmaps with the show all modules.
This commit is contained in:
parent
d94ccf47a2
commit
b9e598f883
|
@ -118,6 +118,7 @@ class Networkmap extends Map {
|
||||||
$status = modules_get_agentmodule_status($id);
|
$status = modules_get_agentmodule_status($id);
|
||||||
$title = modules_get_agentmodule_name($id);
|
$title = modules_get_agentmodule_name($id);
|
||||||
$type = ITEM_TYPE_MODULE_NETWORKMAP;
|
$type = ITEM_TYPE_MODULE_NETWORKMAP;
|
||||||
|
$shape = "square";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// AGENT
|
// AGENT
|
||||||
|
@ -258,6 +259,7 @@ class Networkmap extends Map {
|
||||||
$return['old_mode'] = false;
|
$return['old_mode'] = false;
|
||||||
$return['filter'] = $this->filter['text'];
|
$return['filter'] = $this->filter['text'];
|
||||||
$return['id_tag'] = $this->filter['id_tag'];
|
$return['id_tag'] = $this->filter['id_tag'];
|
||||||
|
$return['show_modules'] = $this->filter['show_modules'];
|
||||||
|
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
|
@ -295,8 +297,8 @@ class Networkmap extends Map {
|
||||||
false,
|
false,
|
||||||
null,
|
null,
|
||||||
$parameters['old_mode'],
|
$parameters['old_mode'],
|
||||||
$parameters['id_tag']);
|
$parameters['id_tag'],
|
||||||
|
$parameters['show_modules']);
|
||||||
|
|
||||||
|
|
||||||
$filename_dot = sys_get_temp_dir() . "/networkmap" . uniqid() . ".dot";
|
$filename_dot = sys_get_temp_dir() . "/networkmap" . uniqid() . ".dot";
|
||||||
|
|
|
@ -231,7 +231,8 @@ function networkmap_generate_dot ($pandora_name, $group = 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_or_mixed = false,
|
$relative = false, $text_filter = '', $l2_network_or_mixed = false,
|
||||||
$ip_mask = null, $dont_show_subgroups = false, $strict_user = false,
|
$ip_mask = null, $dont_show_subgroups = false, $strict_user = false,
|
||||||
$size_canvas = null, $old_mode = false, $id_tag = 0) {
|
$size_canvas = null, $old_mode = false, $id_tag = 0,
|
||||||
|
$show_all_modules = false) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
@ -393,7 +394,6 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
||||||
$nodes[$node_count] = $agent;
|
$nodes[$node_count] = $agent;
|
||||||
|
|
||||||
if ($l2_network || $show_snmp_modules) {
|
if ($l2_network || $show_snmp_modules) {
|
||||||
|
|
||||||
$filter = array();
|
$filter = array();
|
||||||
$filter['disabled'] = 0;
|
$filter['disabled'] = 0;
|
||||||
|
|
||||||
|
@ -406,15 +406,18 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
||||||
$agent['id_agente'], '*', $filter, true, true);
|
$agent['id_agente'], '*', $filter, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($modules === false)
|
if ($modules === false) {
|
||||||
$modules = array();
|
$modules = array();
|
||||||
|
}
|
||||||
|
|
||||||
// Parse modules
|
// Parse modules
|
||||||
foreach ($modules as $key => $module) {
|
foreach ($modules as $key => $module) {
|
||||||
|
|
||||||
if ($module['id_tipo_modulo'] != 18 &&
|
if (!$show_all_modules) {
|
||||||
(!$l2_network || $module['id_tipo_modulo'] != 6)) {
|
if ($module['id_tipo_modulo'] != 18 &&
|
||||||
continue;
|
(!$l2_network || $module['id_tipo_modulo'] != 6)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$node_count ++;
|
$node_count ++;
|
||||||
|
@ -441,29 +444,30 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
||||||
// Drop the modules without a partner if l2_network is true
|
// Drop the modules without a partner if l2_network is true
|
||||||
// and the snmp interfaces token is false
|
// and the snmp interfaces token is false
|
||||||
if ($l2_network_or_mixed === 'mix_l2_l3') {
|
if ($l2_network_or_mixed === 'mix_l2_l3') {
|
||||||
|
if (!$show_all_modules) {
|
||||||
foreach ($modules_node_ref as $id_module => $node_count) {
|
foreach ($modules_node_ref as $id_module => $node_count) {
|
||||||
if (! modules_relation_exists($id_module, array_keys($modules_node_ref))) {
|
if (! modules_relation_exists($id_module, array_keys($modules_node_ref))) {
|
||||||
if ($show_snmp_modules) {
|
if ($show_snmp_modules) {
|
||||||
$module_type = modules_get_agentmodule_type($id_module);
|
$module_type = modules_get_agentmodule_type($id_module);
|
||||||
if ($module_type != 18) {
|
if ($module_type != 18) {
|
||||||
|
unset($nodes[$node_count]);
|
||||||
|
unset($orphans[$node_count]);
|
||||||
|
unset($parents[$node_count]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
unset($nodes[$node_count]);
|
unset($nodes[$node_count]);
|
||||||
unset($orphans[$node_count]);
|
unset($orphans[$node_count]);
|
||||||
unset($parents[$node_count]);
|
unset($parents[$node_count]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unset($nodes[$node_count]);
|
$module_type = modules_get_agentmodule_type($id_module);
|
||||||
unset($orphans[$node_count]);
|
if ($module_type != 18) {
|
||||||
unset($parents[$node_count]);
|
unset($nodes[$node_count]);
|
||||||
}
|
unset($orphans[$node_count]);
|
||||||
}
|
unset($parents[$node_count]);
|
||||||
else {
|
}
|
||||||
$module_type = modules_get_agentmodule_type($id_module);
|
|
||||||
if ($module_type != 18) {
|
|
||||||
unset($nodes[$node_count]);
|
|
||||||
unset($orphans[$node_count]);
|
|
||||||
unset($parents[$node_count]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue