diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index a44a821ef6..0ae45ec0fb 100644 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -495,6 +495,17 @@ $table->data[$row][1] = html_print_input_text ('custom_graph_widht', $row++; +$table->data[$row][0] = __('Render data of module type is proc.'); +$table->data[$row][1] = __('Yes') . ' ' . + html_print_radio_button ('render_proc', 1, '', + $config["render_proc"], true) . + '  '; +$table->data[$row][1] .= __('No') . ' ' . + html_print_radio_button ('render_proc', 0, '', + $config["render_proc"], true); + +$row++; + echo '
'; html_print_input_hidden ('update_config', 1); diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index c6379a45fe..4182c52a9e 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -901,8 +901,26 @@ if ($list_modules) { } else { if (is_numeric($module["datos"]) && !modules_is_string_type($module['id_tipo_modulo'])){ - $salida = format_numeric($module["datos"]); - + if ( $config["render_proc"] ){ + switch($module["id_tipo_modulo"]) { + case 2: + case 6: + case 9: + case 18: + case 21: + case 31: + if ($module["datos"]>=1) + $salida ='OK'; + else + $salida = 'FAIL'; + break; + default: + $salida = format_numeric($module["datos"]); + break; + } + }else{ + $salida = format_numeric($module["datos"]); + } // Show units ONLY in numeric data types if (isset($module["unit"])){ $salida .= " " . ''. io_safe_output($module["unit"]) . ''; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index f6a72a3514..a1413d7d0e 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -461,6 +461,8 @@ function config_update_config () { $error_update[] = __('Show the group name instead the group icon.'); if (!config_update_value ('custom_graph_widht', (int) get_parameter('custom_graph_widht', 1))) $error_update[] = __('Default line thickness for the Custom Graph.'); + if (!config_update_value ('render_proc', (int) get_parameter('render_proc', 0))) + $error_update[] = __('Render data of module type is proc.'); @@ -1254,6 +1256,9 @@ function config_process_config () { if (!isset($config['custom_graph_widht'])) { config_update_value ('custom_graph_widht', 1); } + if (!isset($config['render_proc'])) { + config_update_value ('render_proc', 0); + } if (!isset($config['command_snapshot'])) { config_update_value ('command_snapshot', 1); @@ -1364,6 +1369,7 @@ function config_check () { if (enterprise_installed()) { + if (!is_readable ($remote_config)) { set_pandora_error_for_header( __('Remote configuration directory is not readble for the console') . diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index edeab6bd64..9a04083b2d 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -1583,6 +1583,7 @@ function modules_get_next_data ($id_agent_module, $utimestamp = 0, $string = 0) */ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0, $trash=false, $conexion = false, $order = 'ASC') { + global $config; $module = db_get_row('tagente_modulo', 'id_agente_modulo', $id_agent_module); @@ -1619,6 +1620,28 @@ function modules_get_agentmodule_data ($id_agent_module, $period, ORDER BY utimestamp %s", $id_agent_module, $datelimit, $date, $order); break; + case 2: + case 6: + case 9: + case 18: + case 21: + case 31: + if ( $config["render_proc"] ) { + $sql = sprintf ("SELECT IF(datos >= 1, 'OK', 'FAIL') as data, utimestamp + FROM tagente_datos + WHERE id_agente_modulo = %d + AND utimestamp > %d AND utimestamp <= %d + ORDER BY utimestamp %s", + $id_agent_module, $datelimit, $date, $order); + }else{ + $sql = sprintf ("SELECT datos AS data, utimestamp + FROM tagente_datos + WHERE id_agente_modulo = %d + AND utimestamp > %d AND utimestamp <= %d + ORDER BY utimestamp %s", + $id_agent_module, $datelimit, $date, $order); + } + break; default: $sql = sprintf ("SELECT datos AS data, utimestamp FROM tagente_datos diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index d802fd2fd0..7dea12ba6b 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1239,7 +1239,27 @@ foreach ($result as $row) { $row['min_critical'], $row['str_critical']); if (is_numeric($row["datos"])) { - $salida = format_numeric($row["datos"]); + if ( $config["render_proc"] ){ + switch($row["module_type"]) { + case 2: + case 6: + case 9: + case 18: + case 21: + case 31: + + if ( $row["datos"] >= 1 ) + $salida ='OK'; + else + $salida = 'FAIL'; + break; + default: + $salida = format_numeric($row["datos"]); + break; + } + }else{ + $salida = format_numeric($row["datos"]); + } // Show units ONLY in numeric data types if (isset($row["unit"])) {