2014-05-07 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php, include/functions_networkmap.php: clean source code style. * include/functions_modules.php: added function "modules_get_interfaces". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9881 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e10a9432cd
commit
a0dd4b2222
|
@ -1,3 +1,11 @@
|
|||
2014-05-07 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_ui.php, include/functions_networkmap.php: clean
|
||||
source code style.
|
||||
|
||||
* include/functions_modules.php: added function
|
||||
"modules_get_interfaces".
|
||||
|
||||
2014-05-07 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||
|
||||
* pandoradb_data.sql
|
||||
|
|
|
@ -961,6 +961,40 @@ function modules_get_unit ($id_agente_modulo) {
|
|||
return $unit = (string) db_get_value ('unit', 'tagente_modulo', 'id_agente_modulo', (int) $id_agente_modulo);
|
||||
}
|
||||
|
||||
function modules_get_interfaces($id_agent, $fields_param = false) {
|
||||
$return = array();
|
||||
|
||||
$fields = $fields_param;
|
||||
if ($fields !== false) {
|
||||
if (is_array($fields)) {
|
||||
$fields[] = 'id_tipo_modulo';
|
||||
}
|
||||
}
|
||||
|
||||
$modules = db_get_all_rows_filter('tagente_modulo',
|
||||
array('id_agente' => $id_agent), $fields);
|
||||
|
||||
if (empty($modules))
|
||||
$modules = array();
|
||||
|
||||
foreach ($modules as $module) {
|
||||
if ($module['id_tipo_modulo'] == 18 || $module['id_tipo_modulo'] == 6) {
|
||||
|
||||
if ($fields_param !== false) {
|
||||
if (is_array($fields_param)) {
|
||||
if (in_array('id_tipo_modulo', $fields) !== false) {
|
||||
unset($module['id_tipo_modulo']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$return[] = $module;
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the times a monitor went down during a period.
|
||||
*
|
||||
|
|
|
@ -261,7 +261,9 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
|||
$filter['id_grupo'] = $group;
|
||||
|
||||
$agents = agents_get_agents ($filter,
|
||||
array ('id_grupo, nombre, id_os, id_parent, id_agente, normal_count, warning_count, critical_count, unknown_count, total_count, notinit_count'));
|
||||
array ('id_grupo, nombre, id_os, id_parent, id_agente,
|
||||
normal_count, warning_count, critical_count,
|
||||
unknown_count, total_count, notinit_count'));
|
||||
}
|
||||
else if ($group == -666) {
|
||||
$agents = false;
|
||||
|
@ -269,7 +271,8 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
|||
else {
|
||||
$agents = agents_get_agents ($filter,
|
||||
array ('id_grupo, nombre, id_os, id_parent, 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)
|
||||
|
@ -277,7 +280,8 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
|||
$agents = array();
|
||||
|
||||
// Open Graph
|
||||
$graph = networkmap_open_graph ($layout, $nooverlap, $pure, $zoom, $ranksep, $font_size);
|
||||
$graph = networkmap_open_graph ($layout, $nooverlap, $pure, $zoom,
|
||||
$ranksep, $font_size);
|
||||
|
||||
// Parse agents
|
||||
$nodes = array ();
|
||||
|
@ -321,7 +325,8 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
|||
// Parse modules
|
||||
foreach ($modules as $key => $module) {
|
||||
|
||||
if ($module['id_tipo_modulo'] != 18 && (!$l2_network || $module['id_tipo_modulo'] != 6)) {
|
||||
if ($module['id_tipo_modulo'] != 18 &&
|
||||
(!$l2_network || $module['id_tipo_modulo'] != 6)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1039,13 +1039,16 @@ function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image =
|
|||
function ui_require_css_file ($name, $path = 'include/styles/') {
|
||||
global $config;
|
||||
|
||||
$filename = $path.$name.'.css';
|
||||
$filename = $path . $name . '.css';
|
||||
|
||||
if (! isset ($config['css']))
|
||||
$config['css'] = array ();
|
||||
|
||||
if (isset ($config['css'][$name]))
|
||||
return true;
|
||||
if (! file_exists ($filename) && ! file_exists ($config['homedir'].'/'.$filename))
|
||||
|
||||
if (! file_exists ($filename) &&
|
||||
! file_exists ($config['homedir'] . '/' . $filename))
|
||||
return false;
|
||||
|
||||
$config['css'][$name] = $filename;
|
||||
|
|
Loading…
Reference in New Issue