From 8780571a74085fa0a26cf90c7b269938311ec0d8 Mon Sep 17 00:00:00 2001
From: daniel <daniel.barbero@artica.es>
Date: Wed, 27 Feb 2019 10:59:44 +0100
Subject: [PATCH 01/15] add new functionality in event response

Former-commit-id: 2cf28b95c068c40e79b8f05b212aad0f720de79b
---
 pandora_console/include/ajax/events.php       |  96 +++++++++++++-
 .../include/javascript/pandora_events.js      |  82 ++++++++++--
 .../operation/events/events.build_table.php   | 119 ++++++++++++------
 pandora_console/operation/events/events.php   |   1 +
 4 files changed, 243 insertions(+), 55 deletions(-)

diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php
index 9d327bb540..0d7d3f5a9f 100644
--- a/pandora_console/include/ajax/events.php
+++ b/pandora_console/include/ajax/events.php
@@ -54,6 +54,7 @@ $table_events = get_parameter('table_events', 0);
 $total_events = (bool) get_parameter('total_events');
 $total_event_graph = (bool) get_parameter('total_event_graph');
 $graphic_event_group = (bool) get_parameter('graphic_event_group');
+$get_table_response_command = (bool) get_parameter('get_table_response_command');
 
 if ($get_event_name) {
     $event_id = get_parameter('event_id');
@@ -116,6 +117,7 @@ if ($get_response_target) {
     }
 
     echo events_get_response_target($event_id, $response_id, $server_id);
+
     return;
 }
 
@@ -129,6 +131,7 @@ if ($get_response) {
     }
 
     echo json_encode($event_response);
+
     return;
 }
 
@@ -136,6 +139,7 @@ if ($perform_event_response) {
     global $config;
 
     $command = get_parameter('target', '');
+
     $response_id = get_parameter('response_id');
 
     $event_response = db_get_row('tevent_response', 'id', $response_id);
@@ -148,7 +152,11 @@ if ($perform_event_response) {
                 'nano',
             ];
 
-            $server_data = db_get_row('tserver', 'id_server', $event_response['server_to_exec']);
+            $server_data = db_get_row(
+                'tserver',
+                'id_server',
+                $event_response['server_to_exec']
+            );
 
             if (in_array(strtolower($command), $commandExclusions)) {
                 echo 'Only stdin/stdout commands are supported';
@@ -234,13 +242,29 @@ if ($dialogue_event_response) {
                 );
                 echo '</div><br>';
 
-                echo "<div id='response_loading_command_".$out_iterator."' style='display:none'>".html_print_image('images/spinner.gif', true).'</div>';
+                echo "<div id='response_loading_command_".$out_iterator."' style='display:none'>";
+                echo html_print_image(
+                    'images/spinner.gif',
+                    true
+                );
+                echo '</div>';
                 echo "<br><div id='response_out_".$out_iterator."' style='text-align:left'></div>";
 
                 if ($end) {
                     echo "<br><div id='re_exec_command_".$out_iterator."' style='display:none;'>";
-                    html_print_button(__('Execute again'), 'btn_str', false, 'execute_event_response(false);', "class='sub next'");
-                    echo "<span id='execute_again_loading' style='display:none'>".html_print_image('images/spinner.gif', true).'</span>';
+                    html_print_button(
+                        __('Execute again'),
+                        'btn_str',
+                        false,
+                        'execute_event_response(false);',
+                        "class='sub next'"
+                    );
+                    echo "<span id='execute_again_loading' style='display:none'>";
+                    echo html_print_image(
+                        'images/spinner.gif',
+                        true
+                    );
+                    echo '</span>';
                     echo '</div>';
                 }
             } else {
@@ -796,3 +820,67 @@ if ($graphic_event_group) {
     echo $prueba;
     return;
 }
+
+if ($get_table_response_command) {
+    global $config;
+
+    $response_id = get_parameter('event_response_id');
+    $params_string = db_get_value(
+        'params',
+        'tevent_response',
+        'id',
+        $response_id
+    );
+
+    $params = explode(',', $params_string);
+
+    $table = new stdClass;
+    $table->id = 'events_responses_table_command';
+    $table->width = '90%';
+    $table->styleTable = 'text-align:center; margin: 0 auto;';
+
+    $table->style = [];
+    $table->style[0] = 'text-align:center;';
+    $table->style[1] = 'text-align:center;';
+
+    $table->head = [];
+    $table->head[0] = __('Commands');
+    $table->head[0] .= ui_print_help_tip(
+        __('These commands will apply to all selected events'),
+        true
+    );
+    $table->head[1] = __('Value');
+
+    if (isset($params) === true
+        && is_array($params) === true
+    ) {
+        foreach ($params as $key => $value) {
+            $table->data[$key][0] = $value;
+            $table->data[$key][1] = html_print_input_text(
+                $value.'-'.$key,
+                '',
+                '',
+                50,
+                255,
+                true,
+                false,
+                false,
+                '',
+                'response_command_input'
+            );
+        }
+    }
+
+    echo '<form id="form_response_command">';
+    echo html_print_table($table, true);
+    echo '</form>';
+    echo html_print_submit_button(
+        __('Execute'),
+        'enter_command',
+        false,
+        'class="sub next" style="float:right; margin-top:15px; margin-right:25px;"',
+        true
+    );
+
+    return;
+}
diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js
index 8fbef6b03d..42d67fffd6 100644
--- a/pandora_console/include/javascript/pandora_events.js
+++ b/pandora_console/include/javascript/pandora_events.js
@@ -241,6 +241,7 @@ function show_massive_response_dialog(
           },
           close: function(event, ui) {
             $(".chk_val").prop("checked", false);
+            $("#event_response_command_window").dialog("close");
           },
           width: response["modal_width"],
           height: response["modal_height"]
@@ -375,7 +376,12 @@ function add_row_param(id_table, param) {
 }
 
 // Get an event response from db
-function get_response_target(event_id, response_id, server_id) {
+function get_response_target(
+  event_id,
+  response_id,
+  server_id,
+  response_command
+) {
   var ajax_file = $("#hidden-ajax_file").val();
 
   var target = "";
@@ -400,15 +406,21 @@ function get_response_target(event_id, response_id, server_id) {
     }
   });
 
-  // Replace the custom params macros
+  // Replace the custom params macros.
   var response_params = get_response_params(response_id);
-
   if (response_params.length > 1 || response_params[0] != "") {
     for (i = 0; i < response_params.length; i++) {
-      target = target.replace(
-        "_" + response_params[i] + "_",
-        $("#" + response_params[i]).val()
-      );
+      if (!response_command) {
+        target = target.replace(
+          "_" + response_params[i] + "_",
+          $("#" + response_params[i]).val()
+        );
+      } else {
+        target = target.replace(
+          "_" + response_params[i] + "_",
+          response_command[response_params[i] + "-" + i]
+        );
+      }
     }
   }
 
@@ -459,10 +471,6 @@ function perform_response_massive(target, response_id, out_iterator) {
   $("#response_loading_command_" + out_iterator).show();
   $("#response_out_" + out_iterator).html("");
 
-  var finished = 0;
-  var time = Math.round(+new Date() / 1000);
-  var timeout = time + 10;
-
   var params = [];
   params.push("page=include/ajax/events");
   params.push("perform_event_response=1");
@@ -487,7 +495,7 @@ function perform_response_massive(target, response_id, out_iterator) {
   return false;
 }
 
-// Change the status of an event to new, in process or validated
+// Change the status of an event to new, in process or validated.
 function event_change_status(event_ids) {
   var ajax_file = $("#hidden-ajax_file").val();
 
@@ -681,3 +689,53 @@ function show_events_group_agent(id_insert, id_agent, server_id) {
     }
   });
 }
+
+function show_event_response_command_dialog(id, response, total_checked) {
+  var ajax_file = $("#hidden-ajax_file").val();
+
+  var params = [];
+  params.push("page=include/ajax/events");
+  params.push("get_table_response_command=1");
+  params.push("event_response_id=" + id);
+
+  jQuery.ajax({
+    data: params.join("&"),
+    type: "POST",
+    url: (action = ajax_file),
+    dataType: "html",
+    success: function(data) {
+      $("#event_response_command_window")
+        .hide()
+        .empty()
+        .append(data)
+        .dialog({
+          resizable: true,
+          draggable: true,
+          modal: false,
+          open: function() {
+            $("#response_loading_dialog").hide();
+            $("#button-submit_event_response").show();
+          },
+          width: 600,
+          height: 300
+        })
+        .show();
+
+      $("#submit-enter_command").on("click", function(e) {
+        e.preventDefault();
+        var response_command = [];
+
+        $(".response_command_input").each(function() {
+          response_command[$(this).attr("name")] = $(this).val();
+        });
+
+        check_massive_response_event(
+          id,
+          response,
+          total_checked,
+          response_command
+        );
+      });
+    }
+  });
+}
diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php
index a9e319c82a..d38bd1918e 100644
--- a/pandora_console/operation/events/events.build_table.php
+++ b/pandora_console/operation/events/events.build_table.php
@@ -988,6 +988,10 @@ if ($group_rep == 2) {
                     'A maximum of %s event custom responses can be selected',
                     $config['max_execution_event_response']
                 ).'</span>';
+                echo '<span id="max_custom_selected" style="display:none; color:#FC4444; line-height: 200%;">';
+                echo __(
+                    'Please, select an event'
+                ).'</span>';
                 echo '</div>';
             }
         }
