diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 1e3ae42078..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-190306
+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 69d3728d28..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-190306"
+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 61fc3a9c19..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 => '190306';
+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 8df72d2f4d..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 190306
+%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 b38fb0c45c..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 190306
+%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 a8eea69ed5..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="190306"
+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 c5eda239d1..23cad4a284 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
-{190306}
+{190311}
ViewReadme
{Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 6bcec9ac58..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 190306)")
+#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 afb7e2b05b..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 190306))"
+ 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 e560460e93..ac8156d640 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-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 07b9b05804..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-190306"
+pandora_version="7.0NG.732-190311"
package_pear=0
package_pandora=1
diff --git a/pandora_console/extras/mr/26.sql b/pandora_console/extras/mr/26.sql
index fa2c7d008c..9ef63de0d0 100644
--- a/pandora_console/extras/mr/26.sql
+++ b/pandora_console/extras/mr/26.sql
@@ -2,4 +2,9 @@ START TRANSACTION;
ALTER TABLE `treport_content` ADD COLUMN `show_extended_events` tinyint(1) default '0';
-COMMIT;
\ No newline at end of file
+-- ----------------------------------------------------------------------
+-- 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 4ec31eb9f7..822134c54d 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,3 +2037,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 Application script to monitor VMware technologies (ESXi, VCenter, VSphere)', '/usr/share/pandora_server/util/recon_scripts/vmware-plugin.pl', '{"1":{"macro":"_field1_","desc":"Configuration file","help":"","value":"","hide":""}}');
INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Cloud', 'Discovery Cloud script to monitor Cloud technologies (AWS.EC2, AWS.S3, AWS.RDS, RDS,ȊWS.EKS)', '/usr/share/pandora_server/util/recon_scripts/pcm_client.pl', '{"1":{"macro":"_field1_","desc":"Configuration file","help":"","value":"","hide":""}}');
+-- ----------------------------------------------------------------------
+-- Add column in table `tagent_custom_fields`
+-- ----------------------------------------------------------------------
+ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) 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').'.
'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.
'.__('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 '
';
echo '';
+?>
+
+
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/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_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').'.
'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.
'.__('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);
}
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] = '';
'',
'',
5,
- 255,
+ 1024,
true
);
$table->data['edit1'][1] .= '';
@@ -631,7 +631,7 @@ $table->data['edit1'][1] = '';
'',
'',
5,
- 255,
+ 1024,
true
);
$table->data['edit1'][3] .= '';
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..2e511c6f6f 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
).'';
$table->data[4][1] .= '
'.__('Inverse interval').'';
@@ -225,7 +225,7 @@ $table->data[5][1] .= html_print_input_text(
$str_critical,
'',
5,
- 64,
+ 1024,
true
).'';
$table->data[5][1] .= '
'.__('Inverse interval').'';
diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php
index 9d327bb540..6b7be8eb28 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 '
';
- echo "".html_print_image('images/spinner.gif', true).'
';
+ echo "";
+ echo html_print_image(
+ 'images/spinner.gif',
+ true
+ );
+ echo '
';
echo "
";
if ($end) {
echo "
";
- html_print_button(__('Execute again'), 'btn_str', false, 'execute_event_response(false);', "class='sub next'");
- echo "".html_print_image('images/spinner.gif', true).'';
+ html_print_button(
+ __('Execute again'),
+ 'btn_str',
+ false,
+ 'execute_event_response(false);',
+ "class='sub next'"
+ );
+ echo "";
+ echo html_print_image(
+ 'images/spinner.gif',
+ true
+ );
+ echo '';
echo '
';
}
} 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] = __('Parameters');
+ $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 '';
+ 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/config_process.php b/pandora_console/include/config_process.php
index fa74d2780a..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 = 'PC190306';
+$build_version = 'PC190311';
$pandora_version = 'v7.0NG.732';
// Do not overwrite default timezone set if defined.
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/';
}
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index aec39ec0f6..f65849bb54 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;
@@ -4880,7 +4909,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);
@@ -4889,22 +4920,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;
@@ -4919,7 +4968,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'];
}
@@ -4974,11 +5025,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)) {
@@ -4986,12 +5042,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;
}
@@ -5000,7 +5056,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;
}
@@ -5009,7 +5065,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;
}
@@ -5026,20 +5082,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;
}
@@ -5053,6 +5114,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'])
@@ -5074,7 +5136,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'])
@@ -5098,29 +5160,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;
@@ -5130,7 +5207,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;
@@ -5144,10 +5221,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;
@@ -5163,9 +5245,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;
@@ -5179,9 +5266,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;
@@ -5205,7 +5297,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;
@@ -5222,7 +5319,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;
@@ -5238,7 +5340,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;
@@ -5247,10 +5354,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;
}
}
@@ -5261,7 +5369,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;
@@ -5269,10 +5382,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;
}
}
@@ -5281,9 +5394,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);
}
}
@@ -5298,19 +5411,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,
@@ -5326,9 +5439,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;
}
@@ -5338,13 +5450,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;
@@ -5361,19 +5473,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;
@@ -5381,11 +5493,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;
@@ -5399,7 +5511,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);
@@ -5408,10 +5524,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) {
@@ -5421,16 +5541,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--;
@@ -5449,9 +5569,8 @@ function reporting_advanced_sla(
// data
// array
// utimestamp
- // datos
- //
- // Build exceptions
+ // datos.
+ // Build exceptions.
$worktime = null;
if (((isset($daysWeek))
@@ -5462,22 +5581,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.
];
}
@@ -5488,10 +5607,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));
@@ -5512,25 +5631,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);
@@ -5539,7 +5664,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;
@@ -5549,10 +5675,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++;
@@ -5563,7 +5689,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++;
@@ -5572,13 +5698,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'];
}
}
@@ -5586,7 +5713,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;
@@ -5608,7 +5735,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;
}
@@ -5635,8 +5762,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;
@@ -5646,7 +5776,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;
@@ -5655,9 +5785,9 @@ function reporting_advanced_sla(
}
$t_day = strtotime(' + 1 days', $t_day);
- } //end while
- } //end if
- } //end if
+ }
+ }
+ }
// DEBUG
// print "Umcompressed data debug:\n";
@@ -5668,23 +5798,29 @@ function reporting_advanced_sla(
// }
// }
// print "
";
- // 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));
@@ -5695,7 +5831,7 @@ function reporting_advanced_sla(
}
$return = [];
- // timing
+ // Timing.
$time_total = 0;
$time_in_ok = 0;
$time_in_error = 0;
@@ -5704,7 +5840,7 @@ function reporting_advanced_sla(
$time_in_down = 0;
$time_out = 0;
- // checks
+ // Checks.
$bad_checks = 0;
$ok_checks = 0;
$not_init_checks = 0;
@@ -5716,7 +5852,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 {
@@ -5729,36 +5865,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 {
@@ -5766,12 +5903,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)) {
@@ -5779,9 +5924,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 {
@@ -5801,7 +5954,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'];
@@ -5814,24 +5968,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;
@@ -5840,25 +5993,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;
diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php
index 5c2862d8b0..6c270abf8a 100644
--- a/pandora_console/include/functions_reporting_html.php
+++ b/pandora_console/include/functions_reporting_html.php
@@ -4578,7 +4578,7 @@ function reporting_get_event_histogram($events, $text_header_event=false)
[],
true,
$ttl,
- false,
+ true,
false
);
@@ -4799,7 +4799,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');
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 = "";
} else {
- $return = "";
+ $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/install.php b/pandora_console/install.php
index 594d22456c..22574acdab 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
';
+ echo '';
+ echo __(
+ 'Please, select an event'
+ ).'';
echo '
';
}
}
@@ -995,12 +999,14 @@ if ($group_rep == 2) {
?>
";
echo "";
+echo "";
ui_require_jquery_file('bgiframe');
ui_require_javascript_file('pandora_events');
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 8d335cdacf..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 190306
+%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 e6987b2d3d..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 190306
+%define release 190311
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2
diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql
index de9fcd94f8..01c5be088c 100644
--- a/pandora_console/pandoradb.sql
+++ b/pandora_console/pandoradb.sql
@@ -1895,6 +1895,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 52ba72bb62..ee4ad45c06 100644
--- a/pandora_console/pandoradb_data.sql
+++ b/pandora_console/pandoradb_data.sql
@@ -114,10 +114,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 to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'),
('custom_docs_logo', 'default_docs.png'),
('custom_support_logo', 'default_support.png'),
@@ -1154,7 +1154,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 Loss','Checks for dropped packages after X seconds of testing. It returns % of dropped packets. It uses ping flood mode to launch 50 consecutive pings to a remote destination. On local, stable networks, value should be 0.
',30,0,'/usr/share/pandora_server/util/plugin/packet_loss.sh','','','','',0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Test time\",\"help\":\"\",\"value\":\"8\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Target IP\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"}}','_field1_ _field2_');
-INSERT INTO `tagent_custom_fields` VALUES (1,'Serial Number',0,0),(2,'Department',0,0),(3,'Additional ID',0,0),(4,'eHorusID',0,0);
+INSERT INTO `tagent_custom_fields` VALUES (1,'Serial Number',0,0,''),(2,'Department',0,0,''),(3,'Additional ID',0,0,''),(4,'eHorusID',0,0,'');
INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://artica.es','',''),(2,'critical','Critical modules','','',''),(3,'dmz','DMZ Network Zone','','',''),(4,'performance','Performance anda capacity modules','','',''),(5,'configuration','','','','');
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 30716c0926..43e1720b64 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-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 a0cf102e83..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-190306"
+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 0c951cc039..ab5f48ee3d 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 = "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 60ddb60f8f..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 = "190306";
+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 5ef7631700..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 190306
+%define release 190311
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 53bfba37b8..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 190306
+%define release 190311
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index b3fc8c30c0..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="190306"
+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 945689e1a9..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 PS190306";
+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 1cf905d5bb..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 PS190306";
+my $version = "7.0NG.732 PS190311";
# save program name for logging
my $progname = basename($0);