Merge remote-tracking branch 'origin/develop' into 3088-Se_carga_filtro_en_vista_de_eventos_cuando_no_hay_filtro_activo

Former-commit-id: f0ab3426fdf23bbceed7c2cd991b37c33ec3ae2e
This commit is contained in:
daniel 2019-02-21 13:26:12 +01:00
commit d9e0f2ea42
55 changed files with 2049 additions and 696 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.731-190219
Version: 7.0NG.731-190221
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.731-190219"
pandora_version="7.0NG.731-190221"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.731';
use constant AGENT_BUILD => '190219';
use constant AGENT_BUILD => '190221';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.731
%define release 190219
%define release 190221
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.731
%define release 190219
%define release 190221
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.731"
PI_BUILD="190219"
PI_BUILD="190221"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190219}
{190221}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.731(Build 190219)")
#define PANDORA_VERSION ("7.0NG.731(Build 190221)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.731(Build 190219))"
VALUE "ProductVersion", "(7.0NG.731(Build 190221))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.731-190219
Version: 7.0NG.731-190221
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.731-190219"
pandora_version="7.0NG.731-190221"
package_pear=0
package_pandora=1

View File

@ -229,7 +229,7 @@ if (!$new_agent) {
$table->data[0][1] .= "&nbsp;&nbsp;<span align='right'><a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=$id_agente&search=&offset=0&sort_field=&sort=none'>".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).'</a>';
}
$table->data[1][0] = __('Alias');
$table->data[1][0] = __('Alias').ui_print_help_tip(__('Characters /,\,|,%,#,&,$ are not allowed'), true).'</span>';
$table->data[1][1] = html_print_input_text('alias', $alias, '', 50, 100, true);
if ($new_agent) {
$table->data[1][1] .= html_print_checkbox('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name');

View File

@ -159,7 +159,8 @@ $module_macros = [];
// Create agent
if ($create_agent) {
$mssg_warning = 0;
$alias = (string) get_parameter_post('alias', '');
$alias = trim (preg_replace('/[\/\\\|%#&$-]/', '',
html_entity_decode( str_replace('`','&lsquo;',(string) get_parameter_post ("alias", "")))));
$alias_as_name = (int) get_parameter_post('alias_as_name', 0);
$direccion_agente = (string) get_parameter_post('direccion', '');
$unique_ip = (int) get_parameter_post('unique_ip', 0);
@ -764,7 +765,8 @@ if ($update_agent) {
$mssg_warning = 0;
$id_agente = (int) get_parameter_post('id_agente');
$nombre_agente = str_replace('`', '&lsquo;', (string) get_parameter_post('agente', ''));
$alias = str_replace('`', '&lsquo;', (string) get_parameter_post('alias', ''));
$alias = trim (preg_replace('/[\/\\\|%#&$-]/', '',
html_entity_decode( str_replace('`','&lsquo;',(string) get_parameter_post ("alias", "")))));
$alias_as_name = (int) get_parameter_post('alias_as_name', 0);
$direccion_agente = (string) get_parameter_post('direccion', '');
$unique_ip = (int) get_parameter_post('unique_ip', 0);
@ -932,7 +934,7 @@ if ($update_agent) {
$result = db_process_sql_update('tagente', $values, ['id_agente' => $id_agente]);
if ($result == false && $update_custom_result == false) {
if ($result === false && $update_custom_result == false) {
ui_print_error_message(
__('There was a problem updating the agent')
);

View File

@ -1116,8 +1116,13 @@ switch ($action) {
$name_it = (string) get_parameter('name');
$values['name'] = reporting_label_macro($items_label, $name_it);
// Added support for projection graphs, prediction date and SLA reports
// 'top_n_value','top_n' and 'text' fields will be reused for these types of report
/*
Added support for projection graphs,
prediction date and SLA reports
'top_n_value','top_n' and 'text'
fields will be reused for these types of report
*/
switch ($values['type']) {
case 'projection_graph':
$values['period'] = get_parameter('period1');
@ -1127,7 +1132,8 @@ switch ($action) {
break;
case 'event_report_log':
$agents_to_report = get_parameter('id_agents2');
$agents_to_report = get_parameter('id_agents3');
$source = get_parameter('source', '');
$search = get_parameter('search', '');
$log_number = get_parameter('log_number', '');
@ -1525,7 +1531,7 @@ switch ($action) {
break;
case 'event_report_log':
$agents_to_report = get_parameter('id_agents2');
$agents_to_report = get_parameter('id_agents3');
$source = get_parameter('source', '');
$search = get_parameter('search', '');
$log_number = get_parameter('log_number', '');
@ -1632,17 +1638,6 @@ switch ($action) {
$values['server_name'] = get_parameter('combo_server');
}
if (is_metaconsole()) {
// For SQL Query check if it is setted in the meta
if ($values['type'] == 'sql') {
if (empty($values['server_name'])) {
$good_format = false;
}
}
}
$values['id_agent'] = get_parameter('id_agent');
$values['id_gs'] = get_parameter('id_custom_graph');
if (($values['type'] == 'alert_report_agent') or ($values['type'] == 'event_report_agent') or ($values['type'] == 'agent_configuration') or ($values['type'] == 'group_configuration')) {

View File

@ -231,6 +231,21 @@ function is_metaconsole() {
else return false;
}
function dialog_message(message_id) {
$(message_id)
.css("display", "inline")
.dialog({
modal: true,
show: "blind",
hide: "blind",
buttons: {
Close: function() {
$(this).dialog("close");
}
}
});
}
function update_button_palette_callback() {
var values = {};
@ -240,14 +255,11 @@ function update_button_palette_callback() {
switch (selectedItem) {
case "background":
if (values["width"] < 1024 || values["height"] < 768) {
alert("Min allowed size is 1024x768");
dialog_message("#message_min_allowed_size");
return false;
}
if (values["width"] == 0 && values["height"] == 0) {
values["width"] = $("#hidden-background_original_width").val();
values["height"] = $("#hidden-background_original_height").val();
}
$("#hidden-background_width").val(values["width"]);
$("#hidden-background_height").val(values["height"]);
$("#background").css("width", values["width"]);
$("#background").css("height", values["height"]);
@ -259,11 +271,25 @@ function update_button_palette_callback() {
break;
case "box_item":
if ($("input[name=width_box]").val() == "") {
alert("Undefined width");
dialog_message("#message_alert_no_width");
return false;
}
if (
parseInt($("input[name='width_box']").val()) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
return false;
}
if ($("input[name=height_box]").val() == "") {
alert("Undefined height");
dialog_message("#message_alert_no_height");
return false;
}
if (
parseInt($("input[name='height_box']").val()) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_height");
return false;
}
@ -288,7 +314,7 @@ function update_button_palette_callback() {
values["label"] == "" &&
values["show_statistics"] == false
) {
alert("Undefined image");
dialog_message("#message_alert_no_image");
return false;
}
@ -428,18 +454,32 @@ function update_button_palette_callback() {
break;
case "static_graph":
if ($("input[name=width]").val() == "") {
alert("Undefined width");
dialog_message("#message_alert_no_width");
return false;
}
if (
parseInt($("input[name='width']").val()) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
return false;
}
if ($("input[name=height]").val() == "") {
alert("Undefined height");
dialog_message("#message_alert_no_height");
return false;
}
if (
parseInt($("input[name='height']").val()) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_height");
return false;
}
if (
(values["image"] == "" || values["image"] == "none") &&
values["label"] == ""
) {
alert("Undefined image");
dialog_message("#message_alert_no_image");
return false;
}
@ -555,13 +595,27 @@ function update_button_palette_callback() {
break;
case "percentile_bar":
case "percentile_item":
if ($("input[name=width_percentile]").val() == "") {
alert("Undefined width");
if ($("input[name=height_percentile]").val() == "") {
dialog_message("#message_alert_no_height");
return false;
}
if ($("input[name=height_percentile]").val() == "") {
alert("Undefined height");
if ($("input[name=width_percentile]").val() == "") {
dialog_message("#message_alert_no_width");
return false;
}
if (
$("input[name=width_percentile]").val() >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
return false;
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
return false;
}
if (values["agent"] == "") {
dialog_message("#message_alert_no_agent");
return false;
}
@ -604,7 +658,6 @@ function update_button_palette_callback() {
return false;
}
}
if ($("#dir_items").html() == "vertical") {
if (
parseInt($("#text-top").val()) +
@ -621,20 +674,41 @@ function update_button_palette_callback() {
return false;
}
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
return false;
}
if (values["agent"] == "") {
dialog_message("#message_alert_no_agent");
return false;
}
if ($("input[name=width_module_graph]").val() == "") {
alert("Undefined width");
dialog_message("#message_alert_no_width");
return false;
}
if ($("input[name=height_module_graph]").val() == "") {
alert("Undefined height");
dialog_message("#message_alert_no_height");
return false;
}
if (
parseInt(values["width_module_graph"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
return false;
}
if (
parseInt($("input[name=height_module_graph]").val()) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
return false;
}
if (
$("#custom_graph_row").css("display") != "none" &&
$("#custom_graph option:selected").html() == "None"
) {
alert("Undefined graph");
dialog_message("#message_alert_no_custom_graph");
return false;
}
@ -644,12 +718,19 @@ function update_button_palette_callback() {
break;
case "bars_graph":
if ($("input[name=width_percentile]").val() == "") {
alert("Undefined width");
dialog_message("#message_alert_no_width");
return false;
}
if ($("input[name=bars_graph_height]").val() == "") {
alert("Undefined height");
dialog_message("#message_alert_no_height");
return false;
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
return false;
}
if (values["agent_string"] == "") {
dialog_message("#message_alert_no_agent");
return false;
}
@ -660,18 +741,48 @@ function update_button_palette_callback() {
break;
case "clock":
if (
parseInt(values["width_percentile"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
return false;
}
$("#text_" + idItem).html(values["label"]);
$("#image_" + idItem).attr("src", "images/spinner.gif");
setClock(idItem, values);
break;
case "auto_sla_graph":
if ($("input[name=width]").val() == "") {
alert("Undefined width");
if (values["height"] == "") {
dialog_message("#message_alert_no_height");
return false;
}
if ($("input[name=height]").val() == "") {
alert("Undefined height");
if (
parseInt(values["height"]) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
return false;
}
if (values["width"] == "") {
dialog_message("#message_alert_no_width");
return false;
}
if (
parseInt(values["width"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
return false;
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
return false;
}
if (values["agent"] == "") {
dialog_message("#message_alert_no_agent");
return false;
}
$("#text_" + idItem).html(values["label"]);
@ -680,8 +791,22 @@ function update_button_palette_callback() {
setEventsBar(idItem, values);
break;
case "donut_graph":
if (
parseInt(values["width_percentile"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
return false;
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module_string_type");
return false;
}
if (values["agent_string"] == "") {
dialog_message("#message_alert_no_agent");
return false;
}
$("#image_" + idItem).attr("src", "images/spinner.gif");
setDonutsGraph(idItem, values);
break;
case "simple_value":
@ -718,21 +843,47 @@ function update_button_palette_callback() {
"</span></td></tr><tr><td></td></tr></tbody></table>"
);
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
return false;
}
if (values["agent"] == "") {
dialog_message("#message_alert_no_agent");
return false;
}
break;
case "label":
if (values["label"] == "") {
dialog_message("#message_alert_no_label");
return false;
}
$("#text_" + idItem).html(values["label"]);
break;
case "icon":
if ($("input[name=width]").val() == "") {
alert("Undefined width");
dialog_message("#message_alert_no_width");
return false;
}
if (
parseInt($("input[name=width]").val()) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
return false;
}
if ($("input[name=height]").val() == "") {
alert("Undefined height");
dialog_message("#message_alert_no_height");
return false;
}
if (
parseInt($("input[name=height]").val()) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
return false;
}
if (values["image"] == "" || values["image"] == "none") {
alert("Undefined image");
dialog_message("#message_alert_no_image");
return false;
}
$("#image_" + idItem).attr("src", "images/spinner.gif");
@ -779,13 +930,70 @@ function update_button_palette_callback() {
var image = values["image"] + ".png";
set_image("image", idItem, image);
break;
case "line_item":
if (
parseInt(values["line_width"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
return false;
}
break;
case "color_cloud":
if (
parseInt(values["diameter"]) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
return false;
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
return false;
}
if (values["agent"] == "") {
dialog_message("#message_alert_no_agent");
return false;
}
break;
case "service":
if (values["height"] == "" || values["height_module_graph"] == 0) {
dialog_message("#message_alert_no_height");
return false;
}
if (
parseInt(values["height"]) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
return false;
}
if (values["width"] == "" || values["width_module_graph"] == 0) {
dialog_message("#message_alert_no_width");
return false;
}
if (
parseInt(values["width"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
return false;
}
if (
$("select[name=service]").val() == "" ||
$("select[name=service]").val() == "none"
) {
dialog_message("#message_alert_no_service");
return false;
}
break;
default:
if ($("input[name=width]").val() == "") {
alert("Undefined width");
dialog_message("#message_alert_no_width");
return false;
}
if ($("input[name=height]").val() == "") {
alert("Undefined height");
dialog_message("#message_alert_no_height");
return false;
}
//Maybe save in any Enterprise item.
@ -1018,149 +1226,356 @@ function create_button_palette_callback() {
switch (creationItem) {
case "box_item":
if ($("input[name='width_box']").val() == "") {
alert("Undefined width");
dialog_message("#message_alert_no_width");
validate = false;
}
if (
parseInt($("input[name='width_box']").val()) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
if ($("input[name='height_box']").val() == "") {
alert("Undefined height");
dialog_message("#message_alert_no_height");
validate = false;
}
if (
parseInt($("input[name='height_box']").val()) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
validate = false;
}
break;
case "group_item":
if (values["height"] == "") {
dialog_message("#message_alert_no_height");
validate = false;
}
if (
parseInt(values["height"]) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
validate = false;
}
if (values["width"] == "") {
dialog_message("#message_alert_no_width");
validate = false;
}
if (
parseInt(values["width"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
if (
(values["image"] == "" || values["image"] == "none") &&
values["label"] == "" &&
values["show_statistics"] == false
) {
alert("Undefined images");
dialog_message("#message_alert_no_image");
validate = false;
}
break;
case "static_graph":
if (values["width"] == "") {
alert("Undefined width");
if (values["height"] == "") {
dialog_message("#message_alert_no_height");
validate = false;
}
if (values["height"] == "") {
alert("Undefined height");
if (
parseInt(values["height"]) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
validate = false;
}
if (values["width"] == "") {
dialog_message("#message_alert_no_width");
validate = false;
}
if (
parseInt(values["width"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
if (
(values["image"] == "" || values["image"] == "none") &&
values["label"] == false
) {
alert("Undefined image");
dialog_message("#message_alert_no_image");
validate = false;
}
break;
case "auto_sla_graph":
if (values["height"] == "") {
dialog_message("#message_alert_no_height");
validate = false;
}
if (
parseInt(values["height"]) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
validate = false;
}
if (values["width"] == "") {
dialog_message("#message_alert_no_width");
validate = false;
}
if (
parseInt(values["width"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
validate = false;
}
if (values["agent"] == "") {
alert($("#message_alert_no_agent").html());
dialog_message("#message_alert_no_agent");
validate = false;
}
break;
case "donut_graph":
if (
parseInt(values["width_percentile"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module_string_type");
validate = false;
}
if (values["agent_string"] == "") {
alert($("#message_alert_no_agent").html());
dialog_message("#message_alert_no_agent");
validate = false;
}
break;
case "label":
if (values["label"] == "") {
alert($("#message_alert_no_label").html());
dialog_message("#message_alert_no_label");
validate = false;
}
break;
case "icon":
if (values["width"] == "") {
alert("Undefined width");
dialog_message("#message_alert_no_width");
validate = false;
}
if (
parseInt(values["width"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
if (values["height"] == "") {
alert("Undefined height");
dialog_message("#message_alert_no_height");
validate = false;
}
if (
parseInt(values["height"]) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
validate = false;
}
if (values["image"] == "" || values["image"] == "none") {
alert($("#message_alert_no_image").html());
dialog_message("#message_alert_no_image");
validate = false;
}
break;
case "percentile_bar":
case "percentile_item":
if (values["width"] == "") {
alert("Undefined width");
validate = false;
}
if (values["agent"] == "") {
alert($("#message_alert_no_agent").html());
validate = false;
}
if (values["module"] == 0) {
alert($("#message_alert_no_module").html());
validate = false;
}
if (values["max_percentile"] == "") {
alert($("#message_alert_no_max_percentile").html());
if (
parseInt(values["width_percentile"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
if (values["width_percentile"] == "") {
alert($("#message_alert_no_width_percentile").html());
dialog_message("#message_alert_no_width");
validate = false;
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
validate = false;
}
if (values["agent"] == "") {
dialog_message("#message_alert_no_agent");
validate = false;
}
if (values["max_percentile"] == "") {
dialog_message("#message_alert_no_max_percentile");
validate = false;
}
break;
case "module_graph":
if (values["width_module_graph"] == "") {
alert("Undefined width");
validate = false;
}
if (values["height_module_graph"] == "") {
alert("Undefined height");
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
validate = false;
}
if (values["id_custom_graph"] == 0) {
if (values["agent"] == "") {
alert($("#message_alert_no_agent").html());
validate = false;
}
if (values["module"] == 0) {
alert($("#message_alert_no_module").html());
dialog_message("#message_alert_no_agent");
validate = false;
}
if (values["period"] == 0) {
alert($("#message_alert_no_period").html());
dialog_message("#message_alert_no_period");
validate = false;
}
}
break;
case "bars_graph":
if (values["agent_string"] == "") {
alert($("#message_alert_no_agent").html());
if (
values["height_module_graph"] == "" ||
values["height_module_graph"] == 0
) {
dialog_message("#message_alert_no_height");
validate = false;
}
if (values["module"] == 0) {
alert($("#message_alert_no_module").html());
if (
parseInt(values["height_module_graph"]) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
validate = false;
}
if (
values["width_module_graph"] == "" ||
values["width_module_graph"] == 0
) {
dialog_message("#message_alert_no_width");
validate = false;
}
if (
parseInt(values["width_module_graph"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
break;
case "bars_graph":
if (values["bars_graph_height"] == "") {
dialog_message("#message_alert_no_height");
validate = false;
}
if (
parseInt(values["bars_graph_height"]) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
validate = false;
}
if (values["width_percentile"] == "") {
alert($("#message_alert_no_width_percentile").html());
dialog_message("#message_alert_no_width");
validate = false;
}
if (values["bars_graph_height"] == "") {
alert($("#message_alert_no_bars_graph_height").html());
if (
parseInt(values["width_percentile"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
validate = false;
}
if (values["agent_string"] == "") {
dialog_message("#message_alert_no_agent");
validate = false;
}
break;
case "simple_value":
if (values["agent"] == "") {
alert($("#message_alert_no_agent").html());
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
validate = false;
}
if (values["module"] == 0) {
alert($("#message_alert_no_module").html());
if (values["agent"] == "") {
dialog_message("#message_alert_no_agent");
validate = false;
}
break;
case "clock":
if (
parseInt(values["width_percentile"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
break;
case "line_item":
if (
parseInt(values["line_width"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
break;
case "color_cloud":
if (
parseInt(values["diameter"]) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
validate = false;
}
if (values["module"] == 0) {
dialog_message("#message_alert_no_module");
validate = false;
}
if (values["agent"] == "") {
dialog_message("#message_alert_no_agent");
validate = false;
}
break;
case "service":
if (values["height"] == "" || values["height_module_graph"] == 0) {
dialog_message("#message_alert_no_height");
validate = false;
}
if (
parseInt(values["height"]) >
parseInt($("#hidden-background_height").val())
) {
dialog_message("#message_alert_max_height");
validate = false;
}
if (values["width"] == "" || values["width_module_graph"] == 0) {
dialog_message("#message_alert_no_width");
validate = false;
}
if (
parseInt(values["width"]) >
parseInt($("#hidden-background_width").val())
) {
dialog_message("#message_alert_max_width");
validate = false;
}
if (
$("select[name=service]").val() == "" ||
$("select[name=service]").val() == "none"
) {
dialog_message("#message_alert_no_service");
validate = false;
}
break;
default:
//Maybe save in any Enterprise item.
if (typeof enterprise_create_button_palette_callback == "function") {
@ -3714,17 +4129,7 @@ function createItem(type, values, id_data) {
.attr("height", values["height"]);
}
}
// else{
// $('#image_'+id_data).css('width', values['width']+'px');
// $('#image_'+id_data).css('height', values['height']+'px');
// }
/*
var $span = $('<span></span>')
.attr('id', 'text_' + id_data)
.attr('class', 'text')
.append(values['label']);
*/
var $input = $("<input></input>")
.attr("id", "hidden-status_" + id_data)
.attr("type", "hidden")
@ -4489,7 +4894,6 @@ function createItem(type, values, id_data) {
case "clock":
sizeStyle = "";
imageSize = "";
if (values["label_position"] == "up") {
item = $(
'<div id="' +

View File

@ -665,6 +665,20 @@ $table_other->data[12][1] = html_print_input_text(
true
);
$table_other->data[13][0] = __('Events response max. execution');
$table_other->data[13][0] .= ui_print_help_tip(
__('Number of events that will perform the desired action at the same time'),
true
);
$table_other->data[13][1] = html_print_input_text(
'max_execution_event_response',
$config['max_execution_event_response'],
'',
5,
5,
true
);
echo '<form id="form_setup" method="post">';
echo '<fieldset>';

View File

@ -134,7 +134,8 @@ if (is_ajax()) {
set_unless_defined($config['double_auth_enabled'], false);
$row = [];
$row['name'] = __('Double authentication').ui_print_help_tip(__('If this option is enabled, the users can use double authentication with their accounts'), true);
$row['control'] = html_print_checkbox_toogle_switch('double_auth_enabled', 1, $config['double_auth_enabled'], true);
$row['control'] = html_print_input_hidden('double_auth_enabled', 0);
$row['control'] .= html_print_checkbox_toogle_switch('double_auth_enabled', 1, $config['double_auth_enabled'], true);
$table->data['double_auth_enabled'] = $row;
// Session timeout

View File

@ -751,7 +751,7 @@ if ($create_alert || $update_alert) {
// echo '<tr><td class="datos"><b>' . __('Alert filters') . ui_print_help_icon("snmp_alert_filters", true) . '</b></td></tr>';
// OID
echo '<tr id="tr-oid">'.'<td class="datos2">'.__('Enterprise String').'</td>'.'<td class="datos2">';
echo '<tr id="tr-oid">'.'<td class="datos2">'.__('Enterprise String').ui_print_help_tip (__('Matches substrings. End the string with $ for exact matches.'), true).'</td>'.'<td class="datos2">';
html_print_input_text('oid', $oid, '', 50, 255);
echo '</td></tr>';

View File

@ -90,9 +90,9 @@ if ($get_response_params) {
}
if ($get_response_target) {
$response_id = get_parameter('response_id');
$event_id = get_parameter('event_id');
$server_id = get_parameter('server_id', 0);
$response_id = (int) get_parameter('response_id');
$event_id = (int) get_parameter('event_id');
$server_id = (int) get_parameter('server_id');
$event_response = db_get_row('tevent_response', 'id', $response_id);
@ -101,7 +101,6 @@ if ($get_response_target) {
}
echo events_get_response_target($event_id, $response_id, $server_id);
return;
}

View File

@ -88,16 +88,13 @@ if (file_exists('languages/'.$user_language.'.mo')) {
$params['menu'] = false;
if ((!isset($params['width']) || ($params['width'] <= 0))) {
$params['width'] = 1048;
$params['width'] = 650;
}
$params_combined = json_decode($_REQUEST['data_combined'], true);
$module_list = json_decode($_REQUEST['data_module_list'], true);
$type_graph_pdf = $_REQUEST['type_graph_pdf'];
$aux_font_size = $config['font_size'];
$config['font_size'] = ($config['font_size'] + 3);
echo '<div>';
switch ($type_graph_pdf) {
case 'combined':
@ -216,7 +213,6 @@ if (file_exists('languages/'.$user_language.'.mo')) {
echo '</div>';
$config['font_size'] = $aux_font_size;
?>
<script type="text/javascript">

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC190219';
$build_version = 'PC190221';
$pandora_version = 'v7.0NG.731';
// Do not overwrite default timezone set if defined.

View File

@ -3102,7 +3102,7 @@ function select_agents_for_module_group(
'AND',
'tagente_modulo',
true,
[],
$filter['tags'],
false
);
$sql_tags_inner = 'INNER JOIN ttag_module

View File

@ -739,6 +739,10 @@ function config_update_config()
if (!config_update_value('max_graph_container', get_parameter('max_graph_container'))) {
$error_update[] = __('Graph container - Max. Items');
}
if (!config_update_value('max_execution_event_response', get_parameter('max_execution_event_response'))) {
$error_update[] = __('Max. execution event response');
}
break;
case 'vis':
@ -1517,6 +1521,10 @@ function config_process_config()
config_update_value('max_graph_container', 10);
}
if (!isset($config['max_execution_event_response'])) {
config_update_value('max_execution_event_response', 10);
}
if (!isset($config['max_macro_fields'])) {
config_update_value('max_macro_fields', 10);
}

View File

@ -37,7 +37,7 @@ function events_get_all_fields()
$columns['estado'] = __('Status');
$columns['timestamp'] = __('Timestamp');
$columns['event_type'] = __('Event type');
$columns['id_agentmodule'] = __('Agent module');
$columns['id_agentmodule'] = __('Module name');
$columns['id_alert_am'] = __('Alert');
$columns['criticity'] = __('Severity');
$columns['user_comment'] = __('Comment');
@ -2089,27 +2089,34 @@ function events_page_responses($event, $childrens_ids=[])
}
// Replace macros in the target of a response and return it
// If server_id > 0, is a metaconsole query
function events_get_response_target($event_id, $response_id, $server_id, $history=false)
{
/**
* Replace macros in the target of a response and return it.
* If server_id > 0, it's a metaconsole query.
*
* @param integer $event_id Event identifier.
* @param integer $response_id Event response identifier.
* @param integer $server_id Node identifier (for metaconsole).
* @param boolean $history Use the history database or not.
*
* @return string The response text with the macros applied.
*/
function events_get_response_target(
int $event_id,
int $response_id,
int $server_id=0,
bool $history=false
) {
global $config;
$event_response = db_get_row('tevent_response', 'id', $response_id);
if ($server_id > 0) {
$meta = true;
} else {
$meta = false;
}
// If server_id > 0, it's a metaconsole query.
$meta = $server_id > 0;
$event_table = events_get_events_table($meta, $history);
$event = db_get_row($event_table, 'id_evento', $event_id);
$event_response = db_get_row('tevent_response', 'id', $response_id);
$target = io_safe_output($event_response['target']);
// Substitute each macro
// Substitute each macro.
if (strpos($target, '_agent_address_') !== false) {
if ($meta) {
$agente_table_name = 'tmetaconsole_agent';
@ -2123,7 +2130,7 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor
}
$ip = db_get_value_filter('direccion', $agente_table_name, $filter);
// If agent has not an ip, display N/A
// If agent has not an IP, display N/A.
if ($ip === false) {
$ip = __('N/A');
}
@ -2288,7 +2295,7 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor
$target = str_replace('_group_custom_id_', $group_custom_id, $target);
}
// Parse the event custom data
// Parse the event custom data.
if (!empty($event['custom_data'])) {
$custom_data = json_decode(base64_decode($event['custom_data']));
foreach ($custom_data as $key => $value) {
@ -2296,6 +2303,11 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor
}
}
// This will replace the macro with the current logged user.
if (strpos($target, '_current_user_') !== false) {
$target = str_replace('_current_user_', $config['id_user'], $target);
}
return $target;
}

View File

@ -126,6 +126,12 @@ if (isset($config['homedir_filemanager'])) {
$homedir_filemanager = $config['homedir'];
}
$sec2 = get_parameter('sec2');
if ($sec2 == 'enterprise/godmode/agentes/collections') {
$homedir_filemanager .= '/attachment/collection/';
}
$upload_file_or_zip = (bool) get_parameter('upload_file_or_zip');
if ($upload_file_or_zip) {
@ -499,12 +505,6 @@ function filemanager_file_explorer(
$homedir_filemanager = $config['homedir'];
}
unset($config['homedir_filemanager']);
config_update_value(
'homedir_filemanager',
$homedir_filemanager
);
$hack_metaconsole = '';
if (defined('METACONSOLE')) {
$hack_metaconsole = '../../';
@ -938,4 +938,3 @@ function filemanager_list_dir($dirpath)
return array_merge($dirs, $files);
}

View File

@ -245,7 +245,9 @@ function grafico_modulo_sparse_data(
}
}
if ($array_data === false || (!$params['graph_combined'] && !isset($array_data['sum1']['data'][0][1]))) {
if ($array_data === false || (!$params['graph_combined']
&& !isset($array_data['sum1']['data'][0][1]) && !$params['baseline'])
) {
return false;
}
@ -4918,21 +4920,19 @@ function get_baseline_data($agent_module_id, $date_array, $data_module_graph, $p
$period = $date_array['period'];
$date = $date_array['final_date'];
$array_data = [];
for ($i = 0; $i < 4; $i++) {
$date_array = [];
$date_array['period'] = $period;
$date_array['final_date'] = ($date - $period * $i);
$date_array['start_date'] = ($date - $period * ($i + 1));
$data = grafico_modulo_sparse_data(
$date_array['final_date'] = ($date - ($period * $i));
$date_array['start_date'] = ($date - ($period * ($i + 1)));
$array_data[] = grafico_modulo_sparse_data(
$agent_module_id,
$date_array,
$data_module_graph,
$params,
$i
);
$array_data[] = $data;
}
$result = [];

View File

@ -1822,35 +1822,35 @@ function html_get_predefined_table($model='transparent', $columns=4)
* Print a nicely formatted table. Code taken from moodle.
*
* @param object Object with several properties:
* $table->head - An array of heading names.
* $table->head_colspan - An array of colspans of each head column.
* $table->headstyle - An array of styles of each head column.
* $table->align - An array of column alignments
* $table->valign - An array of column alignments
* $table->size - An array of column sizes
* $table->wrap - An array of "nowrap"s or nothing
* $table->style - An array of personalized style for each column.
* $table->rowid - An array of personalized ids of each row.
* $table->rowstyle - An array of personalized style of each row.
* $table->rowclass - An array of personalized classes of each row (odd-evens classes will be ignored).
* $table->colspan - An array of colspans of each column.
* $table->rowspan - An array of rowspans of each column.
* $table->data[] - An array of arrays containing the data.
* $table->width - A percentage of the page
* $table->border - Border of the table.
* $table->tablealign - Align the whole table (float left or right)
* $table->cellpadding - Padding on each cell
* $table->cellspacing - Spacing between cells
* $table->cellstyle - Style of a cell
* $table->cellclass - Class of a cell
* $table->class - CSS table class
* $table->id - Table ID (useful in JavaScript)
* $table->headclass[] - An array of classes for each heading
* $table->title - Title of the table is a single string that will be on top of the table in the head spanning the whole table
* $table->titlestyle - Title style
* $table->titleclass - Title class
* $table->styleTable - Table style
* $table->caption - Table title
* $table->head - An array of heading names.
* $table->head_colspan - An array of colspans of each head column.
* $table->headstyle - An array of styles of each head column.
* $table->align - An array of column alignments
* $table->valign - An array of column alignments
* $table->size - An array of column sizes
* $table->wrap - An array of "nowrap"s or nothing
* $table->style - An array of personalized style for each column.
* $table->rowid - An array of personalized ids of each row.
* $table->rowstyle - An array of personalized style of each row.
* $table->rowclass - An array of personalized classes of each row (odd-evens classes will be ignored).
* $table->colspan - An array of colspans of each column.
* $table->rowspan - An array of rowspans of each column.
* $table->data[] - An array of arrays containing the data.
* $table->width - A percentage of the page
* $table->border - Border of the table.
* $table->tablealign - Align the whole table (float left or right)
* $table->cellpadding - Padding on each cell
* $table->cellspacing - Spacing between cells
* $table->cellstyle - Style of a cell
* $table->cellclass - Class of a cell
* $table->class - CSS table class
* $table->id - Table ID (useful in JavaScript)
* $table->headclass[] - An array of classes for each heading
* $table->title - Title of the table is a single string that will be on top of the table in the head spanning the whole table
* $table->titlestyle - Title style
* $table->titleclass - Title class
* $table->styleTable - Table style
* $table->caption - Table title
* @param bool Whether to return an output string or echo now
*
* @return string HTML code if return parameter is true.

View File

@ -142,7 +142,6 @@ function reporting_make_reporting_data(
enterprise_include_once('include/functions_metaconsole.php');
$return = [];
if (!empty($report)) {
$contents = $report['contents'];
} else {
@ -261,7 +260,7 @@ function reporting_make_reporting_data(
}
if (isset($content['style']['name_label'])) {
// Add macros name
// Add macros name.
$items_label = [];
$items_label['type'] = $content['type'];
$items_label['id_agent'] = $content['id_agent'];
@ -272,11 +271,10 @@ function reporting_make_reporting_data(
$metaconsole_on = is_metaconsole();
$server_name = $content['server_name'];
// Metaconsole connection
// Metaconsole connection.
if ($metaconsole_on && $server_name != '') {
$connection = metaconsole_get_connection($server_name);
if (!metaconsole_load_external_db($connection)) {
// ui_print_error_message ("Error connecting to ".$server_name);
continue;
}
}
@ -889,7 +887,6 @@ function reporting_SLA(
if ($metaconsole_on && $server_name != '') {
$connection = metaconsole_get_connection($server_name);
if (!metaconsole_load_external_db($connection)) {
// ui_print_error_message ("Error connecting to ".$server_name);
continue;
}
}
@ -898,7 +895,7 @@ function reporting_SLA(
|| modules_is_not_init($sla['id_agent_module'])
) {
if ($metaconsole_on) {
// Restore db connection
// Restore db connection.
metaconsole_restore_db();
}
@ -6794,7 +6791,6 @@ function reporting_general($report, $content)
if (!is_numeric($data_res[$index])) {
$return['data'][$ag_name][$mod_name] = $data_res[$index];
} else {
hd($data_res[$index], true);
$return['data'][$ag_name][$mod_name] = format_for_graph($data_res[$index], 2).' '.$unit;
}
}
@ -11336,3 +11332,27 @@ function reporting_translate_sla_status_for_graph($status)
];
return $sts[$status];
}
/**
* Print header to report pdf and add page break
*
* @param string $title Title of report.
* @param string $description Description of report.
*
* @return html Return table of header.
*/
function reporting_header_table_for_pdf(string $title='', string $description='')
{
$result_pdf .= '<pagebreak>';
$result_pdf .= '<table class="header_table databox">';
$result_pdf .= '<thead class="header_tr"><tr>';
$result_pdf .= '<th class="th_first" colspan="2">';
$result_pdf .= $title;
$result_pdf .= '</th><th style="font-size: 15px;" align="right">';
$result_pdf .= '</th></tr><tr><th colspan="3" class="th_description">';
$result_pdf .= $description;
$result_pdf .= '</th></tr></thead></table>';
return $result_pdf;
}

File diff suppressed because it is too large Load Diff

View File

@ -748,7 +748,7 @@ function tags_get_acl_tags(
$id_user = $config['id_user'];
}
if (is_user_admin($id_user)) {
if (is_user_admin($id_user) && empty($childrens_ids)) {
switch ($return_mode) {
case 'data':
return [];
@ -797,7 +797,8 @@ function tags_get_acl_tags(
// Return the condition of the tags for tagente_modulo table
$condition = tags_get_acl_tags_module_condition(
$acltags,
$query_table
$query_table,
empty($childrens_ids) ? [] : $childrens_ids
);
if (!empty($condition)) {
return " $query_prefix ".$condition;
@ -825,7 +826,7 @@ function tags_get_acl_tags(
*
* @return string SQL condition for tagente_module
*/
function tags_get_acl_tags_module_condition($acltags, $modules_table='')
function tags_get_acl_tags_module_condition($acltags, $modules_table='', $force_tags=[])
{
if (!empty($modules_table)) {
$modules_table .= '.';
@ -839,6 +840,17 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table='')
// The acltags array contains the groups with the acl propagation applied
// after the changes done into the 'tags_get_user_groups_and_tags' function.
foreach ($acltags as $group_id => $group_tags) {
if (empty($group_tags)) {
$group_tags = [];
if (!empty($force_tags)) {
$group_tags = $force_tags;
}
}
if (!empty($group_tags)) {
$group_tags = array_intersect($force_tags, $group_tags);
}
$tag_join = '';
if (!empty($group_tags)) {
$tag_join = sprintf('AND ttag_module.id_tag IN (%s)', is_array($group_tags) ? implode(',', $group_tags) : $group_tags);
@ -849,7 +861,7 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table='')
}
$group_conditions[] = $agent_condition;
} else {
} else if (!empty($force_tags)) {
$without_tags[] = $group_id;
}
}

View File

@ -1313,20 +1313,79 @@ function visual_map_editor_print_hack_translate_strings()
echo '<span id="any_text" style="display: none;">'.__('Any').'</span>';
echo '<span id="ip_text" style="display: none;">'.__('IP').'</span>';
// Hack to translate messages in javascript
echo '<span style="display: none" id="message_alert_no_label_no_image">'.__('No image or name defined.').'</span>';
echo '<span style="display: none" id="message_alert_no_label">'.__('No label defined.').'</span>';
echo '<span style="display: none" id="message_alert_no_image">'.__('No image defined.').'</span>';
echo '<span style="display: none" id="message_alert_no_process">'.__('No process defined.').'</span>';
echo '<span style="display: none" id="message_alert_no_max_percentile">'.__('No Max value defined.').'</span>';
echo '<span style="display: none" id="message_alert_no_width_percentile">'.__('No width defined.').'</span>';
echo '<span style="display: none" id="message_alert_no_bars_graph_height">'.__('No height defined.').'</span>';
echo '<span style="display: none" id="message_alert_no_period">'.__('No period defined.').'</span>';
echo '<span style="display: none" id="message_alert_no_agent">'.__('No agent defined.').'</span>';
echo '<span style="display: none" id="message_alert_no_module">'.__('No module defined.').'</span>';
// Hack to translate messages in javascript.
echo "<div id='message_min_allowed_size' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('Min allowed size is 1024x768.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_custom_graph' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No custom graph defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_label_no_image' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No image or name defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_label' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No label defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_service' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No service defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_image' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No image defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_process' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No process defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_max_percentile' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No Max value defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_width' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No width defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_height' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No height defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_max_width' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('The width must not exceed the size of the visual console container.').'</p>';
echo '</div>';
echo "<div id='message_alert_max_height' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('The height must not exceed the size of the visual console container.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_period' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No period defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_agent' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No agent defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_module' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No module defined.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_module_string_type' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No module defined. This module must be string type.').'</p>';
echo '</div>';
echo "<div id='hack_translation_correct_save' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('Successfully save the changes.').'</p>';
echo '</div>';
echo "<div id='hack_translation_incorrect_save' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('Could not be save.').'</p>';
echo '</div>';
echo '<span style="display: none" id="hack_translation_correct_save">'.__('Successfully save the changes.').'</span>';
echo '<span style="display: none" id="hack_translation_incorrect_save">'.__('Could not be save').'</span>';
}

View File

@ -856,6 +856,7 @@ function pandoraFlotSlicebar(
}
var font_size = parseInt(font_size);
if (font != undefined)
var font = font
.split("/")
.pop()

View File

@ -32,7 +32,8 @@ The accepted macros are:
<li><b>Event associated module name:</b> _module_name_</li>
<li><b>Event owner user:</b> _owner_user_</li>
<li><b>User ID:</b> _user_id_</li>
</ul>
<li><b>Id of the user who fires the response:</b> _current_user_</li>
</ul>
<h4>Custom fields</h4>

View File

@ -33,6 +33,7 @@ Las macros aceptadas son las siguientes:
<li><b>Nombre del módulo asociado al evento:</b> _module_name_</li>
<li><b>Usuario propietario del evento:</b> _owner_user_</li>
<li><b>Id del usuario:</b> _user_id_</li>
<li><b>Id del usuario que ejecuta la respuesta:</b> _current_user_</li>
</ul>
<h4>Campos personalizados</h4>

View File

@ -32,6 +32,7 @@
<li><b>Event associated module name:</b> _module_name_</li>
<li><b>Event owner user:</b> _owner_user_</li>
<li><b>User ID:</b> _user_id_</li>
<li><b>Id of the user who fires the response:</b> _current_user_</li>
</ul>
<h4>Custom fields</h4>

View File

@ -503,6 +503,14 @@ function module_changed_by_multiple_modules(event, id_module, selected) {
selection_mode = "common";
}
var tags_selected = [];
var tags_to_search = $("#tags").val();
if (tags_to_search != null) {
if (tags_to_search[0] != -1) {
tags_selected = tags_to_search;
}
}
jQuery.post(
"ajax.php",
{
@ -510,7 +518,8 @@ function module_changed_by_multiple_modules(event, id_module, selected) {
get_agents_json_for_multiple_modules: 1,
status_module: status_module,
"module_name[]": idModules,
selection_mode: selection_mode
selection_mode: selection_mode,
tags: tags_selected
},
function(data) {
$("#agents").append(

View File

@ -1,24 +1,30 @@
/*
Author: The Pandora FMS team
Name: Default theme
Description: The default Pandora FMS theme layout
// Pandora FMS - http://pandorafms.com
// ==========================================================
// Copyright (c) 2004-2019 Artica Soluciones Tecnológicas S.L
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Extensions
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
/* Tree view styles */
/*@import url(tree.css);
@ -2053,82 +2059,58 @@ div#logo_text3 {
/* TABLAS */
/* Cells divs to set individual styles with the table objects */
div.cellBold {
width: 100%;
height: 100%;
td.cellBold {
font-weight: bold;
}
div.cellRight {
width: 100%;
height: 100%;
td.cellRight {
text-align: right;
}
div.cellCenter {
width: 100%;
height: 100%;
td.cellCenter {
text-align: center;
}
div.cellWhite {
width: 100%;
height: 100%;
td.cellWhite {
background: #fff;
color: #111;
}
div.cellNormal {
width: 100%;
height: 100%;
td.cellNormal {
background: #6eb432;
color: #fff;
}
div.cellCritical {
width: 100%;
height: 100%;
td.cellCritical {
background: #f85858;
color: #fff;
}
div.cellWarning {
width: 100%;
height: 100%;
td.cellWarning {
background: #ffea59;
color: #111;
}
div.cellUnknown {
width: 100%;
height: 100%;
td.cellUnknown {
background: #aaaaaa;
color: #ffffff;
}
div.cellNotInit {
width: 100%;
height: 100%;
td.cellNotInit {
background: #3ba0ff;
color: #ffffff;
}
div.cellAlert {
width: 100%;
height: 100%;
td.cellAlert {
background: #ff8800;
color: #111;
}
div.cellBorder1 {
width: 100%;
height: 100%;
td.cellBorder1 {
border: 1px solid #666;
}
div.cellBig {
width: 100%;
height: 100%;
td.cellBig {
font-size: 18px;
}
@ -4561,4 +4543,4 @@ input:checked + .slider:before {
.no-close .ui-dialog-titlebar-close {
display: none;
}
/* jQuery dialog */
/* --- END - JQUERY-UI --- */

View File

@ -0,0 +1,78 @@
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Extensions
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
table.header_table {
width: 100%;
}
table.header_table thead tr th,
table.header_table tbody tr td {
padding: 10px;
}
thead.header_tr tr {
background: #e6e6e6;
}
thead.header_tr tr th {
font-weight: normal;
text-align: right;
}
thead.header_tr tr th.th_first {
font-weight: bold;
text-align: left;
}
thead.header_tr tr th.th_description {
background-color: #f5f5f5;
color: #1c1c1c;
text-align: justify;
}
table.table_beauty {
border-collapse: collapse;
width: 100%;
}
table.table_beauty tbody tr td {
padding: 5px;
border: 0.1pt solid #acacac;
}
table.databox {
margin-bottom: 20px;
}
th.title_table_pdf {
background-color: #acacac;
padding: 15px;
}
table.table_agent_module tr td {
padding: 5px;
}

View File

@ -1363,4 +1363,3 @@ require 'include/php_to_js_values.php';
if (__PAN_XHPROF__ === 1) {
pandora_xhprof_display_result('node_index');
}

View File

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.731';
$build = '190219';
$build = '190221';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -202,11 +202,14 @@ if (is_ajax()) {
$nameModules = get_parameter('module_name');
$selection_mode = get_parameter('selection_mode', 'common') == 'all';
$status_modulo = (int) get_parameter('status_module', -1);
$tags_selected = (array) get_parameter('tags', []);
$names = select_agents_for_module_group(
$nameModules,
$selection_mode,
['status' => $status_modulo],
[
'status' => $status_modulo,
'tags' => $tags_selected,
],
'AW'
);

View File

@ -983,7 +983,11 @@ if ($group_rep == 2) {
html_print_button(__('Execute event response'), 'submit_event_response', false, 'execute_event_response(true);', 'class="sub next"');
echo "<span id='response_loading_dialog' style='display:none'>".html_print_image('images/spinner.gif', true).'</span>';
echo '</form>';
echo '<span id="max_custom_event_resp_msg" style="display:none; color:#FC4444; line-height: 200%;">'.__('A maximum of 10 event custom responses can be selected').'</span>';
echo '<span id="max_custom_event_resp_msg" style="display:none; color:#FC4444; line-height: 200%;">';
echo __(
'A maximum of %s event custom responses can be selected',
$config['max_execution_event_response']
).'</span>';
echo '</div>';
}
}
@ -1012,7 +1016,7 @@ if ($group_rep == 2) {
var total_checked = $(".chk_val:checked").length;
// Limit number of events to apply custom responses to for performance reasons
if (total_checked > 10) {
if (total_checked > <?php echo $config['max_execution_event_response']; ?> ) {
$('#max_custom_event_resp_msg').show();
return;
}
@ -1022,18 +1026,22 @@ if ($group_rep == 2) {
$('#response_loading_dialog').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);
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);
show_massive_response_dialog(
event_id,
response_id,
response,
counter,
end
);
counter++;
}
});
@ -1087,4 +1095,3 @@ if ($group_rep == 2) {
echo '</div>';
}

View File

@ -441,10 +441,13 @@ $table->data[] = $data;
// Double auth.
$double_auth_enabled = (bool) db_get_value('id', 'tuser_double_auth', 'id_user', $config['id_user']);
$data = [];
$data[0] = '<span style="width:50%;float:left;">'.__('Double authentication').'</span>';
$data[0] .= $jump;
$data[0] .= '<span style="width:20%;float:left;line-height:20px;">'.html_print_checkbox('double_auth', 1, $double_auth_enabled, true).'</span>';
$data = array();
if ($config['double_auth_enabled']) {
$data[0] = '<span style="width:50%;float:left;">'.__('Double authentication').'</span>';
$data[0] .= $jump;
$data[0] .= '<span style="width:20%;float:left;line-height:20px;">'.html_print_checkbox('double_auth', 1, $double_auth_enabled, true).'</span>';
}
if ($double_auth_enabled) {
$data[0] .= $jump;
$data[0] .= html_print_button(__('Show information'), 'show_info', false, 'javascript:show_double_auth_info();', '', true);

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.731
%define release 190219
%define release 190221
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.731
%define release 190219
%define release 190221
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.731-190219
Version: 7.0NG.731-190221
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.731-190219"
pandora_version="7.0NG.731-190221"
package_cpan=0
package_pandora=1

View File

@ -45,7 +45,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.731";
my $pandora_build = "190219";
my $pandora_build = "190221";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -3418,7 +3418,16 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
$alert->{'oid'} = decode_entities($alert->{'oid'});
my $oid = $alert->{'oid'};
if ($oid ne '') {
next if (index ($trap_oid, $oid) == -1 && index ($trap_oid_text, $oid) == -1);
my $term = substr($oid, -1);
# Strict match.
if ($term eq '$') {
chop($oid);
next if ($trap_oid ne $oid && $trap_oid_text ne $oid);
}
# Partial match.
else {
next if (index ($trap_oid, $oid) == -1 && index ($trap_oid_text, $oid) == -1);
}
$alert_data .= "OID: $oid ";
}

View File

@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.731";
my $pandora_build = "190219";
my $pandora_build = "190221";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.731
%define release 190219
%define release 190221
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.731
%define release 190219
%define release 190221
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.731"
PI_BUILD="190219"
PI_BUILD="190221"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.731 PS190219";
my $version = "7.0NG.731 PS190221";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.731 PS190219";
my $version = "7.0NG.731 PS190221";
# save program name for logging
my $progname = basename($0);