@@ -995,12 +999,14 @@ if ($group_rep == 2) {
         ?>
             <script type="text/javascript">
 
-                function execute_event_response(event_list_btn) { 
+                function execute_event_response(event_list_btn) {
 
                     $('#max_custom_event_resp_msg').hide();
+                    $('#max_custom_selected').hide();
 
                     var response_id = $('select[name=response_id]').val();
 
+
                     if (!isNaN(response_id)) { // It is a custom response
 
                         var response = get_response(response_id);
@@ -1015,59 +1021,58 @@ if ($group_rep == 2) {
 
                         var total_checked = $(".chk_val:checked").length;
 
-                        // Limit number of events to apply custom responses to for performance reasons
+                        // Check select an event.
+                        if(total_checked == 0){
+                            $('#max_custom_selected').show();
+                            return;
+                        }
+
+                        // Limit number of events to apply custom responses
+                        // to for performance reasons.
                         if (total_checked > <?php echo $config['max_execution_event_response']; ?> ) {
                             $('#max_custom_event_resp_msg').show();
                             return;
                         }
 
+                        var response_command = [];
+                        $(".response_command_input").each(function() {
+                            response_command[$(this).attr("name")] = $(this).val();
+                        });
+
                         if (event_list_btn) {
                             $('#button-submit_event_response').hide(function() {
                                 $('#response_loading_dialog').show(function() {
+                                    var check_params = get_response_params(
+                                        response_id
+                                    );
 
-                                    $(".chk_val").each(function() {
-                                        if ($(this).is(":checked")) {
-                                            event_id = $(this).val();
-                                            server_id = $('#hidden-server_id_'+event_id).val();
-                                            response['target'] = get_response_target(
-                                                event_id,
-                                                response_id,
-                                                server_id
-                                            );
-                                            if (total_checked-1 === counter) end=1;
-                                            show_massive_response_dialog(
-                                                event_id,
-                                                response_id,
-                                                response,
-                                                counter,
-                                                end
-                                            );
-                                            counter++;
-                                        }
-                                    });
+                                    if(check_params[0] !== ''){
+                                        show_event_response_command_dialog(
+                                            response_id,
+                                            response,
+                                            total_checked
+                                        );
+                                    }
+                                    else{
+                                        check_massive_response_event(
+                                            response_id,
+                                            response,
+                                            total_checked,
+                                            response_command
+                                        );
+                                    }
                                 });
                             });
                         }
                         else {
                             $('#button-btn_str').hide(function() {
                                 $('#execute_again_loading').show(function() {
-
-                                    $(".chk_val").each(function() {
-                                        
-                                        if ($(this).is(":checked")) {
-                                            //var server_id = $('#hidden-server_id_'+).
-                                            event_id = $(this).val();
-                                            server_id = $('#hidden-server_id_'+event_id).val();
-
-                                            response['target'] = get_response_target(event_id, response_id, server_id);
-
-                                            if (total_checked-1 === counter) end=1;
-
-                                            show_massive_response_dialog(event_id, response_id, response, counter, end);
-
-                                            counter++;
-                                        }
-                                    });
+                                    check_massive_response_event(
+                                        response_id,
+                                        response,
+                                        total_checked,
+                                        response_command
+                                    );
                                 });
                             });
                         }
@@ -1087,6 +1092,42 @@ if ($group_rep == 2) {
                         }
                     }
                 }
+
+                function check_massive_response_event(
+                    response_id,
+                    response,
+                    total_checked,
+                    response_command
+                ){
+                    var counter=0;
+                    var end=0;
+
+                    $(".chk_val").each(function() {
+                        if ($(this).is(":checked")) {
+                            event_id = $(this).val();
+                            server_id = $('#hidden-server_id_'+event_id).val();
+                            response['target'] = get_response_target(
+                                event_id,
+                                response_id,
+                                server_id,
+                                response_command
+                            );
+
+                            if (total_checked-1 === counter)
+                                end=1;
+
+                            show_massive_response_dialog(
+                                event_id,
+                                response_id,
+                                response,
+                                counter,
+                                end
+                            );
+
+                            counter++;
+                        }
+                    });
+                }
             </script>
         <?php
     } else {
diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php
index 18e1e77ffc..f84e92571e 100644
--- a/pandora_console/operation/events/events.php
+++ b/pandora_console/operation/events/events.php
@@ -611,6 +611,7 @@ if ($delete) {
 
 echo "<div id='event_details_window'></div>";
 echo "<div id='event_response_window'></div>";
+echo "<div id='event_response_command_window' title='".__('Command')."'></div>";
 
 ui_require_jquery_file('bgiframe');
 ui_require_javascript_file('pandora_events');

From cefaccb6511f59b1c7d46d24911811f8a0c338a1 Mon Sep 17 00:00:00 2001
From: Daniel Maya <daniel.maya@artica.es>
Date: Thu, 28 Feb 2019 13:02:59 +0100
Subject: [PATCH 02/15] Fixed synchronize collections in node

Former-commit-id: d48015ff7c41298fa87cbb5cf1f298beac501719
---
 pandora_console/include/functions_filemanager.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php
index fa51e3ad12..a249760f4c 100644
--- a/pandora_console/include/functions_filemanager.php
+++ b/pandora_console/include/functions_filemanager.php
@@ -127,7 +127,7 @@ if (isset($config['homedir_filemanager'])) {
 }
 
 $sec2 = get_parameter('sec2');
-if ($sec2 == 'enterprise/godmode/agentes/collections') {
+if ($sec2 == 'enterprise/godmode/agentes/collections' || $sec2 == 'advanced/collections') {
     $homedir_filemanager .= '/attachment/collection/';
 }
 

From 02ff69ea0bf8c767fba502bda0f2631960b95615 Mon Sep 17 00:00:00 2001
From: daniel <daniel.barbero@artica.es>
Date: Fri, 1 Mar 2019 12:34:34 +0100
Subject: [PATCH 03/15] fixed errors SLA With planned downtime

Former-commit-id: 7350d33d917f967ea624e4763ed816af97c0743a
---
 .../include/functions_reporting.php           | 564 +++++++++++-------
 1 file changed, 360 insertions(+), 204 deletions(-)

diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index 1581119772..e0b719006e 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -822,7 +822,7 @@ function reporting_SLA(
     $return['description'] = $content['description'];
     $return['date'] = reporting_get_date_text($report, $content);
 
-    // Get chart
+    // Get chart.
     reporting_set_conf_charts(
         $width,
         $height,
@@ -883,7 +883,7 @@ function reporting_SLA(
 
         foreach ($slas as $sla) {
             $server_name = $sla['server_name'];
-            // Metaconsole connection
+            // Metaconsole connection.
             if ($metaconsole_on && $server_name != '') {
                 $connection = metaconsole_get_connection($server_name);
                 if (!metaconsole_load_external_db($connection)) {
@@ -902,7 +902,7 @@ function reporting_SLA(
                 continue;
             }
 
-            // controller min and max == 0 then dinamic min and max critical
+            // Controller min and max == 0 then dinamic min and max critical.
             $dinamic_text = 0;
             if ($sla['sla_min'] == 0 && $sla['sla_max'] == 0) {
                 $sla['sla_min'] = null;
@@ -910,7 +910,7 @@ function reporting_SLA(
                 $dinamic_text = __('Dynamic');
             }
 
-            // controller inverse interval
+            // Controller inverse interval.
             $inverse_interval = 0;
             if ((isset($sla['sla_max'])) && (isset($sla['sla_min']))) {
                 if ($sla['sla_max'] < $sla['sla_min']) {
@@ -922,26 +922,25 @@ function reporting_SLA(
                 }
             }
 
-            // for graph slice for module-interval, if not slice=0;
+            // For graph slice for module-interval, if not slice=0.
             if ($show_graphs) {
-                $module_interval = modules_get_interval($sla['id_agent_module']);
+                $module_interval = modules_get_interval(
+                    $sla['id_agent_module']
+                );
                 $slice = ($content['period'] / $module_interval);
             } else {
                 $slice = 1;
             }
 
-            // call functions sla
+            // Call functions sla.
             $sla_array = [];
             $sla_array = reporting_advanced_sla(
                 $sla['id_agent_module'],
                 ($report['datetime'] - $content['period']),
                 $report['datetime'],
                 $sla['sla_min'],
-                // min_value -> dynamic
                 $sla['sla_max'],
-                // max_value -> dynamic
                 $inverse_interval,
-                // inverse_interval -> dynamic
                 [
                     '1' => $content['sunday'],
                     '2' => $content['monday'],
@@ -957,12 +956,12 @@ function reporting_SLA(
             );
 
             if ($metaconsole_on) {
-                // Restore db connection
+                // Restore db connection.
                 metaconsole_restore_db();
             }
 
             $server_name = $sla['server_name'];
-            // Metaconsole connection
+            // Metaconsole connection.
             if ($metaconsole_on && $server_name != '') {
                 $connection = metaconsole_get_connection($server_name);
                 if (metaconsole_connect($connection) != NOERR) {
@@ -971,10 +970,16 @@ function reporting_SLA(
             }
 
             if ($show_graphs) {
-                $planned_downtimes = reporting_get_planned_downtimes_intervals($sla['id_agent_module'], ($report['datetime'] - $content['period']), $report['datetime']);
+                $planned_downtimes = reporting_get_planned_downtimes_intervals(
+                    $sla['id_agent_module'],
+                    ($report['datetime'] - $content['period']),
+                    $report['datetime']
+                );
 
-                if ((is_array($planned_downtimes)) && (count($planned_downtimes) > 0)) {
-                    // Sort retrieved planned downtimes
+                if ((is_array($planned_downtimes))
+                    && (count($planned_downtimes) > 0)
+                ) {
+                    // Sort retrieved planned downtimes.
                     usort(
                         $planned_downtimes,
                         function ($a, $b) {
@@ -984,16 +989,16 @@ function reporting_SLA(
                                 return 0;
                             }
 
-                            return ($a < $b) ? -1 : 1;
+                            return ($a < $b) ? (-1) : 1;
                         }
                     );
 
-                    // Compress (overlapped) planned downtimes
+                    // Compress (overlapped) planned downtimes.
                     $npd = count($planned_downtimes);
                     for ($i = 0; $i < $npd; $i++) {
                         if (isset($planned_downtimes[($i + 1)])) {
                             if ($planned_downtimes[$i]['date_to'] >= $planned_downtimes[($i + 1)]['date_from']) {
-                                // merge
+                                // Merge.
                                 $planned_downtimes[$i]['date_to'] = $planned_downtimes[($i + 1)]['date_to'];
                                 array_splice($planned_downtimes, ($i + 1), 1);
                                 $npd--;
@@ -1006,8 +1011,17 @@ function reporting_SLA(
             }
 
             $data = [];
-            $data['agent']        = io_safe_output(modules_get_agentmodule_agent_alias($sla['id_agent_module']));
-            $data['module']       = io_safe_output(modules_get_agentmodule_name($sla['id_agent_module']));
+            $data['agent'] = io_safe_output(
+                modules_get_agentmodule_agent_alias(
+                    $sla['id_agent_module']
+                )
+            );
+            $data['module'] = io_safe_output(
+                modules_get_agentmodule_name(
+                    $sla['id_agent_module']
+                )
+            );
+
             $data['max']          = $sla['sla_max'];
             $data['min']          = $sla['sla_min'];
             $data['sla_limit']    = $sla['sla_limit'];
@@ -1041,16 +1055,17 @@ function reporting_SLA(
                     $data['checks_unknown']  += $value_sla['checks_unknown'];
                     $data['checks_not_init'] += $value_sla['checks_not_init'];
 
-                    // generate raw data for graph
+                    // Generate raw data for graph.
                     if ($value_sla['time_total'] != 0) {
                         if ($value_sla['time_error'] > 0) {
-                            // ERR
+                            // ERR.
                             $raw_graph[$i]['data'] = 3;
                         } else if ($value_sla['time_unknown'] > 0) {
-                            // UNKNOWN
+                            // UNKNOWN.
                             $raw_graph[$i]['data'] = 4;
-                        } else if ($value_sla['time_not_init'] == $value_sla['time_total']) {
-                            // NOT INIT
+                        } else if ($value_sla['time_not_init'] == $value_sla['time_total']
+                        ) {
+                            // NOT INIT.
                             $raw_graph[$i]['data'] = 6;
                         } else {
                             $raw_graph[$i]['data'] = 1;
@@ -1059,7 +1074,8 @@ function reporting_SLA(
                         $raw_graph[$i]['data'] = 7;
                     }
 
-                    $raw_graph[$i]['utimestamp'] = ($value_sla['date_to'] - $value_sla['date_from']);
+                    $raw_graph[$i]['utimestamp'] = (
+                        $value_sla['date_to'] - $value_sla['date_from']);
 
                     if (isset($planned_downtimes)) {
                         foreach ($planned_downtimes as $pd) {
@@ -1067,7 +1083,7 @@ function reporting_SLA(
                                 && ($value_sla['date_to'] <= $pd['date_to'])
                             ) {
                                 $raw_graph[$i]['data'] = 5;
-                                // in scheduled downtime
+                                // In scheduled downtime.
                                 break;
                             }
                         }
@@ -1076,10 +1092,15 @@ function reporting_SLA(
                     $i++;
                 }
 
-                $data['sla_value'] = reporting_sla_get_compliance_from_array($data);
-                $data['sla_fixed'] = sla_truncate($data['sla_value'], $config['graph_precision']);
+                $data['sla_value'] = reporting_sla_get_compliance_from_array(
+                    $data
+                );
+                $data['sla_fixed'] = sla_truncate(
+                    $data['sla_value'],
+                    $config['graph_precision']
+                );
             } else {
-                // Show only table not divider in slice for defect slice=1
+                // Show only table not divider in slice for defect slice=1.
                 $data['time_total']      = $sla_array['time_total'];
                 $data['time_ok']         = $sla_array['time_ok'];
                 $data['time_error']      = $sla_array['time_error'];
@@ -1095,7 +1116,7 @@ function reporting_SLA(
                 $data['sla_fixed']       = $sla_array['sla_fixed'];
             }
 
-            // checks whether or not it meets the SLA
+            // Checks whether or not it meets the SLA.
             if ($data['sla_value'] >= $sla['sla_limit']) {
                 $data['sla_status'] = 1;
                 $sla_failed = false;
@@ -1104,19 +1125,19 @@ function reporting_SLA(
                 $data['sla_status'] = 0;
             }
 
-            // Do not show right modules if 'only_display_wrong' is active
+            // Do not show right modules if 'only_display_wrong' is active.
             if ($content['only_display_wrong'] && $sla_failed == false) {
                 continue;
             }
 
-            // find order
+            // Find order.
             $data['order'] = $data['sla_value'];
 
             if ($show_table) {
                 $return['data'][] = $data;
             }
 
-            // Slice graphs calculation
+            // Slice graphs calculation.
             if ($show_graphs) {
                 $data_init = -1;
                 $acum = 0;
@@ -1149,8 +1170,16 @@ function reporting_SLA(
                 $array_result[$i]['real_data'] = $sum;
 
                 $dataslice = [];
-                $dataslice['agent'] = io_safe_output(modules_get_agentmodule_agent_alias($sla['id_agent_module']));
-                $dataslice['module'] = io_safe_output(modules_get_agentmodule_name($sla['id_agent_module']));
+                $dataslice['agent'] = io_safe_output(
+                    modules_get_agentmodule_agent_alias(
+                        $sla['id_agent_module']
+                    )
+                );
+                $dataslice['module'] = io_safe_output(
+                    modules_get_agentmodule_name(
+                        $sla['id_agent_module']
+                    )
+                );
                 $dataslice['sla_value'] = $data['sla_value'];
                 $dataslice['order'] = $data['sla_value'];
 
@@ -1175,24 +1204,24 @@ function reporting_SLA(
             }
 
             if ($metaconsole_on) {
-                // Restore db connection
+                // Restore db connection.
                 metaconsole_restore_db();
             }
         }
 
         if ($content['top_n'] == 2) {
-            // SLA items sorted descending ()
+            // SLA items sorted descending.
             arsort($return['data']['']);
         } else if ($content['top_n'] == 1) {
-            // SLA items sorted ascending
+            // SLA items sorted ascending.
             asort($sla_showed_values);
         }
 
-        // order data for ascending or descending
+        // Order data for ascending or descending.
         if ($content['top_n'] != 0) {
             switch ($content['top_n']) {
                 case 1:
-                    // order tables
+                    // Order tables.
                     $temp = [];
                     foreach ($return['data'] as $row) {
                         $i = 0;
@@ -1209,7 +1238,7 @@ function reporting_SLA(
 
                     $return['data'] = $temp;
 
-                    // order graphs
+                    // Order graphs.
                     $temp = [];
                     foreach ($return['charts'] as $row) {
                         $i = 0;
@@ -1229,7 +1258,7 @@ function reporting_SLA(
                 break;
 
                 case 2:
-                    // order tables
+                    // Order tables.
                     $temp = [];
                     foreach ($return['data'] as $row) {
                         $i = 0;
@@ -1246,7 +1275,7 @@ function reporting_SLA(
 
                     $return['data'] = $temp;
 
-                    // order graph
+                    // Order graph.
                     $temp = [];
                     foreach ($return['charts'] as $row) {
                         $i = 0;
@@ -4877,7 +4906,9 @@ function reporting_sql($report, $content)
     $return['date'] = reporting_get_date_text();
 
     if ($config['metaconsole']) {
-        $id_meta = metaconsole_get_id_server($content['server_name']);
+        $id_meta = metaconsole_get_id_server(
+            $content['server_name']
+        );
 
         $server = metaconsole_get_connection_by_id($id_meta);
         metaconsole_connect($server);
@@ -4886,22 +4917,40 @@ function reporting_sql($report, $content)
     if ($content['treport_custom_sql_id'] != 0) {
         switch ($config['dbtype']) {
             case 'mysql':
-                $sql = io_safe_output(db_get_value_filter('`sql`', 'treport_custom_sql', ['id' => $content['treport_custom_sql_id']]));
+                $sql = io_safe_output(
+                    db_get_value_filter(
+                        '`sql`',
+                        'treport_custom_sql',
+                        ['id' => $content['treport_custom_sql_id']]
+                    )
+                );
             break;
 
             case 'postgresql':
-                $sql = io_safe_output(db_get_value_filter('"sql"', 'treport_custom_sql', ['id' => $content['treport_custom_sql_id']]));
+                $sql = io_safe_output(
+                    db_get_value_filter(
+                        '"sql"',
+                        'treport_custom_sql',
+                        ['id' => $content['treport_custom_sql_id']]
+                    )
+                );
             break;
 
             case 'oracle':
-                $sql = io_safe_output(db_get_value_filter('sql', 'treport_custom_sql', ['id' => $content['treport_custom_sql_id']]));
+                $sql = io_safe_output(
+                    db_get_value_filter(
+                        'sql',
+                        'treport_custom_sql',
+                        ['id' => $content['treport_custom_sql_id']]
+                    )
+                );
             break;
         }
     } else {
         $sql = io_safe_output($content['external_source']);
     }
 
-    // Do a security check on SQL coming from the user
+    // Do a security check on SQL coming from the user.
     $sql = check_sql($sql);
 
     $return['sql'] = $sql;
@@ -4916,7 +4965,9 @@ function reporting_sql($report, $content)
         }
 
         if ($content['id_rc'] != null) {
-            $historical_db = db_get_value_sql('SELECT historical_db from treport_content where id_rc ='.$content['id_rc']);
+            $historical_db = db_get_value_sql(
+                'SELECT historical_db from treport_content where id_rc ='.$content['id_rc']
+            );
         } else {
             $historical_db = $content['historical_db'];
         }
@@ -4971,11 +5022,16 @@ function sla_truncate($num, $accurancy=2)
 }
 
 
-//
-// Aux: check value limits
-//
-// Returns if the data is in a valid range or not
-//
+/**
+ * SLA check value.
+ *
+ * @param integer $value            Value.
+ * @param integer $min              Treshold min SLA.
+ * @param boolean $max              Treshold max SLA.
+ * @param boolean $inverse_interval Treshold inverse SLA.
+ *
+ * @return boolean Returns the interval in downtime (false if no matches).
+ */
 function sla_check_value($value, $min, $max, $inverse_interval=0)
 {
     if (!isset($inverse_interval)) {
@@ -4983,12 +5039,12 @@ function sla_check_value($value, $min, $max, $inverse_interval=0)
     }
 
     if ((!isset($max)) && (!isset($min))) {
-        // disabled thresholds
+        // Disabled thresholds.
         return true;
     }
 
     if ($max == $min) {
-        // equal
+        // Equal.
         if ($value == $max) {
             return ($inverse_interval == 0) ? true : false;
         }
@@ -4997,7 +5053,7 @@ function sla_check_value($value, $min, $max, $inverse_interval=0)
     }
 
     if (!isset($max)) {
-        // greater or equal than min
+        // Greater or equal than min.
         if ($value >= $min) {
             return ($inverse_interval == 0) ? true : false;
         }
@@ -5006,7 +5062,7 @@ function sla_check_value($value, $min, $max, $inverse_interval=0)
     }
 
     if (!isset($min)) {
-        // smaller or equal than max
+        // Smaller or equal than max.
         if ($value <= $max) {
             return ($inverse_interval == 0) ? true : false;
         }
@@ -5023,20 +5079,25 @@ function sla_check_value($value, $min, $max, $inverse_interval=0)
 
 
 /**
- * SLA downtime worktime
+ * SLA downtime worktime.
  *
- * Check (if needed) if the range specified by wt_start and wt_end is downtime
+ * Check (if needed) if the range specified by wt_start and wt_end is downtime.
  *
- * Only used for inclusive downtimes calculation (from sla_fixed_worktime)
+ * Only used for inclusive downtimes calculation (from sla_fixed_worktime).
  *
- * @param integer $wt_start          start of the range
- * @param integer $wt_end            end of the range
- * @param hash    $planned_downtimes array with the planned downtimes (ordered and merged)
+ * @param integer $wt_start            Start of the range.
+ * @param integer $wt_end              End of the range.
+ * @param boolean $inclusive_downtimes Boolean.
+ * @param array   $planned_downtimes   Array with the planned downtimes (ordered and merged).
  *
- * @return integer                       returns the interval in downtime (false if no matches)
+ * @return integer                     Returns the interval in downtime (false if no matches).
  */
-function sla_downtime_worktime($wt_start, $wt_end, $inclusive_downtimes=1, $planned_downtimes=null)
-{
+function sla_downtime_worktime(
+    $wt_start,
+    $wt_end,
+    $inclusive_downtimes=1,
+    $planned_downtimes=null
+) {
     if ((!isset($planned_downtimes)) || (!is_array($planned_downtimes))) {
         return false;
     }
@@ -5050,6 +5111,7 @@ function sla_downtime_worktime($wt_start, $wt_end, $inclusive_downtimes=1, $plan
     }
 
     $rt = false;
+
     foreach ($planned_downtimes as $pd) {
         if (($wt_start >= $pd['date_from'])
             && ($wt_start <= $pd['date_to'])
@@ -5071,7 +5133,7 @@ function sla_downtime_worktime($wt_start, $wt_end, $inclusive_downtimes=1, $plan
             && ($wt_end > $pd['date_to'])
         ) {
             // ..[..start..]..end..
-            $rt = ($wt_end - $pd['date_to']);
+            $rt = ($pd['date_to'] - $wt_start);
             break;
         } else if (($wt_start >= $pd['date_to'])
             && ($wt_end >= $pd['date_to'])
@@ -5095,29 +5157,44 @@ function sla_downtime_worktime($wt_start, $wt_end, $inclusive_downtimes=1, $plan
  * As worktime is order (older ... newer) the idx works as flag to identify
  * last range checked, in order to improve the algorythm performance.
  *
- * @param integer $wt_start            start of the range
- * @param integer $wt_end              end of the range
- * @param hash    $worktime            hash containing the valid intervals
- * @param hash    $planned_downtimes   array with the planned downtimes (ordered and merged)
- * @param integer $inclusive_downtimes In downtime as OK (1) or ignored (0)
- * @param integer $idx                 last ranges checked
+ * @param integer $wt_start            Start of the range.
+ * @param integer $wt_end              End of the range.
+ * @param array   $worktime            Hash containing the valid intervals.
+ * @param array   $planned_downtimes   Array with the planned downtimes (ordered and merged).
+ * @param integer $inclusive_downtimes In downtime as OK (1) or ignored (0).
+ * @param integer $idx                 Last ranges checked.
+ *
+ * @return array
  */
-function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtimes=null, $inclusive_downtimes=1, $idx=0)
-{
+function sla_fixed_worktime(
+    $wt_start,
+    $wt_end,
+    $worktime=null,
+    $planned_downtimes=null,
+    $inclusive_downtimes=1,
+    $idx=0
+) {
     $return = [];
 
-    // Accept all ranges by default
+    // Accept all ranges by default.
     $return['wt_valid'] = 1;
     $return['interval'] = ($wt_end - $wt_start);
 
-    if ((!isset($wt_start)) || (!isset($wt_end)) || ($wt_start > $wt_end) || ($wt_start > time())) {
+    if ((!isset($wt_start)) || (!isset($wt_end))
+        || ($wt_start > $wt_end) || ($wt_start > time())
+    ) {
         $return['wt_valid'] = 0;
         $return['interval'] = 0;
     }
 
-    // No exclusions defined, entire worktime is valid
+    // No exclusions defined, entire worktime is valid.
     if ((!isset($worktime) || (!is_array($worktime)))) {
-        $time_in_downtime = sla_downtime_worktime($wt_start, $wt_end, $inclusive_downtimes, $planned_downtimes);
+        $time_in_downtime = sla_downtime_worktime(
+            $wt_start,
+            $wt_end,
+            $inclusive_downtimes,
+            $planned_downtimes
+        );
         if ($time_in_downtime != false) {
             $return['wt_in_downtime']    = 1;
             $return['downtime_interval'] = $time_in_downtime;
@@ -5127,7 +5204,7 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
         return $return;
     }
 
-    // Check exceptions
+    // Check exceptions.
     $total = count($worktime);
 
     $return['idx'] = $idx;
@@ -5141,10 +5218,15 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
         $wt = $worktime[$i];
 
         if ($start_fixed == 1) {
-            // Intervals greater than 1 DAY
+            // Intervals greater than 1 DAY.
             if ($wt_end < $wt['date_from']) {
                 // Case G: ..end..[..]..
-                $time_in_downtime = sla_downtime_worktime($wt_start, $wt_end, $inclusive_downtimes, $planned_downtimes);
+                $time_in_downtime = sla_downtime_worktime(
+                    $wt_start,
+                    $wt_end,
+                    $inclusive_downtimes,
+                    $planned_downtimes
+                );
                 if ($time_in_downtime != false) {
                     $return['wt_in_downtime']    = 1;
                     $return['downtime_interval'] = $time_in_downtime;
@@ -5160,9 +5242,14 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
                 && ($wt_end <= $wt['date_to'])
             ) {
                 // Case H: ..[..end..]..
-                // add last slice
+                // add last slice.
                 $return['interval'] += ($wt_end - $wt['date_from']);
-                $time_in_downtime = sla_downtime_worktime($wt['date_from'], $wt_end, $inclusive_downtimes, $planned_downtimes);
+                $time_in_downtime = sla_downtime_worktime(
+                    $wt['date_from'],
+                    $wt_end,
+                    $inclusive_downtimes,
+                    $planned_downtimes
+                );
                 if ($time_in_downtime != false) {
                     $return['wt_in_downtime']    = 1;
                     $return['downtime_interval'] = $time_in_downtime;
@@ -5176,9 +5263,14 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
                 && ($wt_end > $wt['date_to'])
             ) {
                 // Case H: ..[..]..end..
-                // Add current slice and continue checking
+                // Add current slice and continue checking.
                 $return['interval'] += ($wt['date_to'] - $wt['date_from']);
-                $time_in_downtime = sla_downtime_worktime($wt['date_from'], $wt['date_to'], $inclusive_downtimes, $planned_downtimes);
+                $time_in_downtime = sla_downtime_worktime(
+                    $wt['date_from'],
+                    $wt['date_to'],
+                    $inclusive_downtimes,
+                    $planned_downtimes
+                );
                 if ($time_in_downtime != false) {
                     $return['wt_in_downtime']    = 1;
                     $return['downtime_interval'] = $time_in_downtime;
@@ -5202,7 +5294,12 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
                 // Case B: ...start..[..end..]......
                 $return['wt_valid'] = 1;
                 $return['interval'] = ($wt_end - $wt['date_from']);
-                $time_in_downtime = sla_downtime_worktime($wt['date_from'], $wt_end, $inclusive_downtimes, $planned_downtimes);
+                $time_in_downtime = sla_downtime_worktime(
+                    $wt['date_from'],
+                    $wt_end,
+                    $inclusive_downtimes,
+                    $planned_downtimes
+                );
                 if ($time_in_downtime != false) {
                     $return['wt_in_downtime']    = 1;
                     $return['downtime_interval'] = $time_in_downtime;
@@ -5219,7 +5316,12 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
             ) {
                 // Case C: ...[..start..end..]......
                 $return['wt_valid'] = 1;
-                $time_in_downtime = sla_downtime_worktime($wt_start, $wt_end, $inclusive_downtimes, $planned_downtimes);
+                $time_in_downtime = sla_downtime_worktime(
+                    $wt_start,
+                    $wt_end,
+                    $inclusive_downtimes,
+                    $planned_downtimes
+                );
                 if ($time_in_downtime != false) {
                     $return['wt_in_downtime']    = 1;
                     $return['downtime_interval'] = $time_in_downtime;
@@ -5235,7 +5337,12 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
             ) {
                 // Case D: ...[..start..]...end.....
                 $return['interval'] = ($wt['date_to'] - $wt_start);
-                $time_in_downtime = sla_downtime_worktime($wt_start, $wt['date_to'], $inclusive_downtimes, $planned_downtimes);
+                $time_in_downtime = sla_downtime_worktime(
+                    $wt_start,
+                    $wt['date_to'],
+                    $inclusive_downtimes,
+                    $planned_downtimes
+                );
                 if ($time_in_downtime != false) {
                     $return['wt_in_downtime']    = 1;
                     $return['downtime_interval'] = $time_in_downtime;
@@ -5244,10 +5351,11 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
 
                 $return['wt_valid'] = 1;
                 $start_fixed = 1;
-                // we must check if 'end' is greater than the next valid worktime range start time
-                // unless is the last one
+                // We must check if 'end' is greater than the next valid
+                // worktime range start time unless is the last one.
                 if (($i + 1) == $total) {
-                    // if there's no more worktime ranges to check return the accumulated
+                    // If there's no more worktime ranges
+                    // to check return the accumulated.
                     return $return;
                 }
             }
@@ -5258,7 +5366,12 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
                 // Case E: ...start...[...]...end...
                 $return['wt_valid'] = 1;
                 $return['interval'] = ($wt['date_to'] - $wt['date_from']);
-                $time_in_downtime = sla_downtime_worktime($wt['date_from'], $wt['date_to'], $inclusive_downtimes, $planned_downtimes);
+                $time_in_downtime = sla_downtime_worktime(
+                    $wt['date_from'],
+                    $wt['date_to'],
+                    $inclusive_downtimes,
+                    $planned_downtimes
+                );
                 if ($time_in_downtime != false) {
                     $return['wt_in_downtime']    = 1;
                     $return['downtime_interval'] = $time_in_downtime;
@@ -5266,10 +5379,10 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
                 }
 
                 if (($wt_end - $wt_start) < SECONDS_1DAY) {
-                    // Interval is less than 1 day
+                    // Interval is less than 1 day.
                     return $return;
                 } else {
-                    // Interval greater than 1 day, split valid worktimes
+                    // Interval greater than 1 day, split valid worktimes.
                     $start_fixed = 1;
                 }
             }
@@ -5278,9 +5391,9 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
                 && ($wt_end > $wt['date_to'])
             ) {
                 // Case F: ...[....]..start...end...
-                // Invalid, check next worktime hole
+                // Invalid, check next worktime hole.
                 $return['wt_valid'] = 0;
-                // and remove current one
+                // And remove current one.
                 $return['idx'] = ($i + 1);
             }
         }
@@ -5295,19 +5408,19 @@ function sla_fixed_worktime($wt_start, $wt_end, $worktime=null, $planned_downtim
 /**
  * Advanced SLA result with summary
  *
- * @param integer $id_agent_module     id_agent_module
- * @param integer $time_from           Time start
- * @param integer $time_to             time end
- * @param integer $min_value           minimum value for OK status
- * @param integer $max_value           maximum value for OK status
- * @param integer $inverse_interval    inverse interval (range) for OK status
- * @param hash    $daysWeek            Days of active work times (M-T-W-T-V-S-S)
- * @param integer $timeFrom            Start of work time, in each day
- * @param integer $timeTo              End of work time, in each day
- * @param integer $slices              Number of reports (time division)
- * @param integer $inclusive_downtimes In downtime as OK (1) or ignored (0)
+ * @param integer $id_agent_module     Id_agent_module.
+ * @param integer $time_from           Time start.
+ * @param integer $time_to             Time end.
+ * @param integer $min_value           Minimum value for OK status.
+ * @param integer $max_value           Maximum value for OK status.
+ * @param integer $inverse_interval    Inverse interval (range) for OK status.
+ * @param array   $daysWeek            Days of active work times (M-T-W-T-V-S-S).
+ * @param integer $timeFrom            Start of work time, in each day.
+ * @param integer $timeTo              End of work time, in each day.
+ * @param integer $slices              Number of reports (time division).
+ * @param integer $inclusive_downtimes In downtime as OK (1) or ignored (0).
  *
- * @return array                     Returns a hash with the calculated data
+ * @return array                      Returns a hash with the calculated data.
  */
 function reporting_advanced_sla(
     $id_agent_module,
@@ -5323,9 +5436,8 @@ function reporting_advanced_sla(
     $inclusive_downtimes=1
 ) {
     // In content:
-    //
-    // [time_from, time_to] => Worktime
-    // week's days => flags to manage workdays
+    // Example: [time_from, time_to] => Worktime
+    // week's days => flags to manage workdays.
     if (!isset($id_agent_module)) {
         return false;
     }
@@ -5335,13 +5447,13 @@ function reporting_advanced_sla(
     }
 
     if ((!isset($min_value)) && (!isset($max_value))) {
-        // Infer availability range based on the critical thresholds
+        // Infer availability range based on the critical thresholds.
         $agentmodule_info = modules_get_agentmodule($id_agent_module);
 
-        // take in mind: the "inverse" critical threshold
+        // Take in mind: the "inverse" critical threshold.
         $min_value        = $agentmodule_info['min_critical'];
         $max_value        = $agentmodule_info['max_critical'];
-        $inverse_interval = $agentmodule_info['critical_inverse'] == 0 ? 1 : 0;
+        $inverse_interval = ($agentmodule_info['critical_inverse'] == 0) ? 1 : 0;
 
         if ((!isset($min_value)) || ($min_value == 0)) {
             $min_value = null;
@@ -5358,19 +5470,19 @@ function reporting_advanced_sla(
 
         if ((!isset($min_value)) && (!isset($max_value))) {
             if (($agentmodule_info['id_tipo_modulo'] == '2')
-                // generic_proc
+                // Generic_proc.
                 || ($agentmodule_info['id_tipo_modulo'] == '6')
-                // remote_icmp_proc
+                // Remote_icmp_proc.
                 || ($agentmodule_info['id_tipo_modulo'] == '9')
-                // remote_tcp_proc
+                // Remote_tcp_proc.
                 || ($agentmodule_info['id_tipo_modulo'] == '18')
-                // remote_snmp_proc
+                // Remote_snmp_proc.
                 || ($agentmodule_info['id_tipo_modulo'] == '21')
-                // async_proc
+                // Async_proc.
                 || ($agentmodule_info['id_tipo_modulo'] == '31')
             ) {
-                // web_proc
-                // Boolean values are OK if they're different from 0
+                // Web_proc
+                // boolean values are OK if they're different from 0.
                 $max_value = 0;
                 $min_value = 0;
                 $inverse_interval = 1;
@@ -5378,11 +5490,11 @@ function reporting_advanced_sla(
         }
     }
 
-    // By default show last day
+    // By default show last day.
     $datetime_to = time();
     $datetime_from = ($datetime_to - SECONDS_1DAY);
 
-    // Or apply specified range
+    // Or apply specified range.
     if ((isset($time_to) && isset($time_from)) && ($time_to > $time_from)) {
         $datetime_to   = $time_to;
         $datetime_from = $time_from;
@@ -5396,7 +5508,11 @@ function reporting_advanced_sla(
         $datetime_from = $time_from;
     }
 
-    $uncompressed_data = db_uncompress_module_data($id_agent_module, $datetime_from, $datetime_to);
+    $uncompressed_data = db_uncompress_module_data(
+        $id_agent_module,
+        $datetime_from,
+        $datetime_to
+    );
 
     if (is_array($uncompressed_data)) {
         $n_pools = count($uncompressed_data);
@@ -5405,10 +5521,14 @@ function reporting_advanced_sla(
         }
     }
 
-    $planned_downtimes = reporting_get_planned_downtimes_intervals($id_agent_module, $datetime_from, $datetime_to);
+    $planned_downtimes = reporting_get_planned_downtimes_intervals(
+        $id_agent_module,
+        $datetime_from,
+        $datetime_to
+    );
 
     if ((is_array($planned_downtimes)) && (count($planned_downtimes) > 0)) {
-        // Sort retrieved planned downtimes
+        // Sort retrieved planned downtimes.
         usort(
             $planned_downtimes,
             function ($a, $b) {
@@ -5418,16 +5538,16 @@ function reporting_advanced_sla(
                     return 0;
                 }
 
-                return ($a < $b) ? -1 : 1;
+                return ($a < $b) ? (-1) : 1;
             }
         );
 
-        // Compress (overlapped) planned downtimes
+        // Compress (overlapped) planned downtimes.
         $npd = count($planned_downtimes);
         for ($i = 0; $i < $npd; $i++) {
             if (isset($planned_downtimes[($i + 1)])) {
                 if ($planned_downtimes[$i]['date_to'] >= $planned_downtimes[($i + 1)]['date_from']) {
-                    // merge
+                    // Merge.
                     $planned_downtimes[$i]['date_to'] = $planned_downtimes[($i + 1)]['date_to'];
                     array_splice($planned_downtimes, ($i + 1), 1);
                     $npd--;
@@ -5446,9 +5566,8 @@ function reporting_advanced_sla(
     // data
     // array
     // utimestamp
-    // datos
-    //
-    // Build exceptions
+    // datos.
+    // Build exceptions.
     $worktime = null;
 
     if (((isset($daysWeek))
@@ -5459,22 +5578,22 @@ function reporting_advanced_sla(
         $n = 0;
 
         if (!isset($daysWeek)) {
-            // init
+            // Init.
             $daysWeek = [
                 '1' => 1,
-            // sunday"
+            // Sunday.
                 '2' => 1,
-            // monday
+            // Monday.
                 '3' => 1,
-            // tuesday
+            // Tuesday.
                 '4' => 1,
-            // wednesday
+            // Wednesday.
                 '5' => 1,
-            // thursday
+            // Thursday.
                 '6' => 1,
-            // friday
+            // Friday.
                 '7' => 1,
-            // saturday
+            // Saturday.
             ];
         }
 
@@ -5485,10 +5604,10 @@ function reporting_advanced_sla(
         }
 
         if (($n == count($daysWeek)) && ($timeFrom == $timeTo)) {
-            // Ignore custom ranges
+            // Ignore custom ranges.
             $worktime = null;
         } else {
-            // get only first day
+            // Get only first day.
             $date_start = strtotime(date('Y/m/d', $datetime_from));
             $date_end   = strtotime(date('Y/m/d', $datetime_to));
 
@@ -5509,25 +5628,31 @@ function reporting_advanced_sla(
                 $timeTo = '00:00:00';
             }
 
-            // timeFrom (seconds)
+            // TimeFrom (seconds).
             sscanf($timeFrom, '%d:%d:%d', $hours, $minutes, $seconds);
             $secondsFrom = ($hours * 3600 + $minutes * 60 + $seconds);
 
-            // timeTo (seconds)
+            // TimeTo (seconds).
             sscanf($timeTo, '%d:%d:%d', $hours, $minutes, $seconds);
             $secondsTo = ($hours * 3600 + $minutes * 60 + $seconds);
 
-            // Apply planned downtime exceptions (fix matrix)
+            // Apply planned downtime exceptions (fix matrix).
             while ($t_day <= $date_end) {
                 if ($daysWeek[(date('w', $t_day) + 1)] == 1) {
-                    $wt_start = strtotime(date('Y/m/d H:i:s', ($t_day + $secondsFrom)));
-                    $wt_end   = strtotime(date('Y/m/d H:i:s', ($t_day + $secondsTo)));
+                    $wt_start = strtotime(
+                        date('Y/m/d H:i:s', ($t_day + $secondsFrom))
+                    );
+                    $wt_end   = strtotime(
+                        date('Y/m/d H:i:s', ($t_day + $secondsTo))
+                    );
                     if ($timeFrom == $timeTo) {
                         $wt_end += SECONDS_1DAY;
                     }
 
-                    // Check if in planned downtime if exclusive downtimes
-                    if (($inclusive_downtimes == 0) && (is_array($planned_downtimes))) {
+                    // Check if in planned downtime if exclusive downtimes.
+                    if (($inclusive_downtimes == 0)
+                        && (is_array($planned_downtimes))
+                    ) {
                         $start_fixed = 0;
 
                         $n_planned_downtimes = count($planned_downtimes);
@@ -5536,7 +5661,8 @@ function reporting_advanced_sla(
                         $last_pd = end($planned_downtimes);
 
                         if ($wt_start > $last_pd['date_to']) {
-                            // There's no more planned downtimes, accept remaining range
+                            // There's no more planned downtimes,
+                            // accept remaining range.
                             $worktime[$i] = [];
                             $worktime[$i]['date_from'] = $wt_start;
                             $worktime[$i]['date_to']   = $wt_end;
@@ -5546,10 +5672,10 @@ function reporting_advanced_sla(
                                 $pd = $planned_downtimes[$i_planned_downtimes];
 
                                 if ($start_fixed == 1) {
-                                    // Interval greater than found planned downtime
+                                    // Interval greater than found planned downtime.
                                     if ($wt_end < $pd['date_from']) {
                                         $worktime[$i] = [];
-                                        // wt_start already fixed
+                                        // Wt_start already fixed.
                                         $worktime[$i]['date_from'] = $wt_start;
                                         $worktime[$i]['date_to']   = $wt_end;
                                         $i++;
@@ -5560,7 +5686,7 @@ function reporting_advanced_sla(
                                         && ( $wt_end <= $pd['date_to']  )
                                     ) {
                                         $worktime[$i] = [];
-                                        // wt_start already fixed
+                                        // Wt_start already fixed.
                                         $worktime[$i]['date_from'] = $wt_start;
                                         $worktime[$i]['date_to']   = $pd['date_from'];
                                         $i++;
@@ -5569,13 +5695,14 @@ function reporting_advanced_sla(
 
                                     if ($wt_end > $pd['date_to']) {
                                         $worktime[$i] = [];
-                                        // wt_start already fixed
+                                        // Wt_start already fixed.
                                         $worktime[$i]['date_from'] = $wt_start;
                                         $worktime[$i]['date_to']   = $pd['date_from'];
                                         $i++;
 
                                         $start_fixed = 0;
-                                        // Search following planned downtimes, we're still on work time!
+                                        // Search following planned downtimes,
+                                        // we're still on work time!.
                                         $wt_start = $pd['date_from'];
                                     }
                                 }
@@ -5583,7 +5710,7 @@ function reporting_advanced_sla(
                                 if (( $wt_start < $pd['date_from'])
                                     && ( $wt_end < $pd['date_from'])
                                 ) {
-                                    // Out of planned downtime: Add worktime
+                                    // Out of planned downtime: Add worktime.
                                     $worktime[$i] = [];
                                     $worktime[$i]['date_from'] = $wt_start;
                                     $worktime[$i]['date_to']   = $wt_end;
@@ -5605,7 +5732,7 @@ function reporting_advanced_sla(
                                 if (( $wt_start >= $pd['date_from'])
                                     && ( $wt_end <= $pd['date_to'])
                                 ) {
-                                    // All worktime in downtime, ignore
+                                    // All worktime in downtime, ignore.
                                     break;
                                 }
 
@@ -5632,8 +5759,11 @@ function reporting_advanced_sla(
                                     $start_fixed = 1;
                                 }
 
-                                if (($start_fixed == 1) && (($i_planned_downtimes + 1) == $n_planned_downtimes)) {
-                                    // There's no more planned downtimes, accept remaining range
+                                if (($start_fixed == 1)
+                                    && (($i_planned_downtimes + 1) == $n_planned_downtimes)
+                                ) {
+                                    // There's no more planned downtimes,
+                                    // accept remaining range.
                                     $worktime[$i] = [];
                                     $worktime[$i]['date_from'] = $wt_start;
                                     $worktime[$i]['date_to']   = $wt_end;
@@ -5643,7 +5773,7 @@ function reporting_advanced_sla(
                             }
                         }
                     } else {
-                        // No planned downtimes scheduled
+                        // No planned downtimes scheduled.
                         $worktime[$i] = [];
                         $worktime[$i]['date_from'] = $wt_start;
                         $worktime[$i]['date_to']   = $wt_end;
@@ -5652,9 +5782,9 @@ function reporting_advanced_sla(
                 }
 
                 $t_day = strtotime(' + 1 days', $t_day);
-            } //end while
-        } //end if
-    } //end if
+            }
+        }
+    }
 
     // DEBUG
     // print "<pre>Umcompressed data debug:\n";
@@ -5665,23 +5795,29 @@ function reporting_advanced_sla(
     // }
     // }
     // print "</pre>";
-    // Initialization
+    // Initialization.
     $global_return = [];
 
     $wt_check['idx'] = 0;
     $last_pool_id    = 0;
     $last_item_id    = 0;
 
-    // Support to slices
+    // Support to slices.
     $global_datetime_from = $datetime_from;
     $global_datetime_to   = $datetime_to;
     $range                = (($datetime_to - $datetime_from) / $slices);
 
-    // Analysis begins
+    // Analysis begins.
     for ($count = 0; $count < $slices; $count++) {
-        // use strtotime based on local timezone to avoid datetime conversions
-        $datetime_from = strtotime(' + '.($count * $range).' seconds', $global_datetime_from);
-        $datetime_to   = strtotime(' + '.(($count + 1) * $range).' seconds', $global_datetime_from);
+        // Use strtotime based on local timezone to avoid datetime conversions.
+        $datetime_from = strtotime(
+            ' + '.($count * $range).' seconds',
+            $global_datetime_from
+        );
+        $datetime_to = strtotime(
+            ' + '.(($count + 1) * $range).' seconds',
+            $global_datetime_from
+        );
 
         if ((!isset($datetime_from)) || ($datetime_from === false)) {
             $datetime_from = ($global_datetime_from + ($count * $range));
@@ -5692,7 +5828,7 @@ function reporting_advanced_sla(
         }
 
         $return = [];
-        // timing
+        // Timing.
         $time_total       = 0;
         $time_in_ok       = 0;
         $time_in_error    = 0;
@@ -5701,7 +5837,7 @@ function reporting_advanced_sla(
         $time_in_down     = 0;
         $time_out         = 0;
 
-        // checks
+        // Checks.
         $bad_checks       = 0;
         $ok_checks        = 0;
         $not_init_checks  = 0;
@@ -5713,7 +5849,7 @@ function reporting_advanced_sla(
             for ($pool_index = $last_pool_id; $pool_index < $n_pools; $pool_index++) {
                 $pool = $uncompressed_data[$pool_index];
 
-                // check limits
+                // Check limits.
                 if (isset($uncompressed_data[($pool_index + 1)])) {
                     $next_pool = $uncompressed_data[($pool_index + 1)];
                 } else {
@@ -5726,36 +5862,37 @@ function reporting_advanced_sla(
                     $pool['next_utimestamp'] = $global_datetime_to;
                 }
 
-                // update last pool checked: avoid repetition
+                // Update last pool checked: avoid repetition.
                 $last_pool_id = $pool_index;
 
                 if ($datetime_from > $pool['utimestamp']) {
-                    // Skip pool
+                    // Skip pool.
                     continue;
                 }
 
-                // Test if need to acquire current pool
-                if ((($datetime_from <= $pool['utimestamp']) && ($datetime_to >= $pool['next_utimestamp']))
+                // Test if need to acquire current pool.
+                if ((($datetime_from <= $pool['utimestamp'])
+                    && ($datetime_to >= $pool['next_utimestamp']))
                     || ($datetime_to > $pool['utimestamp'])
                 ) {
-                    // Acquire pool to this slice
+                    // Acquire pool to this slice.
                     $nitems_in_pool = count($pool['data']);
                     for ($i = 0; $i < $nitems_in_pool; $i++) {
                         $current_data = $pool['data'][$i];
 
                         if (($i + 1) >= $nitems_in_pool) {
-                            // if pool exceded, check next pool timestamp
+                            // If pool exceded, check next pool timestamp.
                             $next_data = $next_pool;
                         } else {
-                            // pool not exceded, check next item
+                            // Pool not exceded, check next item.
                             $next_data = $pool['data'][($i + 1)];
                         }
 
                         if (isset($next_data['utimestamp'])) {
-                            // check next mark time in current pool
+                            // Check next mark time in current pool.
                             $next_timestamp = $next_data['utimestamp'];
                         } else {
-                            // check last time -> datetime_to
+                            // Check last time -> datetime_to.
                             if (!isset($next_pool)) {
                                 $next_timestamp = $global_datetime_to;
                             } else {
@@ -5763,12 +5900,20 @@ function reporting_advanced_sla(
                             }
                         }
 
-                        // Effective time limits for current data
+                        // Effective time limits for current data.
                         $wt_start = $current_data['utimestamp'];
                         $wt_end   = $next_timestamp;
 
-                        // Remove time spent not in planning (and in planned downtime if needed)
-                        $wt_check = sla_fixed_worktime($wt_start, $wt_end, $worktime, $planned_downtimes, $inclusive_downtimes, $wt_check['idx']);
+                        // Remove time spent not in planning
+                        // (and in planned downtime if needed).
+                        $wt_check = sla_fixed_worktime(
+                            $wt_start,
+                            $wt_end,
+                            $worktime,
+                            $planned_downtimes,
+                            $inclusive_downtimes,
+                            $wt_check['idx']
+                        );
                         $time_interval = $wt_check['interval'];
 
                         if (($wt_check['wt_valid'] == 1)) {
@@ -5776,9 +5921,17 @@ function reporting_advanced_sla(
 
                             if ($time_interval > 0) {
                                 $total_checks++;
-                                if ((isset($current_data['datos'])) && ($current_data['datos'] !== false)) {
-                                    // not unknown nor not init values
-                                    if (sla_check_value($current_data['datos'], $min_value, $max_value, $inverse_interval)) {
+                                if ((isset($current_data['datos']))
+                                    && ($current_data['datos'] !== false)
+                                ) {
+                                    // Not unknown nor not init values.
+                                    if (sla_check_value(
+                                        $current_data['datos'],
+                                        $min_value,
+                                        $max_value,
+                                        $inverse_interval
+                                    )
+                                    ) {
                                         $ok_checks++;
                                         $time_in_ok += $time_interval;
                                     } else {
@@ -5798,7 +5951,8 @@ function reporting_advanced_sla(
 
                             if ($inclusive_downtimes == 1) {
                                 if ($wt_check['wt_in_downtime']) {
-                                    // Add downtime interval as OK in inclusion mode
+                                    // Add downtime interval as
+                                    // OK in inclusion mode.
                                     $total_checks++;
                                     $ok_checks++;
                                     $time_total   += $wt_check['downtime_interval'];
@@ -5811,24 +5965,23 @@ function reporting_advanced_sla(
                                 $time_out += $wt_check['downtime_interval'];
                             }
 
-                            // ignore worktime, is in an invalid period:
+                            // Ignore worktime, is in an invalid period:
                             // scheduled downtimes in exclusion mode
-                            // not 24x7 sla's
+                            // not 24x7 sla's.
                         }
-                    } //end for
-                } //end if
-                else {
+                    }
+                } else {
                     break;
                 }
-            } //end for
+            }
         } else {
-            // If monitor in not-init status => no data to show
+            // If monitor in not-init status => no data to show.
             $time_in_not_init  = ($datetime_to - $datetime_from);
             $time_total       += $time_in_not_init;
             $not_init_checks++;
         }
 
-        // Timing
+        // Timing.
         $return['time_total']      = $time_total;
         $return['time_ok']         = $time_in_ok;
         $return['time_error']      = $time_in_error;
@@ -5837,25 +5990,28 @@ function reporting_advanced_sla(
         $return['time_downtime']   = $time_in_down;
         $return['time_out']        = $time_out;
 
-        // # Checks
+        // Checks.
         $return['checks_total']    = $total_checks;
         $return['checks_ok']       = $ok_checks;
         $return['checks_error']    = $bad_checks;
         $return['checks_unknown']  = $unknown_checks;
         $return['checks_not_init'] = $not_init_checks;
 
-        // SLA
+        // SLA.
         $return['SLA'] = reporting_sla_get_compliance_from_array($return);
-        $return['SLA_fixed'] = sla_truncate($return['SLA'], $config['graph_precision']);
+        $return['SLA_fixed'] = sla_truncate(
+            $return['SLA'],
+            $config['graph_precision']
+        );
 
-        // Time ranges
+        // Time ranges.
         $return['date_from'] = $datetime_from;
         $return['date_to']   = $datetime_to;
 
         if ($slices > 1) {
             array_push($global_return, $return);
         }
-    } //end for
+    }
 
     if ($slices > 1) {
         return $global_return;

From fadf75a6260ee14069aef6f91dbc03ebb40b16ac Mon Sep 17 00:00:00 2001
From: daniel <daniel.barbero@artica.es>
Date: Fri, 1 Mar 2019 13:36:38 +0100
Subject: [PATCH 04/15] fixed minor error lenght str.warning and str.critical
 1024 charts

Former-commit-id: c7c32a48731eff5c786bd0710652a31a64364861
---
 .../godmode/agentes/module_manager_editor_common.php          | 4 ++--
 pandora_console/godmode/massive/massive_edit_modules.php      | 4 ++--
 .../godmode/modules/manage_network_components_form_common.php | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php
index 9f321bff59..892228042a 100644
--- a/pandora_console/godmode/agentes/module_manager_editor_common.php
+++ b/pandora_console/godmode/agentes/module_manager_editor_common.php
@@ -431,7 +431,7 @@ if (modules_is_string_type($id_module_type) || $edit) {
         str_replace('"', '', $str_warning),
         '',
         10,
-        255,
+        1024,
         true,
         $disabledBecauseInPolicy,
         false,
@@ -484,7 +484,7 @@ if (modules_is_string_type($id_module_type) || $edit) {
         str_replace('"', '', $str_critical),
         '',
         10,
-        255,
+        1024,
         true,
         $disabledBecauseInPolicy,
         false,
diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php
index 700aab40ee..568e74dbbb 100755
--- a/pandora_console/godmode/massive/massive_edit_modules.php
+++ b/pandora_console/godmode/massive/massive_edit_modules.php
@@ -562,7 +562,7 @@ $table->data['edit1'][1] = '<table width="100%">';
                 '',
                 '',
                 5,
-                255,
+                1024,
                 true
             );
             $table->data['edit1'][1] .= '</td>';
@@ -631,7 +631,7 @@ $table->data['edit1'][1] = '<table width="100%">';
                 '',
                 '',
                 5,
-                255,
+                1024,
                 true
             );
             $table->data['edit1'][3] .= '</td>';
diff --git a/pandora_console/godmode/modules/manage_network_components_form_common.php b/pandora_console/godmode/modules/manage_network_components_form_common.php
index 1f51302db6..ba463d9bb9 100644
--- a/pandora_console/godmode/modules/manage_network_components_form_common.php
+++ b/pandora_console/godmode/modules/manage_network_components_form_common.php
@@ -190,7 +190,7 @@ $table->data[4][1] .= html_print_input_text(
     $str_warning,
     '',
     5,
-    64,
+    1024,
     true
 ).'</span>';
 $table->data[4][1] .= '<br /><em>'.__('Inverse interval').'</em>';
@@ -216,7 +216,7 @@ $table->data[5][1] .= html_print_input_text(
     $max_critical,
     '',
     5,
-    15,
+    1024,
     true
 ).'</span>';
 $table->data[5][1] .= '<span id="string_critical"><em>'.__('Str.').' </em>&nbsp;';

From c5a5df01f622741e1660773d6282e5df3f046ada Mon Sep 17 00:00:00 2001
From: daniel <daniel.barbero@artica.es>
Date: Fri, 1 Mar 2019 14:26:25 +0100
Subject: [PATCH 05/15] add tip SLA Services

Former-commit-id: da452d98c0b3b43d36c4c53de70df762f6530c8d
---
 pandora_console/include/functions_reporting_html.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php
index 362120e0a1..d54199030f 100644
--- a/pandora_console/include/functions_reporting_html.php
+++ b/pandora_console/include/functions_reporting_html.php
@@ -4752,7 +4752,10 @@ function reporting_html_planned_downtimes_table($planned_downtimes)
 
     $table = new StdClass();
     $table->width = '99%';
-    $table->title = __('This SLA has been affected by the following planned downtimes');
+    $table->title = __('This SLA has been affected by the following planned downtimes').ui_print_help_tip(
+        __('If the duration of the planned downtime is less than 5 minutes it will not be represented in the graph'),
+        true
+    );
     $table->head = [];
     $table->head[0] = __('Name');
     $table->head[1] = __('Description');

From 4eb6c163398f21ba03ae145fa2f12e51c45b7fdb Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Thu, 7 Mar 2019 00:01:27 +0100
Subject: [PATCH 06/15] Auto-updated build strings.

Former-commit-id: 4c22b36dac2410ec75f5cae1c0e6ec7b81e5d78f
---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 24 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 1e3ae42078..f90226b707 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.732-190306
+Version: 7.0NG.732-190307
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 69d3728d28..19e8634366 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190306"
+pandora_version="7.0NG.732-190307"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index 61fc3a9c19..dfc55dae4b 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.732';
-use constant AGENT_BUILD => '190306';
+use constant AGENT_BUILD => '190307';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 8df72d2f4d..3e212a7139 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.732
-%define release     190306
+%define release     190307
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index b38fb0c45c..8e7f60697d 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.732
-%define release     190306
+%define release     190307
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index a8eea69ed5..3ef65442bb 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.732"
-PI_BUILD="190306"
+PI_BUILD="190307"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index c5eda239d1..303d32ebe3 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190306}
+{190307}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 6bcec9ac58..1cf874d803 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.732(Build 190306)")
+#define PANDORA_VERSION ("7.0NG.732(Build 190307)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index afb7e2b05b..e30768134c 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.732(Build 190306))"
+      VALUE "ProductVersion", "(7.0NG.732(Build 190307))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index e560460e93..db5f4731d4 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.732-190306
+Version: 7.0NG.732-190307
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 07b9b05804..a6c6534ff2 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190306"
+pandora_version="7.0NG.732-190307"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index fa74d2780a..1057963b87 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190306';
+$build_version = 'PC190307';
 $pandora_version = 'v7.0NG.732';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index 594d22456c..a9d2a9b254 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
 $version = '7.0NG.732';
-$build = '190306';
+$build = '190307';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 8d335cdacf..9e7220be19 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.732
-%define release     190306
+%define release     190307
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index e6987b2d3d..c2c7a182e1 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.732
-%define release     190306
+%define release     190307
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 30716c0926..1be8afe741 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.732-190306
+Version: 7.0NG.732-190307
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index a0cf102e83..e42f0495fe 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190306"
+pandora_version="7.0NG.732-190307"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 05a65640db..a6b0e36857 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.732";
-my $pandora_build = "190306";
+my $pandora_build = "190307";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 60ddb60f8f..40c3eb8b34 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.732";
-my $pandora_build = "190306";
+my $pandora_build = "190307";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index 5ef7631700..dccbcc4d4b 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.732
-%define release     190306
+%define release     190307
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 53bfba37b8..9cdb2c0cfd 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.732
-%define release     190306
+%define release     190307
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index b3fc8c30c0..866b746b79 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.732"
-PI_BUILD="190306"
+PI_BUILD="190307"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index 945689e1a9..e1c17b78cd 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.732 PS190306";
+my $version = "7.0NG.732 PS190307";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 1cf905d5bb..ccca4efe53 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.732 PS190306";
+my $version = "7.0NG.732 PS190307";
 
 # save program name for logging
 my $progname = basename($0);

From 798567bf8efa4a5e28fcfbee1a421eb37a4cac19 Mon Sep 17 00:00:00 2001
From: daniel <daniel.barbero@artica.es>
Date: Thu, 7 Mar 2019 09:05:38 +0100
Subject: [PATCH 07/15] fixed minor errors change word command for parameters

Former-commit-id: 6e6e56bded99331c606f7a9f6179826afee22d16
---
 pandora_console/include/ajax/events.php     | 2 +-
 pandora_console/operation/events/events.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php
index 0d7d3f5a9f..6b7be8eb28 100644
--- a/pandora_console/include/ajax/events.php
+++ b/pandora_console/include/ajax/events.php
@@ -844,7 +844,7 @@ if ($get_table_response_command) {
     $table->style[1] = 'text-align:center;';
 
     $table->head = [];
-    $table->head[0] = __('Commands');
+    $table->head[0] = __('Parameters');
     $table->head[0] .= ui_print_help_tip(
         __('These commands will apply to all selected events'),
         true
diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php
index f84e92571e..9fb78b084c 100644
--- a/pandora_console/operation/events/events.php
+++ b/pandora_console/operation/events/events.php
@@ -611,7 +611,7 @@ if ($delete) {
 
 echo "<div id='event_details_window'></div>";
 echo "<div id='event_response_window'></div>";
-echo "<div id='event_response_command_window' title='".__('Command')."'></div>";
+echo "<div id='event_response_command_window' title='".__('Parameters')."'></div>";
 
 ui_require_jquery_file('bgiframe');
 ui_require_javascript_file('pandora_events');

From d4f5482e99209bf3addf227a1ede2b8b692e9fc4 Mon Sep 17 00:00:00 2001
From: manuel <manuel.montes@artica.es>
Date: Thu, 7 Mar 2019 13:37:36 +0100
Subject: [PATCH 08/15] Added custom field combo values in agent custom field

Former-commit-id: 55ca33d3de14c868e1eec3f32179b33dc3ff589b
---
 pandora_console/extras/mr/25.sql              |   4 +
 .../pandoradb_migrate_6.0_to_7.0.mysql.sql    |   4 +
 .../godmode/agentes/agent_manager.php         |  31 +++-
 .../godmode/agentes/configure_field.php       | 151 +++++++++++++++++-
 .../godmode/agentes/fields_manager.php        |  16 +-
 .../godmode/massive/massive_edit_agents.php   |  29 ++++
 6 files changed, 221 insertions(+), 14 deletions(-)

diff --git a/pandora_console/extras/mr/25.sql b/pandora_console/extras/mr/25.sql
index 0809bc486e..d69c619586 100644
--- a/pandora_console/extras/mr/25.sql
+++ b/pandora_console/extras/mr/25.sql
@@ -143,5 +143,9 @@ INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Pag
 INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Users&#x20;login',
 'Starting&#x20;Session&#x20;&#92;d+&#92;&#x20;of&#x20;user&#x20;&#40;.*&#41;',
 'user', 0);
+-- ----------------------------------------------------------------------
+-- Add column in table `tagent_custom_fields`
+-- ----------------------------------------------------------------------
+ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(200) DEFAULT '';
 
 COMMIT;
diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
index d8377484c3..b9e44bf064 100644
--- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
+++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
@@ -2034,3 +2034,7 @@ INSERT INTO `tnotification_user` (`id_mensaje`, `id_user`) SELECT `id_mensaje`,
 -- ----------------------------------------------------------------------
 INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Application.VMware', 'Discovery&#x20;Application&#x20;script&#x20;to&#x20;monitor&#x20;VMware&#x20;technologies&#x20;&#40;ESXi,&#x20;VCenter,&#x20;VSphere&#41;', '/usr/share/pandora_server/util/recon_scripts/vmware-plugin.pl', '{"1":{"macro":"_field1_","desc":"Configuration&#x20;file","help":"","value":"","hide":""}}');
 INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Cloud', 'Discovery&#x20;Cloud&#x20;script&#x20;to&#x20;monitor&#x20;Cloud&#x20;technologies&#x20;&#40;AWS.EC2,&#x20;AWS.S3,&#x20;AWS.RDS,&#x20RDS,&#x20AWS.EKS&#41;', '/usr/share/pandora_server/util/recon_scripts/pcm_client.pl', '{"1":{"macro":"_field1_","desc":"Configuration&#x20;file","help":"","value":"","hide":""}}');
+-- ----------------------------------------------------------------------
+-- Add column in table `tagent_custom_fields`
+-- ----------------------------------------------------------------------
+ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(200) DEFAULT '';
diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php
index 143d6d880b..a7fc1f156a 100644
--- a/pandora_console/godmode/agentes/agent_manager.php
+++ b/pandora_console/godmode/agentes/agent_manager.php
@@ -708,6 +708,13 @@ foreach ($fields as $field) {
         __('This field allows url insertion using the BBCode\'s url tag').'.<br />'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.<br /><br />'.__('e.g.: [url=google.com]Google web search[/url]'),
         true
     );
+    $combo = [];
+    $combo = $field['combo_values'];
+    $combo = explode(',', $combo);
+    $combo_values = [];
+    foreach ($combo as $value) {
+        $combo_values[$value] = $value;
+    }
 
     $custom_value = db_get_value_filter(
         'description',
@@ -747,6 +754,28 @@ foreach ($fields as $field) {
         );
     }
 
+    if ($field['combo_values'] !== '') {
+        $data[1] = html_print_select(
+            $combo_values,
+            'customvalue_'.$field['id_field'],
+            $custom_value,
+            '',
+            __('None'),
+            '',
+            true,
+            false,
+            false,
+            '',
+            false,
+            false,
+            false,
+            false,
+            false,
+            '',
+            false
+        );
+    };
+
     array_push($table->data, $data);
 }
 
@@ -757,7 +786,7 @@ if (!empty($fields)) {
 echo '<div class="action-buttons" style="width: '.$table->width.'">';
 
 
-// The context help about the learning mode
+// The context help about the learning mode.
 if ($modo == 0) {
     echo "<span id='modules_not_learning_mode_context_help' style=''>";
 } else {
diff --git a/pandora_console/godmode/agentes/configure_field.php b/pandora_console/godmode/agentes/configure_field.php
index 25afef0c21..5f7c6b91d0 100755
--- a/pandora_console/godmode/agentes/configure_field.php
+++ b/pandora_console/godmode/agentes/configure_field.php
@@ -25,13 +25,16 @@ $id_field = (int) get_parameter('id_field', 0);
 $name = (string) get_parameter('name', '');
 $display_on_front = (bool) get_parameter('display_on_front', 0);
 $is_password_type = (bool) get_parameter('is_password_type', 0);
-
-// Header
+$is_combo_enable = (bool) get_parameter('is_combo_enable', 0);
+$combo_values = (string) get_parameter('combo_values', '');
+// Header.
 if ($id_field) {
     $field = db_get_row_filter('tagent_custom_fields', ['id_field' => $id_field]);
     $name = $field['name'];
     $display_on_front = $field['display_on_front'];
     $is_password_type = $field['is_password_type'];
+    $combo_values = $field['combo_values'];
+    $is_combo_enable = $config['is_combo_enable'];
     ui_print_page_header(__('Update agent custom field'), 'images/custom_field.png', false, '', true, '');
 } else {
     ui_print_page_header(__('Create agent custom field'), 'images/custom_field.png', false, '', true, '');
@@ -40,17 +43,87 @@ if ($id_field) {
 $table = new stdClass();
 $table->width = '100%';
 $table->class = 'databox filters';
+$table->id = 'configure_field';
 $table->style[0] = 'font-weight: bold';
 $table->style[2] = 'font-weight: bold';
+$table->style[4] = 'font-weight: bold';
+$table->style[6] = 'font-weight: bold';
+
+echo "<div id='message_set_password'  title='".__('Agent Custom Fields Information')."' style='display:none;'>";
+echo "<p style='text-align: center;font-weight: bold;'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
+echo '</div>';
+
+echo "<div id='message_set_combo'  title='".__('Agent Custom Fields Information')."' style='display:none;'>";
+echo "<p style='text-align: center;font-weight: bold;'>".__('You cannot unset the enable combo until you clear the combo values and click on update.').'</p>';
+echo '</div>';
+
+echo "<div id='message_no_set_password'  title='".__('Agent Custom Fields Information')."' style='display:none;'>";
+echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Enabled combo the Password type will be disabled.').'</p>';
+echo '</div>';
+
+echo "<div id='message_no_set_combo'  title='".__('Agent Custom Fields Information')."' style='display:none;'>";
+echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
+echo '</div>';
+
+
 $table->data = [];
+
 $table->data[0][0] = __('Name');
-$table->data[0][1] = html_print_input_text('name', $name, '', 35, 100, true);
+$table->data[0][1] = html_print_input_text(
+    'name',
+    $name,
+    '',
+    35,
+    100,
+    true
+);
 
-$table->data[0][2] = __('Pass type').ui_print_help_tip(__('The fields with pass type enabled will be displayed like html input type pass in html'), true);
-$table->data[0][3] = html_print_checkbox('is_password_type', 1, $is_password_type, true);
+$table->data[1][0] = __('Pass type').ui_print_help_tip(
+    __('The fields with pass type enabled will be displayed like html input type pass in html'),
+    true
+);
+$table->data[1][1] = html_print_checkbox_switch(
+    'is_password_type',
+    1,
+    $is_password_type,
+    true
+);
 
-$table->data[0][4] = __('Display on front').ui_print_help_tip(__('The fields with display on front enabled will be displayed into the agent details'), true);
-$table->data[0][5] = html_print_checkbox('display_on_front', 1, $display_on_front, true);
+$table->data[2][0] = __('Display on front').ui_print_help_tip(
+    __('The fields with display on front enabled will be displayed into the agent details'),
+    true
+);
+$table->data[2][1] = html_print_checkbox_switch(
+    'display_on_front',
+    1,
+    $display_on_front,
+    true
+);
+
+$table->data[3][0] = __('Enabled combo');
+$table->data[3][1] = html_print_checkbox_switch_extended(
+    'is_combo_enable',
+    0,
+    $config['is_combo_enable'],
+    false,
+    '',
+    '',
+    true
+);
+
+$table->rowstyle[4] = 'display: none;';
+$table->data[4][0] = __('Combo values').ui_print_help_tip(
+    __('Set values separated by comma'),
+    true
+);
+$table->data[4][1] = html_print_input_text(
+    'combo_values',
+    io_safe_output($combo_values),
+    '',
+    35,
+    200,
+    true
+);
 
 echo '<form name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
 html_print_table($table);
@@ -67,3 +140,67 @@ if ($id_field) {
 
 echo '</div>';
 echo '</form>';
+?>
+
+<script>
+$(document).ready (function () {
+    if($('input[type=hidden][name=update_field]').val() == 1 && $('input[type=text][name=combo_values]').val() != ''){
+        $('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
+        $('#configure_field-4').show();
+        $('input[type=checkbox][name=is_password_type]').change(function (e) {
+            dialog_message("#message_set_password");
+            $('input[type=checkbox][name=is_password_type]').prop('checked', false);
+            $('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
+            $('#configure_field-4').show();
+            e.preventDefault();
+    });
+    $('input[type=checkbox][name=is_combo_enable]').change(function (e) {
+        if($('input[type=text][name=combo_values]').val() != '' &&  $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
+            dialog_message("#message_set_combo");
+            $('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
+            $('#configure_field-4').show();
+            e.preventDefault();
+        }
+    });
+    }
+   
+   
+    $('input[type=checkbox][name=is_combo_enable]').change(function () {
+        if( $(this).is(":checked") ){
+          $('#configure_field-4').show();
+          dialog_message("#message_no_set_password");
+          $('#configure_field-1').hide();
+        }
+        else{
+          $('#configure_field-4').hide();
+          $('#configure_field-1').show();
+        }
+    });
+    $('input[type=checkbox][name=is_password_type]').change(function () {
+        if( $(this).is(":checked")){
+            dialog_message("#message_no_set_combo");
+            $('#configure_field-3').hide();
+        }
+        else{
+            $('#configure_field-3').show();
+        }
+    });
+});
+
+function dialog_message(message_id) {
+  $(message_id)
+    .css("display", "inline")
+    .dialog({
+      modal: true,
+      show: "blind",
+      hide: "blind",
+      width: "400px",
+      buttons: {
+        Close: function() {
+          $(this).dialog("close");
+        }
+      }
+    });
+}
+
+</script>
diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php
index 867942871d..0be7166062 100644
--- a/pandora_console/godmode/agentes/fields_manager.php
+++ b/pandora_console/godmode/agentes/fields_manager.php
@@ -26,7 +26,7 @@ if (!check_acl($config['id_user'], 0, 'PM')) {
     return;
 }
 
-// Header
+// Header.
 ui_print_page_header(__('Agents custom fields manager'), 'images/custom_field.png', false, '', true, '');
 
 $create_field = (bool) get_parameter('create_field');
@@ -36,10 +36,12 @@ $id_field = (int) get_parameter('id_field', 0);
 $name = (string) get_parameter('name', '');
 $display_on_front = (int) get_parameter('display_on_front', 0);
 $is_password_type = (int) get_parameter('is_password_type', 0);
+$combo_values = (string) get_parameter('combo_values', '');
+$combo_value_selected = (string) get_parameter('combo_value_selected', '');
 
-// Create field
+// Create field.
 if ($create_field) {
-    // Check if name field is empty
+    // Check if name field is empty.
     if ($name == '') {
         ui_print_error_message(__('The name must not be empty'));
     } else if ($name == db_get_value('name', 'tagent_custom_fields', 'name', $name)) {
@@ -51,20 +53,22 @@ if ($create_field) {
                 'name'             => $name,
                 'display_on_front' => $display_on_front,
                 'is_password_type' => $is_password_type,
+                'combo_values'     => $combo_values,
             ]
         );
         ui_print_success_message(__('Field successfully created'));
     }
 }
 
-// Update field
+// Update field.
 if ($update_field) {
-    // Check if name field is empty
+    // Check if name field is empty.
     if ($name != '') {
         $values = [
             'name'             => $name,
             'display_on_front' => $display_on_front,
             'is_password_type' => $is_password_type,
+            'combo_values'     => $combo_values,
         ];
 
         $result = db_process_sql_update('tagent_custom_fields', $values, ['id_field' => $id_field]);
@@ -79,7 +83,7 @@ if ($update_field) {
     }
 }
 
-// Delete field
+// Delete field.
 if ($delete_field) {
     $result = db_process_sql_delete(
         'tagent_custom_fields',
diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php
index 2011eec564..74d05c10d0 100755
--- a/pandora_console/godmode/massive/massive_edit_agents.php
+++ b/pandora_console/godmode/massive/massive_edit_agents.php
@@ -689,6 +689,13 @@ foreach ($fields as $field) {
         __('This field allows url insertion using the BBCode\'s url tag').'.<br />'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.<br /><br />'.__('e.g.: [url=google.com]Google web search[/url]'),
         true
     );
+    $combo = [];
+    $combo = $field['combo_values'];
+    $combo = explode(',', $combo);
+    $combo_values = [];
+    foreach ($combo as $value) {
+        $combo_values[$value] = $value;
+    }
 
     $custom_value = db_get_value_filter('description', 'tagent_custom_data', ['id_field' => $field['id_field'], 'id_agent' => $id_agente]);
 
@@ -714,6 +721,28 @@ foreach ($fields as $field) {
         $data[1] = html_print_textarea('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true);
     }
 
+    if ($field['combo_values'] !== '') {
+        $data[1] = html_print_select(
+            $combo_values,
+            'customvalue_'.$field['id_field'],
+            $custom_value,
+            '',
+            __('No change'),
+            '',
+            true,
+            false,
+            false,
+            '',
+            false,
+            false,
+            false,
+            false,
+            false,
+            '',
+            false
+        );
+    };
+
     array_push($table->data, $data);
 }
 

From cfcb42767699cc8422fb8ad6ec946f653234bd80 Mon Sep 17 00:00:00 2001
From: daniel <daniel.barbero@artica.es>
Date: Thu, 7 Mar 2019 14:52:31 +0100
Subject: [PATCH 09/15] fixed minor error

Former-commit-id: 5025e19699e773afee950a31bdceeeb0eb4bc47d
---
 .../godmode/modules/manage_network_components_form_common.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pandora_console/godmode/modules/manage_network_components_form_common.php b/pandora_console/godmode/modules/manage_network_components_form_common.php
index ba463d9bb9..2e511c6f6f 100644
--- a/pandora_console/godmode/modules/manage_network_components_form_common.php
+++ b/pandora_console/godmode/modules/manage_network_components_form_common.php
@@ -216,7 +216,7 @@ $table->data[5][1] .= html_print_input_text(
     $max_critical,
     '',
     5,
-    1024,
+    15,
     true
 ).'</span>';
 $table->data[5][1] .= '<span id="string_critical"><em>'.__('Str.').' </em>&nbsp;';
@@ -225,7 +225,7 @@ $table->data[5][1] .= html_print_input_text(
     $str_critical,
     '',
     5,
-    64,
+    1024,
     true
 ).'</span>';
 $table->data[5][1] .= '<br /><em>'.__('Inverse interval').'</em>';

From 98ec2f31e66aa88e0d1f0b9b62ff3b41c0507a56 Mon Sep 17 00:00:00 2001
From: Luis Calvo <luis.calvo@artica.es>
Date: Thu, 7 Mar 2019 18:05:03 +0100
Subject: [PATCH 10/15] Restored width in % and forced Agent SNMP view to enter
 if with widget=true

Former-commit-id: 25ca763789d5d30d298b6bf77bd5f0630aff526f
---
 pandora_console/include/functions_reporting_html.php | 2 +-
 pandora_console/include/graphs/functions_flot.php    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php
index 362120e0a1..786a31ae7f 100644
--- a/pandora_console/include/functions_reporting_html.php
+++ b/pandora_console/include/functions_reporting_html.php
@@ -4531,7 +4531,7 @@ function reporting_get_event_histogram($events, $text_header_event=false)
             [],
             true,
             $ttl,
-            false,
+            true,
             false
         );
 
diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php
index 39c4c347dc..637d02b34b 100644
--- a/pandora_console/include/graphs/functions_flot.php
+++ b/pandora_console/include/graphs/functions_flot.php
@@ -748,7 +748,7 @@ function flot_slicesbar_graph(
         if ($widgets) {
             $return = "<div id='$graph_id' class='noresizevc graph $adapt_key' style='width: ".$width.'px; height: '.$height."px;'></div>";
         } else {
-            $return = "<div id='$graph_id' class='noresizevc graph $adapt_key' style='width: ".$width.'px; height: '.$height."px;'></div>";
+            $return = "<div id='$graph_id' class='noresizevc graph $adapt_key' style='width: ".$width.'%; height: '.$height."px;'></div>";
         }
     }
 

From e43d1aa35600d66ac2586292380238a3ca935b71 Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Fri, 8 Mar 2019 00:01:31 +0100
Subject: [PATCH 11/15] Auto-updated build strings.

Former-commit-id: d9a712a382713bbbbb82849a2be70991acd7e72f
---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 24 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index f90226b707..3792cba965 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.732-190307
+Version: 7.0NG.732-190308
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 19e8634366..f752620797 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190307"
+pandora_version="7.0NG.732-190308"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index dfc55dae4b..bc4506b120 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.732';
-use constant AGENT_BUILD => '190307';
+use constant AGENT_BUILD => '190308';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 3e212a7139..563fa5261f 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.732
-%define release     190307
+%define release     190308
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 8e7f60697d..b440a03c4f 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.732
-%define release     190307
+%define release     190308
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 3ef65442bb..e66981e5a7 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.732"
-PI_BUILD="190307"
+PI_BUILD="190308"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 303d32ebe3..044c2645c9 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190307}
+{190308}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 1cf874d803..d5599b189a 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.732(Build 190307)")
+#define PANDORA_VERSION ("7.0NG.732(Build 190308)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index e30768134c..edcbbda609 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.732(Build 190307))"
+      VALUE "ProductVersion", "(7.0NG.732(Build 190308))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index db5f4731d4..b1a739e3dd 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.732-190307
+Version: 7.0NG.732-190308
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index a6c6534ff2..023455e028 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190307"
+pandora_version="7.0NG.732-190308"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index 1057963b87..ac7d110f66 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190307';
+$build_version = 'PC190308';
 $pandora_version = 'v7.0NG.732';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index a9d2a9b254..8c3b201fea 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
 $version = '7.0NG.732';
-$build = '190307';
+$build = '190308';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 9e7220be19..1920b97abf 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.732
-%define release     190307
+%define release     190308
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index c2c7a182e1..6beffe1eb7 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.732
-%define release     190307
+%define release     190308
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 1be8afe741..80ba28e8ab 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.732-190307
+Version: 7.0NG.732-190308
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index e42f0495fe..3b200463c5 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190307"
+pandora_version="7.0NG.732-190308"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index a6b0e36857..c13295f3ce 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.732";
-my $pandora_build = "190307";
+my $pandora_build = "190308";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 40c3eb8b34..8962ebe3dc 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.732";
-my $pandora_build = "190307";
+my $pandora_build = "190308";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index dccbcc4d4b..60399c3a0b 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.732
-%define release     190307
+%define release     190308
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 9cdb2c0cfd..212cb99d53 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.732
-%define release     190307
+%define release     190308
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 866b746b79..2f4bdafaca 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.732"
-PI_BUILD="190307"
+PI_BUILD="190308"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index e1c17b78cd..9341a7fe0a 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.732 PS190307";
+my $version = "7.0NG.732 PS190308";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index ccca4efe53..9ddd183499 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.732 PS190307";
+my $version = "7.0NG.732 PS190308";
 
 # save program name for logging
 my $progname = basename($0);

From c41c9d10e0ce84d5a4bb62af5968de38fbd7d585 Mon Sep 17 00:00:00 2001
From: manuel <manuel.montes@artica.es>
Date: Fri, 8 Mar 2019 10:01:55 +0100
Subject: [PATCH 12/15] Changed sql files

Former-commit-id: b9b20d2a5aee08ca1638df9bdb8e16c3b693d47b
---
 pandora_console/extras/mr/25.sql                          | 4 ----
 pandora_console/extras/mr/26.sql                          | 8 ++++++++
 .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql         | 6 +++---
 pandora_console/pandoradb.sql                             | 1 +
 pandora_console/pandoradb_data.sql                        | 6 +++---
 5 files changed, 15 insertions(+), 10 deletions(-)
 create mode 100644 pandora_console/extras/mr/26.sql

diff --git a/pandora_console/extras/mr/25.sql b/pandora_console/extras/mr/25.sql
index d69c619586..0809bc486e 100644
--- a/pandora_console/extras/mr/25.sql
+++ b/pandora_console/extras/mr/25.sql
@@ -143,9 +143,5 @@ INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Pag
 INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Users&#x20;login',
 'Starting&#x20;Session&#x20;&#92;d+&#92;&#x20;of&#x20;user&#x20;&#40;.*&#41;',
 'user', 0);
--- ----------------------------------------------------------------------
--- Add column in table `tagent_custom_fields`
--- ----------------------------------------------------------------------
-ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(200) DEFAULT '';
 
 COMMIT;
diff --git a/pandora_console/extras/mr/26.sql b/pandora_console/extras/mr/26.sql
new file mode 100644
index 0000000000..f9c904a0a3
--- /dev/null
+++ b/pandora_console/extras/mr/26.sql
@@ -0,0 +1,8 @@
+START TRANSACTION;
+
+-- ----------------------------------------------------------------------
+-- Add column in table `tagent_custom_fields`
+-- ----------------------------------------------------------------------
+ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT '';
+
+COMMIT;
diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
index b9e44bf064..a2953d00f5 100644
--- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
+++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
@@ -1199,13 +1199,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 25);
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 26);
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
 UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
 DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '732');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '733');
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
 
 -- ---------------------------------------------------------------------
@@ -2037,4 +2037,4 @@ INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Di
 -- ----------------------------------------------------------------------
 -- Add column in table `tagent_custom_fields`
 -- ----------------------------------------------------------------------
-ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(200) DEFAULT '';
+ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT '';
diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql
index ae780a5470..ac1f16c6f7 100644
--- a/pandora_console/pandoradb.sql
+++ b/pandora_console/pandoradb.sql
@@ -1894,6 +1894,7 @@ CREATE TABLE IF NOT EXISTS `tagent_custom_fields` (
 	`name` varchar(45) NOT NULL default '',
 	`display_on_front` tinyint(1) NOT NULL default 0,
 	`is_password_type` tinyint(1) NOT NULL default 0,
+	`combo_values` VARCHAR(255) DEFAULT '',
 	PRIMARY KEY  (`id_field`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql
index 25bff0eb4d..9b5ec600a2 100644
--- a/pandora_console/pandoradb_data.sql
+++ b/pandora_console/pandoradb_data.sql
@@ -111,10 +111,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
 ('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
 ('custom_report_front_header', ''),
 ('custom_report_front_footer', ''),
-('MR', 25),
+('MR', 26),
 ('identification_reminder', 1),
 ('identification_reminder_timestamp', 0),
-('current_package_enterprise', '732'),
+('current_package_enterprise', '733'),
 ('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}'),
 ('custom_docs_logo', 'default_docs.png'),
 ('custom_support_logo', 'default_support.png'),
@@ -1151,7 +1151,7 @@ INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `execute`, `p
 
 INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (9,'Packet&#x20;Loss','Checks&#x20;for&#x20;dropped&#x20;packages&#x20;after&#x20;X&#x20;seconds&#x20;of&#x20;testing.&#x20;It&#x20;returns&#x20;%&#x20;of&#x20;dropped&#x20;packets.&#x20;It&#x20;uses&#x20;ping&#x20;flood&#x20;mode&#x20;to&#x20;launch&#x20;50&#x20;consecutive&#x20;pings&#x20;to&#x20;a&#x20;remote&#x20;destination.&#x20;On&#x20;local,&#x20;stable&#x20;networks,&#x20;value&#x20;should&#x20;be&#x20;0.&#x0d;&#x0a;',30,0,'/usr/share/pandora_server/util/plugin/packet_loss.sh','','','','',0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Test&#x20;time\",\"help\":\"\",\"value\":\"8\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Target&#x20;IP\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"}}','_field1_&#x20;_field2_');
 
-INSERT INTO `tagent_custom_fields` VALUES (1,'Serial&#x20;Number',0,0),(2,'Department',0,0),(3,'Additional&#x20;ID',0,0),(4,'eHorusID',0,0);
+INSERT INTO `tagent_custom_fields` VALUES (1,'Serial&#x20;Number',0,0,''),(2,'Department',0,0,''),(3,'Additional&#x20;ID',0,0,''),(4,'eHorusID',0,0,'');
 
 INSERT INTO `ttag` VALUES (1,'network','Network&#x20;equipment','http://artica.es','',''),(2,'critical','Critical&#x20;modules','','',''),(3,'dmz','DMZ&#x20;Network&#x20;Zone','','',''),(4,'performance','Performance&#x20;anda&#x20;capacity&#x20;modules','','',''),(5,'configuration','','','','');
 

From fd68b49710d4911a490c598edb6139f8486de70f Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Sat, 9 Mar 2019 00:01:32 +0100
Subject: [PATCH 13/15] Auto-updated build strings.

Former-commit-id: 6b07eeeea7577d37282399b23c8b409ab7253507
---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 24 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 3792cba965..08b9b8b0d4 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.732-190308
+Version: 7.0NG.732-190309
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index f752620797..5a4c9f5b81 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190308"
+pandora_version="7.0NG.732-190309"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index bc4506b120..d8386903a9 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.732';
-use constant AGENT_BUILD => '190308';
+use constant AGENT_BUILD => '190309';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 563fa5261f..63c0661d89 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.732
-%define release     190308
+%define release     190309
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index b440a03c4f..93ed89a213 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.732
-%define release     190308
+%define release     190309
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index e66981e5a7..1ff1e27391 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.732"
-PI_BUILD="190308"
+PI_BUILD="190309"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 044c2645c9..e07483e93e 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190308}
+{190309}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index d5599b189a..a83a0744dc 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.732(Build 190308)")
+#define PANDORA_VERSION ("7.0NG.732(Build 190309)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index edcbbda609..33a7f55f0f 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.732(Build 190308))"
+      VALUE "ProductVersion", "(7.0NG.732(Build 190309))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index b1a739e3dd..0785913d63 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.732-190308
+Version: 7.0NG.732-190309
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 023455e028..ede9646d7f 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190308"
+pandora_version="7.0NG.732-190309"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index ac7d110f66..1f1896db1a 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190308';
+$build_version = 'PC190309';
 $pandora_version = 'v7.0NG.732';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index 8c3b201fea..f194f758cb 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
 $version = '7.0NG.732';
-$build = '190308';
+$build = '190309';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 1920b97abf..c55ad9f992 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.732
-%define release     190308
+%define release     190309
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 6beffe1eb7..cc7cd4abdb 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.732
-%define release     190308
+%define release     190309
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 80ba28e8ab..761a6a9cd0 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.732-190308
+Version: 7.0NG.732-190309
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 3b200463c5..9727fce6fd 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190308"
+pandora_version="7.0NG.732-190309"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index c13295f3ce..44f7fa7842 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.732";
-my $pandora_build = "190308";
+my $pandora_build = "190309";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 8962ebe3dc..cf6da34867 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.732";
-my $pandora_build = "190308";
+my $pandora_build = "190309";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index 60399c3a0b..398199a186 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.732
-%define release     190308
+%define release     190309
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 212cb99d53..f2d29498f0 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.732
-%define release     190308
+%define release     190309
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 2f4bdafaca..b0db46d7bc 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.732"
-PI_BUILD="190308"
+PI_BUILD="190309"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index 9341a7fe0a..aa205c440d 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.732 PS190308";
+my $version = "7.0NG.732 PS190309";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 9ddd183499..ca1ae28fb4 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.732 PS190308";
+my $version = "7.0NG.732 PS190309";
 
 # save program name for logging
 my $progname = basename($0);

From b79815bb06ce5f1af779ee66f879d38f6e62c3c5 Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Sun, 10 Mar 2019 00:01:25 +0100
Subject: [PATCH 14/15] Auto-updated build strings.

Former-commit-id: e002aa51a4e0ad634ed459dcccd4444cb1d0081c
---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 24 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 08b9b8b0d4..b98b45ad32 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.732-190309
+Version: 7.0NG.732-190310
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 5a4c9f5b81..17297ae4fb 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190309"
+pandora_version="7.0NG.732-190310"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index d8386903a9..32599fc805 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.732';
-use constant AGENT_BUILD => '190309';
+use constant AGENT_BUILD => '190310';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 63c0661d89..c432c8431a 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.732
-%define release     190309
+%define release     190310
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 93ed89a213..57d40b1e84 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.732
-%define release     190309
+%define release     190310
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 1ff1e27391..99c26865ab 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.732"
-PI_BUILD="190309"
+PI_BUILD="190310"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index e07483e93e..b64f9c969e 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190309}
+{190310}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index a83a0744dc..fa1b438fa3 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.732(Build 190309)")
+#define PANDORA_VERSION ("7.0NG.732(Build 190310)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 33a7f55f0f..e1e42cae47 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.732(Build 190309))"
+      VALUE "ProductVersion", "(7.0NG.732(Build 190310))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 0785913d63..edf0e9e7c7 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.732-190309
+Version: 7.0NG.732-190310
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index ede9646d7f..bc520dd17b 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190309"
+pandora_version="7.0NG.732-190310"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index 1f1896db1a..7182010499 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190309';
+$build_version = 'PC190310';
 $pandora_version = 'v7.0NG.732';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index f194f758cb..c7efb7b369 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
 $version = '7.0NG.732';
-$build = '190309';
+$build = '190310';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index c55ad9f992..56e9ac7851 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.732
-%define release     190309
+%define release     190310
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index cc7cd4abdb..14fde0a623 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.732
-%define release     190309
+%define release     190310
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 761a6a9cd0..9a23c88045 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.732-190309
+Version: 7.0NG.732-190310
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 9727fce6fd..e37e8b3f0e 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190309"
+pandora_version="7.0NG.732-190310"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 44f7fa7842..9ee4af4474 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.732";
-my $pandora_build = "190309";
+my $pandora_build = "190310";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index cf6da34867..5ff318dae4 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.732";
-my $pandora_build = "190309";
+my $pandora_build = "190310";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index 398199a186..d5edc25f25 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.732
-%define release     190309
+%define release     190310
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index f2d29498f0..7bd24ee70f 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.732
-%define release     190309
+%define release     190310
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index b0db46d7bc..33312c2f0d 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.732"
-PI_BUILD="190309"
+PI_BUILD="190310"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index aa205c440d..0cc14e1fe0 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.732 PS190309";
+my $version = "7.0NG.732 PS190310";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index ca1ae28fb4..cb0294ef25 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.732 PS190309";
+my $version = "7.0NG.732 PS190310";
 
 # save program name for logging
 my $progname = basename($0);

From 0210c2381d58d9cd3319a6767f57b53ef0c474a3 Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Mon, 11 Mar 2019 00:01:58 +0100
Subject: [PATCH 15/15] Auto-updated build strings.

Former-commit-id: 7f83037f89edf17156828a793fa1ae3a5920d818
---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 24 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index b98b45ad32..5792ba17ca 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.732-190310
+Version: 7.0NG.732-190311
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 17297ae4fb..4f7a02a497 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190310"
+pandora_version="7.0NG.732-190311"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index 32599fc805..e0a754adad 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.732';
-use constant AGENT_BUILD => '190310';
+use constant AGENT_BUILD => '190311';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index c432c8431a..fb0952ad20 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.732
-%define release     190310
+%define release     190311
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 57d40b1e84..c4cca3a53b 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.732
-%define release     190310
+%define release     190311
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 99c26865ab..26aaea4fa7 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.732"
-PI_BUILD="190310"
+PI_BUILD="190311"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index b64f9c969e..23cad4a284 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190310}
+{190311}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index fa1b438fa3..0d2b48f5d0 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.732(Build 190310)")
+#define PANDORA_VERSION ("7.0NG.732(Build 190311)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index e1e42cae47..a9ecca4a92 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.732(Build 190310))"
+      VALUE "ProductVersion", "(7.0NG.732(Build 190311))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index edf0e9e7c7..ac8156d640 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.732-190310
+Version: 7.0NG.732-190311
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index bc520dd17b..7a8fe965bb 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190310"
+pandora_version="7.0NG.732-190311"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index 7182010499..c71487946d 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190310';
+$build_version = 'PC190311';
 $pandora_version = 'v7.0NG.732';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index c7efb7b369..22574acdab 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
 $version = '7.0NG.732';
-$build = '190310';
+$build = '190311';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 56e9ac7851..f7d85b5a17 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.732
-%define release     190310
+%define release     190311
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 14fde0a623..68c69f5eec 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.732
-%define release     190310
+%define release     190311
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 9a23c88045..43e1720b64 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.732-190310
+Version: 7.0NG.732-190311
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index e37e8b3f0e..e8587ab115 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.732-190310"
+pandora_version="7.0NG.732-190311"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 9ee4af4474..a1fa8d2e6b 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.732";
-my $pandora_build = "190310";
+my $pandora_build = "190311";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 5ff318dae4..0d13ebc02e 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.732";
-my $pandora_build = "190310";
+my $pandora_build = "190311";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index d5edc25f25..8be92339c6 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.732
-%define release     190310
+%define release     190311
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 7bd24ee70f..8107520b9f 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.732
-%define release     190310
+%define release     190311
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 33312c2f0d..bcdeb6a35a 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.732"
-PI_BUILD="190310"
+PI_BUILD="190311"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index 0cc14e1fe0..c8256d9739 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.732 PS190310";
+my $version = "7.0NG.732 PS190311";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index cb0294ef25..ea0e6f48e5 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.732 PS190310";
+my $version = "7.0NG.732 PS190311";
 
 # save program name for logging
 my $progname = basename($0);