2013-07-30 Miguel de Dios <miguel.dedios@artica.es>

* extensions/update_manager/lib/functions.ajax.php,
	godmode/agentes/configurar_agente.php, include/functions_html.php,
	include/functions_networkmap.php: cleaned source code and removed
	the debug traces.
	
	* godmode/agentes/module_manager_editor_prediction.php,
	include/constants.php: fixed the repeat operator and added some
	constants for to make more easy the code.
	
	Fixes: #2279




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8597 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-07-30 14:10:05 +00:00
parent c7e78e0190
commit c06108fb2f
7 changed files with 53 additions and 26 deletions

View File

@ -1,3 +1,14 @@
2013-07-30 Miguel de Dios <miguel.dedios@artica.es>
* extensions/update_manager/lib/functions.ajax.php,
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor_prediction.php
include/functions_html.php
include/constants.php
include/functions_networkmap.php
2013-07-30 Miguel de Dios <miguel.dedios@artica.es>
* mobile/operation/networkmap.php, godmode/users/user_list.php,

View File

@ -984,7 +984,8 @@ if ($update_module) {
}
else {
if ($prediction_module == 3) {
enterprise_hook('modules_create_synthetic_operations', array($id_agent_module, $serialize_ops));
enterprise_hook('modules_create_synthetic_operations',
array($id_agent_module, $serialize_ops));
}
// Update the module interval

View File

@ -39,15 +39,25 @@ if ($row !== false && is_array($row)) {
$custom_integer_1 = $row['custom_integer_1'];
switch ($prediction_module) {
case 2:
case MODULE_PREDICTION_SERVICE:
$is_service = true;
$custom_integer_2 = 0;
break;
case 3:
$ops_json = enterprise_hook('modules_get_synthetic_operations', array($id_agente_modulo));
case MODULE_PREDICTION_SYNTHETIC:
$ops_json = enterprise_hook('modules_get_synthetic_operations',
array($id_agente_modulo));
$ops = json_decode($ops_json, true);
$first_op = explode('_', reset(array_keys($ops)));
//Erase the key of array serialize as <num>**
$chunks = explode('**', reset(array_keys($ops)));
$first_op = explode('_', $chunks[1]);
if (isset($first_op[1]) && $first_op[1] == 'avg') {
$is_synthetic_avg = true;
@ -59,7 +69,7 @@ if ($row !== false && is_array($row)) {
$custom_integer_1 = 0;
$custom_integer_2 = 0;
break;
case 4:
case MODULE_PREDICTION_NETFLOW:
$is_netflow = true;
$custom_integer_2 = 0;
break;
@ -189,9 +199,10 @@ if ($netflow_module_form !== ENTERPRISE_NOT_HOOK) {
}
/* Removed common useless parameter */
unset ($table_advanced->data[3]);
?>
<script type="text/javascript">
$(document).ready(function() {

View File

@ -253,6 +253,11 @@ define ('MODULE_PREDICTION', 5);
define ('MODULE_WMI', 6);
define ('MODULE_WEB', 7);
/* Type of Modules of Prediction */
define ('MODULE_PREDICTION_SERVICE', 2);
define ('MODULE_PREDICTION_SYNTHETIC', 3);
define ('MODULE_PREDICTION_NETFLOW', 4);
/* SNMP CONSTANTS */
define ('SNMP_DIR_MIBS', "attachment/mibs");

View File

@ -1632,7 +1632,7 @@ function html_print_image ($src, $return = false, $options = false, $return_src
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$skin_path = enterprise_hook('skins_get_image_path',array($src));
//html_debug_print($skin_path);
if ($skin_path)
$src = $skin_path;
}
@ -1709,7 +1709,8 @@ function html_print_image ($src, $return = false, $options = false, $return_src
$options['id'] = uniqid();
}
$params = array('id' => 'forced_title_' . $options['id'],
$params = array(
'id' => 'forced_title_' . $options['id'],
'class' => 'forced_title_layer',
'content' => $options["title"],
'hidden' => true);
@ -1724,7 +1725,8 @@ function html_print_image ($src, $return = false, $options = false, $return_src
foreach ($attrs as $attribute) {
if (isset ($options[$attribute])) {
$output .= $attribute.'="'.io_safe_input_html ($options[$attribute]).'" ';
$output .= $attribute . '="' .
io_safe_input_html ($options[$attribute]) . '" ';
}
}
}

View File

@ -113,7 +113,7 @@ function networkmap_generate_hash($pandora_name, $group = 0,
$graph = networkmap_generate_dot($pandora_name, $group,
$simple, $font_size, $layout, $nooverlap, $zoom, $ranksep,
$center, $regen, $pure, $id_networkmap, $show_snmp_modules,
$cut_names, $relative, $text_filter); html_debug_print($graph, true);
$cut_names, $relative, $text_filter);
$return = array();
if (!empty($graph)) {
@ -223,9 +223,6 @@ function networkmap_generate_hash($pandora_name, $group = 0,
$data['target'] = (int) $points[1];
$return['lines'][] = $data;
}
//html_debug_print($graph, true);
}
return $return;
@ -668,7 +665,7 @@ function networkmap_create_group_node ($group, $simple = 0, $font_size = 10, $me
// Set node icon
if ($hack_networkmap_mobile) {
$img_node = $config['homedir'] . "/images/groups_small/" . $icon . ".png";
html_debug_print($img_node, true);
if (!file_exists($img_node)) {
$img_node = '-';
}