From 9e54f9517bd01301ffdf4d3d0db1377a2cb96e10 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 18 Mar 2021 16:12:39 +0100 Subject: [PATCH 01/50] WIP: Backup upload --- .../extras/delete_files/delete_files.txt | 7 +- pandora_server/conf/pandora_server.conf.new | 4 +- .../lib/PandoraFMS/Goliat/GoliatCURL.pm | 365 +++++++++++++ .../lib/PandoraFMS/Goliat/GoliatConfig.pm | 265 ++++++++++ .../lib/PandoraFMS/Goliat/GoliatLWP.pm | 478 ++++++++++++++++++ .../lib/PandoraFMS/Goliat/GoliatTools.pm | 222 ++++++++ pandora_server/lib/PandoraFMS/WebServer.pm | 294 +++++++++++ 7 files changed, 1632 insertions(+), 3 deletions(-) create mode 100755 pandora_server/lib/PandoraFMS/Goliat/GoliatCURL.pm create mode 100755 pandora_server/lib/PandoraFMS/Goliat/GoliatConfig.pm create mode 100755 pandora_server/lib/PandoraFMS/Goliat/GoliatLWP.pm create mode 100755 pandora_server/lib/PandoraFMS/Goliat/GoliatTools.pm create mode 100644 pandora_server/lib/PandoraFMS/WebServer.pm diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt index f21a69a040..7832042fda 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -73,4 +73,9 @@ enterprise/extensions/ipam.php enterprise/extensions/ipam enterprise/extensions/disabled/visual_console_manager.php enterprise/extensions/visual_console_manager.php -pandora_console/extensions/net_tools.php \ No newline at end of file +pandora_console/extensions/net_tools.php +pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatCURL.pm +pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatConfig.pm +pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatLWP.pm +pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatTools.pm +pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/PandoraFMS/WebServer.pm \ No newline at end of file diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 2bff2b9d98..b4c8f5bc2c 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -424,11 +424,11 @@ update_parent 1 # openstreetmaps_description 1 -# Enable (1) or disable (0) Pandora FMS Web Server/Goliat (PANDORA FMS ENTERPRISE ONLY). +# Enable (1) or disable (0) Pandora FMS Web Server/Goliat. webserver 1 -# Number of threads for the Web Server/Goliat (PANDORA FMS ENTERPRISE ONLY). +# Number of threads for the Web Server/Goliat. web_threads 1 diff --git a/pandora_server/lib/PandoraFMS/Goliat/GoliatCURL.pm b/pandora_server/lib/PandoraFMS/Goliat/GoliatCURL.pm new file mode 100755 index 0000000000..6f82ba3a00 --- /dev/null +++ b/pandora_server/lib/PandoraFMS/Goliat/GoliatCURL.pm @@ -0,0 +1,365 @@ +################################################################################## +# Goliath Tools CURL Module +################################################################################## +# Copyright (c) 2013-2021 Artica Soluciones Tecnologicas S.L +# This code is not free or OpenSource. Please don't redistribute. +################################################################################## + +package Goliat::GoliatCURL; + +use Goliat::GoliatTools; + +use strict; +use warnings; +use Data::Dumper; +use PandoraFMS::DB; + +use IO::Socket::INET6; +use URI::Escape; +use Time::Local; +use Time::HiRes qw ( gettimeofday ); + +# Japanese encoding support +use Encode::Guess qw/euc-jp shiftjis iso-2022-jp/; + +require Exporter; + +our @ISA = ("Exporter"); +our %EXPORT_TAGS = ( 'all' => [ qw() ] ); +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); +our @EXPORT = qw( + g_http_task + @task_requests + @task_reqsec + @task_fails + @task_time + @task_end + @task_sessions + @task_ssec + @task_get_string + @task_get_content + @task_session_fails +); + +our @task_requests; +our @task_reqsec; +our @task_fails ; +our @task_time; +our @task_end; +our @task_sessions; +our @task_ssec; +our @task_get_string; +our @task_get_content; +our @task_session_fails; +our $goliat_abort; + +# Returns a string than can be safely used as a command line parameter for CURL +sub safe_param ($) { + my $string = shift; + + $string =~ s/'/"/g; + return "'" . $string . "'"; +} + +sub g_http_task { + my ( $config, $thread_id, @work_list ) = @_; + my ( $ax, $bx, $cx ); # used in FOR loop + my ( $ttime1, $ttime2, $ttime_tot ); + + my $resp; # HTTP Response + my $total_requests = 0; + my $total_valid_requests = 0; + my $total_invalid_request = 0; + my $cookie_file = "/tmp/gtc_".$thread_id."_".g_trash_ascii (3); + my $check_string = 1; + my $get_string = ""; + my $get_content = ""; + my $get_content_advanced = ""; + my $timeout = 10; + + #my $ua = new LWP::UserAgent; + $task_requests [$thread_id] = 0 ; + $task_sessions [$thread_id] = 0 ; + $task_reqsec[$thread_id] = 0; + $task_fails[$thread_id] = 0; + $task_session_fails[$thread_id] = 0; + $task_ssec[$thread_id] = 0; + $task_end[$thread_id] = 0; + $task_time[$thread_id] = 0; + $task_get_string[$thread_id] = ""; + $task_get_content[$thread_id] = ""; + + # Set command line options for CURL + my $curl_opts; + + # Follow redirects + $curl_opts .= " --location-trusted"; + + # User agent + if ($config->{"agent"} ne '') { + $curl_opts .= " -A " . safe_param($config->{"agent"}) + } + + # Prevent pages from being cached + $curl_opts .= " -H 'Pragma: no-cache'"; + + # Timeout + if (defined ($config->{"timeout"}) && $config->{"timeout"} > 0) { + $timeout = $config->{"timeout"}; + } + + # Maximum file size + if (defined($config->{"maxsize"}) && $config->{"maxsize"} > 0) { + $curl_opts .= " --max-filesize " . $config->{"maxsize"}; + } + + # Disable SSL certificate host verification + $curl_opts .= " -k"; + + # Proxy + if ($config->{'proxy'} ne ""){ + $curl_opts .= " -x " . safe_param($config->{'proxy'}); + } + + # Proxy HTTP authentication + if ($config->{'auth_user'} ne "") { + $curl_opts .= " --proxy-anyauth -U " . safe_param($config->{'auth_user'} . ':' . $config->{'auth_pass'}); + } + + # Delete existing cookies + my $cookie_carry_on = 0; + if ( -e $cookie_file){ + unlink ($cookie_file); + } + + $ttime1 = Time::HiRes::gettimeofday(); + for ($ax = 0; $ax != $config->{'retries'}; $ax++){ + for ($bx = 0; $bx < $config->{"work_items"}; $bx++){ + if ($config->{'con_delay'} > 0){ + sleep ($config->{'con_delay'}); + } + $total_requests++; + # Start to count! + $check_string = 1; + # Prepare parameters + my $task_curl_opts = $curl_opts; + my $params = ""; + $cx = 0; + while (defined($work_list[$bx]->{'variable_name'}[$cx])){ + if ($cx > 0){ + $params = $params."&"; + } + $params = $params . $work_list[$bx]->{'variable_name'}[$cx] . "=" . uri_escape($work_list[$bx]->{'variable_value'}[$cx]); + $cx++; + } + + # Cookie carry on + if (defined ($work_list[$bx]->{'cookie'}) && $work_list[$bx]->{'cookie'} == 1){ + $cookie_carry_on = 1; + } + + if ($cookie_carry_on == 1) { + $task_curl_opts .= " -c " . safe_param ($cookie_file); + $task_curl_opts .= " -b " . safe_param ($cookie_file); + } + + # HTTP authentication + if ($work_list[$bx]->{'http_auth_user'} ne "" && $work_list[$bx]->{'http_auth_pass'} ne "") { + + if($config->{'http_check_type'} == 0){ + $task_curl_opts .= " --anyauth -u " . safe_param($work_list[$bx]->{'http_auth_user'} . ':' . $work_list[$bx]->{'http_auth_pass'}); + } + + if ($config->{'http_check_type'} == 1) { + $task_curl_opts .= " --ntlm -u " . safe_param($work_list[$bx]->{'http_auth_user'} . ':' . $work_list[$bx]->{'http_auth_pass'}); + } + + if ($config->{'http_check_type'} == 2) { + $task_curl_opts .= " --digest -u " . safe_param($work_list[$bx]->{'http_auth_user'} . ':' . $work_list[$bx]->{'http_auth_pass'}); + } + + if ($config->{'http_check_type'} == 3) { + $task_curl_opts .= " --basic -u " . safe_param($work_list[$bx]->{'http_auth_user'} . ':' . $work_list[$bx]->{'http_auth_pass'}); + } + + + } + + # GET + if ($work_list[$bx]->{'type'} eq "GET"){ + $task_curl_opts .= " -H 'Accept: text/html'"; + if ($cx > 0){ + $params = $work_list[$bx]->{'url'} . "?" . $params; + } else { + $params = $work_list[$bx]->{'url'}; + } + + $resp = curl ($config->{"plugin_exec"}, $timeout, $task_curl_opts, $params, $work_list[$bx]->{'headers'}, $work_list[$bx]->{'debug'}, $config->{"moduleId"}, $config->{"dbh"}); + + # POST + } elsif ($work_list[$bx]->{'type'} eq "POST") { + $task_curl_opts .= " -d " . safe_param($params); + $task_curl_opts .= " -H 'Content-type: application/x-www-form-urlencoded'"; + $resp = curl ($config->{"plugin_exec"}, $timeout, $task_curl_opts, $work_list[$bx]->{'url'}, $work_list[$bx]->{'headers'}, $work_list[$bx]->{'debug'}, $config->{"moduleId"}, $config->{"dbh"}); + + # HEAD + } else { + $task_curl_opts .= " -I"; + if ($cx > 0){ + $params = $work_list[$bx]->{'url'} . "?" . uri_escape($params); + } else { + $params = $work_list[$bx]->{'url'}; + } + $resp = curl ($config->{"plugin_exec"}, $timeout, $task_curl_opts, $params, $work_list[$bx]->{'headers'}, $work_list[$bx]->{'debug'}, $config->{"moduleId"}, $config->{"dbh"}); + } + + # Get string ? + if (defined($work_list[$bx]->{'get_string'})) { + my $temp = $work_list[$bx]->{'get_string'}; + if ($resp =~ m/($temp)/) { + $task_get_string[$thread_id] = $1; + } + } + + # Get response ? + if ($work_list[$bx]->{'get_content_advanced'} ne "") { + my $temp = $work_list[$bx]->{'get_content_advanced'}; + if ($resp =~ m/$temp/) { + $task_get_content[$thread_id] = $1 if defined ($1); + } + } elsif ($work_list[$bx]->{'get_content'} ne "") { + my $temp = $work_list[$bx]->{'get_content'}; + if ($resp =~ m/($temp)/) { + $task_get_content[$thread_id] = $1; + } + } else { + $task_get_content[$thread_id] = $resp; + } + + # Resource bashing + #if ((defined($work_list[$bx]->{'get_resources'})) && ($work_list[$bx]->{'get_resources'} == 1)){ + # $total_requests = g_get_all_links ($config, $ua, $resp, $total_requests, $work_list[$bx]->{'url'}, $work_list[$bx]->{'headers'}, $work_list[$bx]->{'debug'}); + #} + + # CHECKSTRING check + $cx = 0; + while (defined($work_list[$bx]->{'checkstring'}[$cx])) { + my $match_string = $work_list[$bx]->{'checkstring'}[$cx]; + my $as_string = $resp; + my $guess = Encode::Guess::guess_encoding($as_string); + if (ref $guess) { + $as_string = $guess->decode($as_string); + } + unless (utf8::is_utf8($match_string)) { + utf8::decode($match_string); + } + + if ( $as_string =~ m/$match_string/i ){ + $total_valid_requests++; + } else { + $total_invalid_request++; + $bx = $config->{"work_items"}; # Abort session remaining request + $check_string=0; + } + $cx++; + } + + # CHECKNOTSTRING check + $cx = 0; + while (defined($work_list[$bx]->{'checknotstring'}[$cx])) { + my $match_string = $work_list[$bx]->{'checknotstring'}[$cx]; + my $as_string = $resp; + + my $guess = Encode::Guess::guess_encoding($as_string); + if (ref $guess) { + $as_string = $guess->decode($as_string); + } + unless (utf8::is_utf8($match_string)) { + utf8::decode($match_string); + } + + if ( $as_string !~ m/$match_string/i ){ + $total_valid_requests++; + } else { + $total_invalid_request++; + $bx = $config->{"work_items"}; # Abort session remaining request + $check_string=0; + } + $cx++; + } + + # End just now by pressing CTRL-C or Kill Signal ! + #if ($goliat_abort == 1){ + #$ax = $config->{'retries'}; + #$bx = $config->{'items'}; + #goto END_LOOP; + #} + } #main work_detail loop + $ttime2 = Time::HiRes::gettimeofday(); + + $ttime_tot = $ttime2 - $ttime1; # Total time for this task + $task_time[$thread_id] = $ttime_tot; + $task_requests [$thread_id] = $total_requests; + if ($ttime_tot > 0 ){ + $task_reqsec[$thread_id] = $total_requests / $ttime_tot; + } else { + $task_reqsec[$thread_id] = $total_requests; + } + $task_fails[$thread_id] = $total_invalid_request; + if ($check_string == 0){ + $task_session_fails[$thread_id]++ + } + $task_sessions [$thread_id]++; + if ($task_sessions [$thread_id] > 0 ){ + $task_ssec[$thread_id] = $ttime_tot / $task_sessions [$thread_id]; + } else { + $task_ssec[$thread_id] = $task_sessions[$thread_id]; + } + sleep $config->{'ses_delay'}; + } +END_LOOP: + + if ( -f $cookie_file){ + unlink ($cookie_file); + } + + $task_end[$thread_id] = 1; +} + +# Call CURL and return its output. +sub curl { + my ($exec, $timeout, $curl_opts, $url, $headers, $debug, $moduleId, $dbh) = @_; + + while (my ($header, $value) = each %{$headers}) { + $curl_opts .= " -H " . safe_param($header . ':' . $value); + } + + my $cmd = "curl $curl_opts " . safe_param($url); + my $response = `"$exec" $timeout $cmd 2>/dev/null`; + + # Curl command stored for live debugging feature. + set_update_agentmodule ($dbh, $moduleId, { 'debug_content' => $cmd }) if defined($dbh); + + return $response if ($debug eq ''); + + # Debug + if (open (DEBUG, '>>', $debug . '.req')) { + print DEBUG "[Goliat debug " . time () . "]\n"; + print DEBUG $cmd; + print "\n"; + close (DEBUG); + } + if (open (DEBUG, '>>', $debug . '.res')) { + print DEBUG "[Goliat debug " . time () . "]\n"; + print DEBUG $response; + print "\n"; + close (DEBUG); + } + return $response; +} + +# End of function declaration +# End of defined Code + +1; +__END__ diff --git a/pandora_server/lib/PandoraFMS/Goliat/GoliatConfig.pm b/pandora_server/lib/PandoraFMS/Goliat/GoliatConfig.pm new file mode 100755 index 0000000000..25ae73b30f --- /dev/null +++ b/pandora_server/lib/PandoraFMS/Goliat/GoliatConfig.pm @@ -0,0 +1,265 @@ +########################################################################## +# Goliat Config package +########################################################################## +# Copyright (c) 2007-2021 Artica Soluciones Tecnologicas S.L +# This code is not free or OpenSource. Please don't redistribute. +########################################################################## + +package Goliat::GoliatConfig; + +use strict; +use warnings; +use Goliat::GoliatTools; +use PandoraFMS::Tools; + +require Exporter; +our @ISA = ("Exporter"); +our %EXPORT_TAGS = ( 'all' => [ qw( ) ] ); +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); +our @EXPORT = qw( g_help_screen + g_init + g_load_config ); + +my $g_version = "1.0"; +my $g_build = "110929"; +our $VERSION = $g_version." ".$g_build; + + +sub g_load_config { + my ( $config , $work_list )= @_ ; + my $archivo_cfg = $config->{'config_file'}; + my $buffer_line; + my $task_block = 0; + my $commit_block = 0; + my $task_url = ""; + my $task_cookie = 0; + my $task_resources = 1; + my $task_type = ""; + my $task_headers = {}; + my $task_debug = ""; + my $http_auth_user = ""; + my $http_auth_pass = ""; + my $http_auth_realm = ""; + my $http_auth_serverport = ""; + my $get_string = ""; + my $get_content = ""; + my $get_content_advanced = ""; + my @task_variable_name; + my @task_variable_value; + my @task_check_string; + my @task_check_not_string; + my $parametro; + my $temp1; + + # Default options + $config->{'con_delay'} =0; + $config->{'ses_delay'} =0; + if (!defined($config->{'agent'})){ + $config->{'agent'}="PandoraFMS/Goliat 4.0; Linux)"; + } + if (!defined($config->{'proxy'})){ + $config->{'proxy'}=""; + } + + if (!defined($config->{'retries'})){ + $config->{'retries'} = 1; + } + + if ((!is_numeric($config->{'retries'})) || ($config->{'retries'} == 0)){ + $config->{'retries'} = 1; + } + + $config->{'refresh'} = "5"; + $config->{"max_depth"} = 25; + $config->{'log_file'}="/var/log/pandora/pandora_goliat.log"; + $config->{'log_output'} = 0; + + # Collect items from config file and put in an array + open (CFG, "< $archivo_cfg"); + while (){ + $buffer_line = $_; + if ($buffer_line =~ /^[a-zA-Z]/){ # begins with letters + $parametro = $buffer_line; + } else { + $parametro = ""; + } + # Need to commit block ?? + if (($commit_block == 1) && ($task_block == 1)) { + my %work_item; + $work_item{'url'} = $task_url; + $work_item{'cookie'} = $task_cookie; + $work_item{'type'} = $task_type; + $work_item{'get_resources'} = $task_resources; + $work_item{'get_string'} = $get_string; + $work_item{'get_content'} = $get_content; + $work_item{'get_content_advanced'} = $get_content_advanced; + $work_item{'http_auth_user'} = $http_auth_user; + $work_item{'http_auth_pass'} = $http_auth_pass; + $work_item{'http_auth_realm'} = $http_auth_realm; + $work_item{'http_auth_serverport'} = $http_auth_serverport; + $work_item{'headers'} = $task_headers; + $work_item{'debug'} = $task_debug; + + my $ax=0; + while ($#task_check_string >= 0){ + $temp1 = pop (@task_check_string); + $work_item{'checkstring'}[$ax] = $temp1; + $ax++; + } + $ax=0; + while ($#task_check_not_string >= 0){ + $temp1 = pop (@task_check_not_string); + $work_item{'checknotstring'}[$ax] = $temp1; + $ax++; + } + $ax=0; + while ($#task_variable_name >= 0){ + $temp1 = pop (@task_variable_name); + $work_item{'variable_name'}[$ax] = $temp1; + $ax++; + } + $ax=0; + while ($#task_variable_value >= 0){ + $temp1 = pop (@task_variable_value); + $work_item{'variable_value'}[$ax] = $temp1; + $ax++; + + } + push @{$work_list}, \%work_item; + $commit_block = 0; + $task_block = 0; + $task_url = ""; + $task_cookie = 0; + $task_resources = 0; + $task_type = ""; + $task_headers = {}; + $task_debug = ""; + $config->{"work_items"}++; + $commit_block = 0; + $task_block = 0; + $http_auth_user = ""; + $http_auth_pass = ""; + $http_auth_realm = ""; + $get_string = ""; + $get_content = ""; + $get_content_advanced = ""; + } + # ~~~~~~~~~~~~~~ + # Main setup items + # ~~~~~~~~~~~~~~ + + if ($parametro =~ m/^task_begin/i) { + $task_block = 1; + } + elsif ($parametro =~ m/^task_end/i) { + $commit_block = 1; + } + elsif ($parametro =~ m/^ses_delay\s(.*)/i) { + $config->{'ses_delay'} = $1; + } + elsif ($parametro =~ m/^con_delay\s(.*)/i) { + $config->{'con_delay'} = $1; + } + elsif ($parametro =~ m/^agent\s(.*)/i) { + $config->{'agent'} = $1; + } + elsif ($parametro =~ m/^proxy\s(.*)/i) { + $config->{'proxy'} = $1; + } + elsif ($parametro =~ m/^max_depth\s(.*)/i) { + $config->{'max_depth'} = $1; + } + elsif ($parametro =~ m/^log_file\s(.*)/i) { + $config->{"log_file"} = $1; + } + elsif ($parametro =~ m/^log_output\s(.*)/i) { + $config->{"log_output"} = $1; + } + elsif ($parametro =~ m/^log_http\s(.*)/i) { + $config->{"log_http"} = $1; + } + elsif ($parametro =~ m/^retries\s(.*)/i) { + $config->{"retries"} = $1; + } + # ~~~~~~~~~~~~~~ + # Task items + # ~~~~~~~~~~~~~~ + elsif ($parametro =~ m/^variable_name\s(.*)/i) { + push (@task_variable_name, $1); + } + elsif ($parametro =~ m/^variable_value\s(.*)/i) { + push (@task_variable_value, $1); + } + elsif ($parametro =~ m/^check_string\s(.*)/i) { + push (@task_check_string, $1); + } + elsif ($parametro =~ m/^check_not_string\s(.*)/i) { + push (@task_check_not_string, $1); + } + elsif ($parametro =~ m/^get\s(.*)/i) { + $task_type = "GET"; + $task_url = $1; + } + elsif ($parametro =~ m/^post\s(.*)/i) { + $task_type = "POST"; + $task_url = $1; + } + elsif ($parametro =~ m/^head\s(.*)/i) { + $task_type = "HEAD"; + $task_url = $1; + } + # New in 4.0 version + elsif ($parametro =~ m/^get_string\s(.*)/i) { + $get_string = $1; + } + elsif ($parametro =~ m/^get_content\s(.*)/i) { + $get_content = $1; + } + elsif ($parametro =~ m/^get_content_advanced\s(.*)/i) { + $get_content_advanced = $1; + } + elsif ($parametro =~ m/^http_auth_user\s(.*)/i) { + $http_auth_user = $1; + } + elsif ($parametro =~ m/^http_auth_pass\s(.*)/i) { + $http_auth_pass = $1; + } + elsif ($parametro =~ m/^http_auth_realm\s(.*)/i) { + $http_auth_realm = $1; + } + elsif ($parametro =~ m/^http_auth_serverport\s(.*)/i) { + $http_auth_serverport = $1; + } + elsif ($parametro =~ m/^cookie\s(.*)/i) { + if ($1 =~ m/1/i){ + $task_cookie = 1; + } else { + $task_cookie = 0; + } + } + elsif ($parametro =~ m/^resource\s(.*)/i) { + if ($1 =~ m/1/i){ + $task_resources = 1; + } else { + $task_resources = 0; + } + } + # New in 5.0 version + elsif ($parametro =~ m/^header\s+(\S+)\s(.*)/i) { + $task_headers->{$1} = $2; + } + elsif ($parametro =~ m/^debug\s+(.*)/i) { + $task_debug = $1; + } + + } + close (CFG); +} + +# End of function declaration +# End of defined Code + +1; +__END__ + + diff --git a/pandora_server/lib/PandoraFMS/Goliat/GoliatLWP.pm b/pandora_server/lib/PandoraFMS/Goliat/GoliatLWP.pm new file mode 100755 index 0000000000..7b66d2457e --- /dev/null +++ b/pandora_server/lib/PandoraFMS/Goliat/GoliatLWP.pm @@ -0,0 +1,478 @@ +################################################################################## +# Goliath Tools LWP Module +################################################################################## +# Copyright (c) 2007-2021 Artica Soluciones Tecnologicas S.L +# This code is not free or OpenSource. Please don't redistribute. +################################################################################## + +package Goliat::GoliatLWP; + +use Goliat::GoliatTools; + +use strict; +use warnings; +use Data::Dumper; + +use IO::Socket::INET6; +use LWP::UserAgent; +use LWP::ConnCache; +use HTTP::Request::Common; +use HTTP::Response; +use HTML::TreeBuilder; +use HTML::Element; +use HTTP::Cookies; +use URI::URL; +use Time::Local; +use Time::HiRes qw ( gettimeofday ); + +# For IPv6 support in Net::HTTP. +BEGIN { + $Net::HTTP::SOCKET_CLASS = 'IO::Socket::INET6'; + require Net::HTTP; +} + +# Japanese encoding support +use Encode::Guess qw/euc-jp shiftjis iso-2022-jp/; + +require Exporter; + +our @ISA = ("Exporter"); +our %EXPORT_TAGS = ( 'all' => [ qw() ] ); +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); +our @EXPORT = qw( + g_http_task + @task_requests + @task_reqsec + @task_fails + @task_time + @task_end + @task_sessions + @task_ssec + @task_get_string + @task_get_content + @task_session_fails +); + +our @task_requests; +our @task_reqsec; +our @task_fails; +our @task_time; +our @task_end; +our @task_sessions; +our @task_ssec; +our @task_get_string; +our @task_get_content; +our @task_session_fails; +our $goliat_abort; + +sub parse_html ($;$) +{ + my $p = $_[1]; + $p = _new_tree_maker() unless $p; + $p->parse($_[0]); +} + + +sub parse_htmlfile ($;$) +{ + my($file, $p) = @_; + local(*HTML); + open(HTML, $file) or return undef; + $p = _new_tree_maker() unless $p; + $p->parse_file(\*HTML); +} + +sub _new_tree_maker +{ + my $p = HTML::TreeBuilder->new(implicit_tags => 1, + ignore_unknown => 1, + ignore_text => 0, + 'warn' => 0, + ); + $p->strict_comment(1); + $p; +} + + +sub g_http_task { + my ( $config, $thread_id, @work_list ) = @_; + my ( $ax, $bx, $cx ); # used in FOR loop + my ( $ttime1, $ttime2, $ttime_tot ); + + my $resp; # HTTP Response + my $total_requests = 0; + my $total_valid_requests = 0; + my $total_invalid_request = 0; + my $cookie_file = "/tmp/gtc_".$thread_id."_".g_trash_ascii (3); + my $check_string = 1; + my $get_string = ""; + my $get_content = ""; + my $get_content_advanced = ""; + + my $ua = new LWP::UserAgent; + $task_requests [$thread_id] = 0 ; + $task_sessions [$thread_id] = 0 ; + $task_reqsec[$thread_id] = 0; + $task_fails[$thread_id] = 0; + $task_session_fails[$thread_id] = 0; + $task_ssec[$thread_id] = 0; + $task_end[$thread_id] = 0; + $task_time[$thread_id] = 0; + $task_get_string[$thread_id] = ""; + $task_get_content[$thread_id] = ""; + + $ua->agent($config->{"agent"}); + $ua->protocols_allowed( ['http', 'https'] ); + $ua->default_headers->push_header('pragma' => "no-cache"); + $ua->timeout ($config->{"timeout"}); + $ua->max_size($config->{"maxsize"}); + $ua->use_alarm($config->{"alarm"}); + + # Disable SSL certificate host verification + if ($ua->can ('ssl_opts')) { + $ua->ssl_opts("verify_hostname" => 0); + } + + # Set proxy + + if ($config->{'proxy'} ne ""){ + $ua->proxy(['http','https'], $config->{'proxy'}); + } + + # Set HTTP Proxy auth + if ($config->{'auth_user'} ne "") { + $ua->credentials( + $config->{'auth_server'}, + $config->{'auth_realm'}, + $config->{'auth_user'} => $config->{'auth_pass'} ); + } + + if ( -e $cookie_file){ + unlink ($cookie_file); + } + my $cookies = HTTP::Cookies->new ('file' => $cookie_file, 'autosave' => '0'); + + $ttime1 = Time::HiRes::gettimeofday(); + for ($ax = 0; $ax != $config->{'retries'}; $ax++){ + for ($bx = 0; $bx < $config->{"work_items"}; $bx++){ + if ($config->{'con_delay'} > 0){ + sleep ($config->{'con_delay'}); + } + $total_requests++; + # Start to count! + $check_string = 1; + # Prepare parameters + my $params = ""; + $cx = 0; + while (defined($work_list[$bx]->{'variable_name'}[$cx])){ + if ($cx > 0){ + $params = $params."&"; + } + $params = $params . $work_list[$bx]->{'variable_name'}[$cx] . "=" . $work_list[$bx]->{'variable_value'}[$cx]; + $cx++; + } + + if ( (defined($work_list[$bx]->{'http_auth_realm'})) && (defined($work_list[$bx]->{'http_auth_serverport'}))&& (defined($work_list[$bx]->{'http_auth_user'})) && (defined($work_list[$bx]->{'http_auth_pass'}))) { + if ($work_list[$bx]->{'http_auth_realm'} ne "") { + $ua->credentials( + $work_list[$bx]->{'http_auth_serverport'}, + $work_list[$bx]->{'http_auth_realm'}, + $work_list[$bx]->{'http_auth_user'} => $work_list[$bx]->{'http_auth_pass'} + ); + } + } + + # GET + if ($work_list[$bx]->{'type'} eq "GET"){ + if ($cx > 0){ + $params = $work_list[$bx]->{'url'} . "?" . $params; + } else { + $params = $work_list[$bx]->{'url'}; + } + $resp = g_get_page ( $ua, $params, $work_list[$bx]->{'headers'}, $work_list[$bx]->{'debug'}); + + # POST + } elsif ($work_list[$bx]->{'type'} eq "POST") { + $resp = g_post_page ( $ua, $work_list[$bx]->{'url'}, $params, $work_list[$bx]->{'headers'}, $work_list[$bx]->{'debug'}); + + # HEAD + } else { + if ($cx > 0){ + $params = $work_list[$bx]->{'url'} . "?" . $params; + } else { + $params = $work_list[$bx]->{'url'}; + } + $resp = g_head_page ( $ua, $params, $work_list[$bx]->{'headers'}, $work_list[$bx]->{'debug'}); + } + + # Check for errors. + if ($resp->code() == 500) { + $total_invalid_request++; + $bx = $config->{"work_items"}; + $check_string=0; + last; + } + + # Get string ? + if (defined($work_list[$bx]->{'get_string'})) { + my $as_string = $resp->as_string; + my $temp = $work_list[$bx]->{'get_string'}; + if ($as_string =~ m/($temp)/) { + $task_get_string[$thread_id] = $1; + } + } + + # Get response ? + if ($work_list[$bx]->{'get_content_advanced'} ne "") { + my $content = $resp->decoded_content; + my $temp = $work_list[$bx]->{'get_content_advanced'}; + if ($content =~ m/$temp/) { + $task_get_content[$thread_id] = $1 if defined ($1); + } + } elsif ($work_list[$bx]->{'get_content'} ne "") { + my $content = $resp->decoded_content; + my $temp = $work_list[$bx]->{'get_content'}; + if ($content =~ m/($temp)/) { + $task_get_content[$thread_id] = $1; + } + } + + # Resource bashing + if ((defined($work_list[$bx]->{'get_resources'})) && ($work_list[$bx]->{'get_resources'} == 1)){ + $total_requests = g_get_all_links ($config, $ua, $resp, $total_requests, $work_list[$bx]->{'url'}, $work_list[$bx]->{'headers'}, $work_list[$bx]->{'debug'}); + } + + # CHECKSTRING check + $cx = 0; + while (defined($work_list[$bx]->{'checkstring'}[$cx])) { + my $match_string = $work_list[$bx]->{'checkstring'}[$cx]; + my $as_string = $resp->as_string; + + my $guess = Encode::Guess::guess_encoding($as_string); + if (ref $guess) { + $as_string = $guess->decode($as_string); + } + unless (utf8::is_utf8($match_string)) { + utf8::decode($match_string); + } + + if ( $as_string =~ m/$match_string/i ){ + $total_valid_requests++; + } else { + $total_invalid_request++; + $bx = $config->{"work_items"}; # Abort session remaining request + $check_string=0; + } + $cx++; + } + + # CHECKNOTSTRING check + $cx = 0; + while (defined($work_list[$bx]->{'checknotstring'}[$cx])) { + my $match_string = $work_list[$bx]->{'checknotstring'}[$cx]; + my $as_string = $resp->as_string; + + my $guess = Encode::Guess::guess_encoding($as_string); + if (ref $guess) { + $as_string = $guess->decode($as_string); + } + unless (utf8::is_utf8($match_string)) { + utf8::decode($match_string); + } + + if ( $as_string !~ m/$match_string/i ){ + $total_valid_requests++; + } else { + $total_invalid_request++; + $bx = $config->{"work_items"}; # Abort session remaining request + $check_string=0; + } + $cx++; + } + + # Cookie carry on + if (defined ($work_list[$bx]->{'cookie'}) && $work_list[$bx]->{'cookie'} == 1){ + $cookies->extract_cookies($resp); + $ua->cookie_jar($cookies); + } + + # End just now by pressing CTRL-C or Kill Signal ! + #if ($goliat_abort == 1){ + #$ax = $config->{'retries'}; + #$bx = $config->{'items'}; + #goto END_LOOP; + #} + } #main work_detail loop + $ttime2 = Time::HiRes::gettimeofday(); + + $ttime_tot = $ttime2 - $ttime1; # Total time for this task + $task_time[$thread_id] = $ttime_tot; + $task_requests [$thread_id] = $total_requests; + if ($ttime_tot > 0 ){ + $task_reqsec[$thread_id] = $total_requests / $ttime_tot; + } else { + $task_reqsec[$thread_id] = $total_requests; + } + $task_fails[$thread_id] = $total_invalid_request; + if ($check_string == 0){ + $task_session_fails[$thread_id]++ + } + $task_sessions [$thread_id]++; + if ($task_sessions [$thread_id] > 0 ){ + $task_ssec[$thread_id] = $ttime_tot / $task_sessions [$thread_id]; + } else { + $task_ssec[$thread_id] = $task_sessions[$thread_id]; + } + sleep $config->{'ses_delay'}; + } +END_LOOP: + + $cookies->clear; + + if ( -f $cookie_file){ + unlink ($cookie_file); + } + + $task_end[$thread_id] = 1; +} + + +sub g_get_all_links { + my ($config, $ua, $response, $counter, $myurl, $headers, $debug) = @_; + my $html; + + if ($response->is_success) { + $html = $response->content; + } else { + return $counter; + } + # Beware this funcion, needs to be destroyed after use it !!! + my $parsed_html = parse_html($html); + #$ua->conn_cache(LWP::ConnCache->new()); + + my @url_list; + my $url = ""; + my $link; + my $full_url; + + for (@{ $parsed_html->extract_links( ) }) { + $link=$_->[0]; + if (($link =~ m/.png/i) || ($link =~ m/.gif/i) || ($link =~ m/.htm/i) || + ($link =~ m/.html/i) || ($link =~ m/.pdf/i) || ($link =~ m/.jpg/i) + || ($link =~ m/.ico/i)){ + $url = new URI::URL $link; + $full_url = $url->abs($myurl); + @url_list = $full_url; + } + + } + $parsed_html->delete; + my $ax = 0; + while ($full_url = pop(@url_list)) { + g_get_page ($ua, $full_url, $headers, $debug); + $counter++; + $ax++; + if ($ax > $config->{"max_depth"}){ + return $counter; + } + } + return $counter; +} + +sub g_get_page { + my $ua = $_[0]; + my $url = $_[1]; + my $headers = $_[2]; + my $debug = $_[3]; + + my $req = HTTP::Request->new(GET => $url); + $req->header('Accept' => 'text/html'); + while (my ($header, $value) = each %{$headers}) { + $req->header($header => $value); + } + my $response = $ua->request($req); + return $response if ($debug eq ''); + + # Debug + if (open (DEBUG, '>>', $debug . '.req')) { + print DEBUG "[Goliat debug " . time () . "]\n"; + print DEBUG $req->as_string (); + print "\n"; + close (DEBUG); + } + if (open (DEBUG, '>>', $debug . '.res')) { + print DEBUG "[Goliat debug " . time () . "]\n"; + print DEBUG $response->as_string (); + print "\n"; + close (DEBUG); + } + return $response; +} + +sub g_head_page { + my $ua = $_[0]; + my $url = $_[1]; + my $headers = $_[2]; + my $debug = $_[3]; + + my $req = HTTP::Request->new(HEAD => $url); + $req->header('Accept' => 'text/html'); + while (my ($header, $value) = each %{$headers}) { + $req->header($header => $value); + } + my $response = $ua->request($req); + return $response if ($debug eq ''); + + # Debug + if (open (DEBUG, '>>', $debug . '.req')) { + print DEBUG "[Goliat debug " . time () . "]\n"; + print DEBUG $req->as_string (); + print "\n"; + close (DEBUG); + } + if (open (DEBUG, '>>', $debug . '.res')) { + print DEBUG "[Goliat debug " . time () . "]\n"; + print DEBUG $response->as_string (); + print "\n"; + close (DEBUG); + } + return $response; +} + +sub g_post_page { + my $ua = $_[0]; + my $url = $_[1]; + my $content = $_[2]; + my $headers = $_[3]; + my $debug = $_[4]; + + my $req = HTTP::Request->new(POST => $url); + $req->content_type('application/x-www-form-urlencoded'); + $req->content ($content); + while (my ($header, $value) = each %{$headers}) { + $req->header($header => $value); + } + my $response = $ua->request($req); + return $response if ($debug eq ''); + + # Debug + if (open (DEBUG, '>>', $debug . '.req')) { + print DEBUG "[Goliat debug " . time () . "]\n"; + print DEBUG $req->as_string (); + print "\n"; + close (DEBUG); + } + if (open (DEBUG, '>>', $debug . '.res')) { + print DEBUG "[Goliat debug " . time () . "]\n"; + print DEBUG $response->as_string (); + print "\n"; + close (DEBUG); + } + return $response; +} + +# End of function declaration +# End of defined Code + +1; +__END__ diff --git a/pandora_server/lib/PandoraFMS/Goliat/GoliatTools.pm b/pandora_server/lib/PandoraFMS/Goliat/GoliatTools.pm new file mode 100755 index 0000000000..42e1cc0836 --- /dev/null +++ b/pandora_server/lib/PandoraFMS/Goliat/GoliatTools.pm @@ -0,0 +1,222 @@ +############################################################################### +# Goliath Tools Module +############################################################################### +# Copyright (c) 2007-2021 Artica Soluciones Tecnologicas S.L +# This code is not free or OpenSource. Please don't redistribute. +############################################################################### + +package Goliat::GoliatTools; + +use 5.008004; +use strict; +use warnings; +use integer; + +require Exporter; + +our @ISA = ("Exporter"); +our %EXPORT_TAGS = ( 'all' => [ qw() ] ); +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); +our @EXPORT = qw( + g_clean_string + g_clean_string_unicode + g_random_string + g_trash_ascii + g_trash_unicode + g_unicode ); + +# Delaracion de funciones publicas + +############################################################################## +# clean_string (string) - Purge a string for any forbidden characters (esc, etc) +############################################################################## +sub g_clean_string { + my $micadena; + $micadena = $_[0]; + $micadena =~ s/[^\-\:\;\.\,\_\s\a\*\=\(\)a-zA-Z0-9]/ /g; + $micadena =~ s/[\n\l\f]/ /g; + return $micadena; +} + +############################################################################## +# limpia_cadena_unicode (string) - Purge a string for any unicode character +############################################################################## +sub g_clean_string_unicode { + my $micadena; + $micadena = $_[0]; + $micadena =~ s/[%]/%%/g; + return $micadena; +} + +############################################################################# +# Hex converter - Convert dec value in hex representation (00 - FF) +############################################################################# +sub g_decToHex { #return a 16bit (o uno de 8bit) hex value + my @hex = (0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"); + my @dec = @_; + my $s3 = $hex[($dec[0]/4096)%16]; + my $s2 = $hex[($dec[0]/256)%16]; + my $s1 = $hex[($dec[0]/16)%16]; + my $s0 = $hex[$dec[0]%16]; + return "$s1$s0"; +} + +############################################################################# +# unicode - Generate unicode string (recursive) +############################################################################# + +sub g_unicode { + my $config_word = $_[0]; + my $config_depth = $_[1]; + my $config_char="%"; + if ($config_depth == 0) { + return $config_word; + } + + my $a; + my $pos=0; + my $output=""; + my $len; + + for ($a=0;$a<$config_depth;$a++){ + $len = length($config_word); + while ($pos < $len ) { + my $item; + $item = substr($config_word,$pos,1); + $output = $output.$config_char.decToHex(ord($item)); + $pos++; + } + $config_word = $output; + } + return $output +} + +############################################################################# +# trash - Generate "unicode" style trash string +############################################################################# + +sub g_trash_unicode { + my $config_depth = $_[0]; + my $config_char="%"; + my $a; + my $output; + + for ($a=0;$a<$config_depth;$a++){ + $output = $output.$config_char.decToHex(int(rand(25)+97)); + } + return $output +} + +############################################################################# +# trash_ascii - Generate ASCII random strings +############################################################################# + +sub g_trash_ascii { + my $config_depth = $_[0]; + my $config_char="%"; + my $a; + my $output; + + for ($a=0;$a<$config_depth;$a++){ + $output = $output.chr(int(rand(25)+97)); + } + return $output +} + +############################################################################# +# random_string (min, max, type) - Generate ASCII alphanumeric string, +# from min and max +############################################################################# + +sub g_random_string { + my $config_min = $_[0]; + my $config_max = $_[1]; + my $config_type = $_[2]; # alphanumeric, alpha, numeric, lowalpha, highalpha + my $a; + my $output = ""; + my @valid_chars; + my $rango; + + # First fill list of valid chars (A-Z, a-z, 0-9) + if (($config_type eq "alphanumeric") || ($config_type eq "numeric")){ + for ($a=48;$a<58;$a++){ # numeric + push @valid_chars, chr($a); + } + } + + if (($config_type eq "alphanumeric") || ($config_type eq "alpha") || + ($config_type eq "highalpha") || ($config_type eq "lowalpha") ){ + if (($config_type eq "alphanumeric") || ($config_type eq "highalpha") || ($config_type eq "alpha")){ + for ($a=65;$a<91;$a++){ # alpha (CAPS) + push @valid_chars, chr($a); + } + } + if (($config_type eq "alphanumeric") || ($config_type eq "lowalpha") || ($config_type eq "alpha")){ + for ($a=97;$a<123;$a++){ # alpha (low) + push @valid_chars, chr($a); + } + } + } + + $rango = @valid_chars; + + # Fill min. value + for ($a=0;$a<$config_min;$a++){ + $output = $output.$valid_chars[(int(rand($rango)))]; + } + + # Fill to max; + if (($config_max - $config_min) != 0){ + for ($a=0;$aslerena@Egmail.com + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2005 by Sancho Lerena + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.4 or, +at your option, any later version of Perl 5 you may have available. + +Licenced under GPL + +=cut diff --git a/pandora_server/lib/PandoraFMS/WebServer.pm b/pandora_server/lib/PandoraFMS/WebServer.pm new file mode 100644 index 0000000000..5b08e26b9d --- /dev/null +++ b/pandora_server/lib/PandoraFMS/WebServer.pm @@ -0,0 +1,294 @@ +package PandoraFMS::WebServer; + +########################################################################## +# Pandora FMS Web Server. +########################################################################## +# Copyright (c) 2007-2021 Artica Soluciones Tecnologicas S.L +# This code is not free or OpenSource. Please don't redistribute. +########################################################################## + +use strict; +use warnings; + +use threads; +use threads::shared; +use Thread::Semaphore; + +use File::Temp qw(tempfile); +use HTML::Entities; +use POSIX qw(strftime); + +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + +use PandoraFMS::Goliat::GoliatTools; +use PandoraFMS::Goliat::GoliatConfig; + +use PandoraFMS::Tools; +use PandoraFMS::DB; +use PandoraFMS::Core; +use PandoraFMS::ProducerConsumerServer; + +# Inherits from PandoraFMS::ProducerConsumerServer +our @ISA = qw(PandoraFMS::ProducerConsumerServer); + +# Global variables +my @TaskQueue :shared; +my %PendingTasks :shared; +my $Sem :shared; +my $TaskSem :shared; + +######################################################################################## +# Web Server class constructor. +######################################################################################## +sub new ($$;$) { + my ($class, $config, $dbh) = @_; + + return undef unless defined ($config->{'webserver'}) and ($config->{'webserver'} == 1); + + # Initialize semaphores and queues + @TaskQueue = (); + %PendingTasks = (); + $Sem = Thread::Semaphore->new; + $TaskSem = Thread::Semaphore->new (0); + + # Call the constructor of the parent class + my $self = $class->SUPER::new($config, WEBSERVER, \&PandoraFMS::WebServer::data_producer, \&PandoraFMS::WebServer::data_consumer, $dbh); + + bless $self, $class; + return $self; +} + +############################################################################### +# Run. +############################################################################### +sub run ($) { + my $self = shift; + my $pa_config = $self->getConfig (); + + print_message ($pa_config, " [*] Starting " . $pa_config->{'rb_product_name'} . " Web Server.", 1); + + # Use Goliat with CURL + if ($pa_config->{'web_engine'} eq 'curl') { + require Goliat::GoliatCURL; + Goliat::GoliatCURL->import; + + # Check for CURL binary + if (system ("curl -V >$DEVNULL 2>&1") >> 8 != 0) { + logger ($pa_config, ' [E] CURL binary not found. Install CURL or uncomment the web_engine configuration token to use LWP.', 1); + print_message ($pa_config, ' [E] CURL binary not found. Install CURL or uncomment the web_engine configuration token to use LWP.', 1); + return undef; + } + # Check for pandora_exec binary + if (system ("\"" . $pa_config->{'plugin_exec'} . "\" 10 echo >$DEVNULL 2>&1") >> 8 != 0) { + logger ($pa_config, ' [E] ' . $pa_config->{'plugin_exec'} . ' not found. Please install it or add it to the PATH.', 1); + print_message ($pa_config, ' [E] ' . $pa_config->{'plugin_exec'} . ' not found. Please install it or add it to the PATH.', 1); + return undef; + } + } + # Use LWP by default + else { + require Goliat::GoliatLWP; + Goliat::GoliatLWP->import; + + if (! LWP::UserAgent->can('ssl_opts')) { + logger($pa_config, "LWP version $LWP::VERSION does not support SSL. Make sure version 6.0 or higher is installed.", 1); + print_message ($pa_config, " [W] LWP version $LWP::VERSION does not support SSL. Make sure version 6.0 or higher is installed.", 1); + } + } + + $self->setNumThreads ($pa_config->{'web_threads'}); + $self->SUPER::run (\@TaskQueue, \%PendingTasks, $Sem, $TaskSem); +} + +############################################################################### +# Data producer. +############################################################################### +sub data_producer ($) { + my $self = shift; + my ($pa_config, $dbh) = ($self->getConfig (), $self->getDBH ()); + + my @tasks; + my @rows; + + if (pandora_is_master($pa_config) == 0) { + @rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try + FROM tagente, tagente_modulo, tagente_estado + WHERE server_name = ? + AND tagente_modulo.id_agente = tagente.id_agente + AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo + AND tagente.disabled = 0 + AND tagente_modulo.id_modulo = 7 + AND tagente_modulo.disabled = 0 + AND (tagente_modulo.flag = 1 OR ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())) + ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC ', $pa_config->{'servername'}); + } else { + @rows = get_db_rows ($dbh, 'SELECT DISTINCT(tagente_modulo.id_agente_modulo), tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try + FROM tagente, tagente_modulo, tagente_estado, tserver + WHERE ((server_name = ?) OR (server_name = ANY(SELECT server_name FROM tserver WHERE status = 0 AND server_type = ?))) + AND tagente_modulo.id_agente = tagente.id_agente + AND tagente.disabled = 0 + AND tagente_modulo.disabled = 0 + AND tagente_modulo.id_modulo = 7 + AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo + AND ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP() OR tagente_modulo.flag = 1 ) + ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', $pa_config->{'servername'}, WEBSERVER); + } + + foreach my $row (@rows) { + + # Reset forced execution flag + if ($row->{'flag'} == 1) { + db_do ($dbh, 'UPDATE tagente_modulo SET flag = 0 WHERE id_agente_modulo = ?', $row->{'id_agente_modulo'}); + } + + push (@tasks, $row->{'id_agente_modulo'}); + } + + return @tasks; +} + +############################################################################### +# Data consumer. +############################################################################### +sub data_consumer ($$) { + my ($self, $module_id) = @_; + my ($pa_config, $dbh) = ($self->getConfig (), $self->getDBH ()); + our (@task_fails, @task_time, @task_ssec, @task_get_content); # Defined in GoliatLWP.pm and GoliatCURL. + + # Retrieve module data + my $module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = ?', $module_id); + return unless defined ($module); + + # Retrieve agent data + my $agent = get_db_single_row ($dbh, 'SELECT * FROM tagente WHERE id_agente = ?', $module->{'id_agente'}); + return unless defined $agent; + + # Save Goliat config to a temporary file + my ($fh, $temp_file) = tempfile(); + return unless defined ($fh); + + # Read the Goliat task + my $task = safe_output($module->{'plugin_parameter'}); + + # Delete any carriage returns + $task =~ s/\r//g; + + # Agent and module macros + my %macros = (_agent_ => (defined ($agent)) ? $agent->{'alias'} : '', + _agentdescription_ => (defined ($agent)) ? $agent->{'comentarios'} : '', + _agentstatus_ => (defined ($agent)) ? get_agent_status ($pa_config, $dbh, $agent->{'id_agente'}) : '', + _address_ => (defined ($agent)) ? $agent->{'direccion'} : '', + _module_ => (defined ($module)) ? $module->{'nombre'} : '', + _modulegroup_ => (defined ($module)) ? (get_module_group_name ($dbh, $module->{'id_module_group'}) || '') : '', + _moduledescription_ => (defined ($module)) ? $module->{'descripcion'} : '', + _modulestatus_ => (defined ($module)) ? get_agentmodule_status($pa_config, $dbh, $module->{'id_agente_modulo'}) : '', + _moduletags_ => (defined ($module)) ? pandora_get_module_url_tags ($pa_config, $dbh, $module->{'id_agente_modulo'}) : '', + _id_agent_ => (defined ($module)) ? $module->{'id_agente'} : '', + _interval_ => (defined ($module) && $module->{'module_interval'} != 0) ? $module->{'module_interval'} : (defined ($agent)) ? $agent->{'intervalo'} : '', + _target_ip_ => (defined ($agent)) ? $agent->{'direccion'} : '', + _target_port_ => (defined ($module)) ? $module->{'tcp_port'} : '', + _policy_ => (defined ($module)) ? enterprise_hook('get_policy_name', [$dbh, $module->{'id_policy_module'}]) : '', + _plugin_parameters_ => (defined ($module)) ? $module->{'plugin_parameter'} : '', + _email_tag_ => (defined ($module)) ? pandora_get_module_email_tags ($pa_config, $dbh, $module->{'id_agente_modulo'}) : '', + _phone_tag_ => (defined ($module)) ? pandora_get_module_phone_tags ($pa_config, $dbh, $module->{'id_agente_modulo'}) : '', + _name_tag_ => (defined ($module)) ? pandora_get_module_tags ($pa_config, $dbh, $module->{'id_agente_modulo'}) : '', + ); + $task = subst_alert_macros ($task, \%macros); + + # Goliat has some trouble parsing conf files without the newlines + $fh->print ("\n\n" . $task . "\n\n"); + close ($fh); + + # Global vars needed by Goliat + my (%config, @work_list, $check_string); + + # Goliat config defaults + $config{'verbosity'} = 1; + $config{'slave'} = 0; + $config{'port'} = 80; + $config{'log_file'} = "$DEVNULL"; + $config{'log_output'} = 0; + $config{'log_http'} = 0; + $config{'work_items'} = 0; + $config{'config_file'} = $temp_file; + $config{'agent'} = safe_output($module->{'plugin_user'}); + if ($module->{'max_retries'} != 0) { + $config{'retries'} = $module->{'max_retries'}; + } + if ($module->{'max_timeout'} != 0) { + $config{'timeout'} = $module->{'max_timeout'}; + } else { + $config{'timeout'} = $pa_config->{'web_timeout'}; + } + + $config{'proxy'} = $module->{'snmp_oid'}; + $config{'auth_user'} = safe_output($module->{'tcp_send'}); + $config{'auth_pass'} = safe_output($module->{'tcp_rcv'}); + $config{'auth_server'} = $module->{'ip_target'}; + $config{'auth_realm'} = $module->{'snmp_community'}; + $config{'http_check_type'} = $module->{'tcp_port'}; + $config{'moduleId'} = $module_id; + $config{'dbh'} = $dbh; + + # Pandora FMS variables passed to Goliat. + $config{'plugin_exec'} = $pa_config->{'plugin_exec'}; + + eval { + # Load Goliat config + g_load_config(\%config, \@work_list); + + # Run Goliat task + g_http_task (\%config, 0, @work_list); + }; + + if ($@) { + pandora_update_module_on_error ($pa_config, $module, $dbh); + unlink ($temp_file); + return; + } + + unlink ($temp_file); + + my $utimestamp = time (); + my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime($utimestamp)); + + # Get module type + my $module_type = get_db_value ($dbh, 'SELECT nombre FROM ttipo_modulo WHERE id_tipo = ?', $module->{'id_tipo_modulo'}); + + # Get data from Goliat + my $module_data; + { + no strict 'vars'; + if ($module_type eq 'web_proc') { + $module_data = ($task_fails[0] == 0 && $task_get_content[0] ne "") ? 1 : 0; + } + elsif ($module_type eq 'web_data') { + $module_data = $task_ssec[0]; + } elsif ($module_type eq 'web_server_status_code_string') { + my @resp_lines = split "\r\n", $task_get_content[0]; + $module_data = $resp_lines[0]; + } else { + $module_data = $task_get_content[0]; + } + } + + my %data = ("data" => $module_data); + pandora_process_module ($pa_config, \%data, undef, $module, $module_type, $timestamp, $utimestamp, $self->getServerID (), $dbh); + + my $agent_os_version = get_db_value ($dbh, 'SELECT os_version FROM tagente WHERE id_agente = ?', $module->{'id_agente'}); + + if (! defined ($agent_os_version) || $agent_os_version eq '') { + $agent_os_version = $pa_config->{'servername'}.'_Web'; + } + + # Todo: Implement here + # 1. Detect if exists a module with the same name, but with type generic_string. + # 2. If not, create the module, get the id's + # 3. Insert data coming from $task_get_string in that module + + pandora_update_agent ($pa_config, $timestamp, $module->{'id_agente'}, undef, undef, -1, $dbh); +} + +1; +__END__ From d43c51cc665d3278ae080afb37b31408d884caa1 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 22 Mar 2021 17:37:15 +0100 Subject: [PATCH 02/50] WIP: Backup upload --- .../extras/delete_files/delete_files.txt | 6 +- .../agentes/module_manager_editor_web.php | 468 ++++++++++++++++++ .../include/ajax/web_server_module_debug.php | 74 +++ .../class/WebServerModuleDebug.class.php | 407 +++++++++++++++ .../include/styles/WebServerModuleDebug.css | 10 + 5 files changed, 964 insertions(+), 1 deletion(-) create mode 100644 pandora_console/godmode/agentes/module_manager_editor_web.php create mode 100644 pandora_console/include/ajax/web_server_module_debug.php create mode 100644 pandora_console/include/class/WebServerModuleDebug.class.php create mode 100644 pandora_console/include/styles/WebServerModuleDebug.css diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt index 7832042fda..7c4d3b401b 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -78,4 +78,8 @@ pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatCURL.pm pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatConfig.pm pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatLWP.pm pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatTools.pm -pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/PandoraFMS/WebServer.pm \ No newline at end of file +pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/PandoraFMS/WebServer.pm +pandora_console/enterprise/godmode/agentes/module_manager_editor_web.php +pandora_console/enterprise/include/ajax/web_server_module_debug.php +pandora_console/enterprise/include/class/WebServerModuleDebug.class.php +pandora_console/enterprise/include/styles/WebServerModuleDebug.css \ No newline at end of file diff --git a/pandora_console/godmode/agentes/module_manager_editor_web.php b/pandora_console/godmode/agentes/module_manager_editor_web.php new file mode 100644 index 0000000000..a15da07caa --- /dev/null +++ b/pandora_console/godmode/agentes/module_manager_editor_web.php @@ -0,0 +1,468 @@ + 'modal', + 'style' => 'display: none;', + ] +); + +require_once $config['homedir'].'/include/ajax/web_server_module_debug.php'; + +define('ID_NETWORK_COMPONENT_TYPE', 7); + +if (!$tcp_port && !$id_agent_module) { + $tcp_port = 80; +} + +// plugin_server is the browser id +if ($plugin_user == '' && !$id_agent_module) { + $plugin_user = get_product_name().' / Webcheck'; +} + +// plugin_server is the referer +if ($plugin_pass == '' && !$id_agent_module) { + $plugin_pass = 1; +} + +if (empty($update_module_id)) { + // Function in module_manager_editor_common.php + add_component_selection(ID_NETWORK_COMPONENT_TYPE); +} else { + // TODO: Print network component if available +} + +$data = []; +$data[0] = __('Web checks'); + +$adopt = false; +if (isset($id_agent_module)) { + $adopt = policies_is_module_adopt($id_agent_module); +} + +$id_policy_module = (int) get_parameter('id_policy_module', ''); +if ($id_policy_module) { + $module = policies_get_module($id_policy_module); + $plugin_parameter = $module['plugin_parameter']; +} + +if (!$adopt) { + $data[1] = html_print_textarea( + 'plugin_parameter', + 15, + 65, + $plugin_parameter, + $disabledTextBecauseInPolicy, + true + ); +} else { + $data[1] = html_print_textarea( + 'plugin_parameter', + 15, + 65, + $plugin_parameter, + false, + true + ); +} + +$table_simple->colspan['web_checks'][1] = 2; + +// Disable debug button if module has not started. +if ($id_agent_module > 0 + && db_get_value_filter( + 'debug_content', + 'tagente_modulo', + ['id_agente_modulo' => $id_agent_module] + ) !== null +) { + $disableDebug = false; + $hintDebug = __('Debug remotely this module'); +} else { + $disableDebug = true; + $hintDebug = __('Debug this module once it has been initialized'); +} + +$suc_err_check = ' '; +$suc_err_check .= ' '; +$data[2] = html_print_button( + __('Load basic'), + 'btn_loadbasic', + false, + '', + 'class="sub config"', + true +).ui_print_help_tip(__('Load a basic structure on Web Checks'), true); +$data[2] .= '

'.html_print_button( + __('Check'), + 'btn_checkconf', + false, + '', + 'class="sub upd"', + true +).ui_print_help_tip(__('Check the correct structure of the WebCheck'), true).$suc_err_check; +$data[2] .= '

'.html_print_button( + __('Debug'), + 'btn_debugModule', + $disableDebug, + '', + 'class="sub config" onClick="loadDebugWindow()"', + true +).ui_print_help_tip($hintDebug, true); + + +push_table_simple($data, 'web_checks'); + +$http_checks_type = [ + 0 => 'Anyauth', + 1 => 'NTLM', + 2 => 'DIGEST', + 3 => 'BASIC', +]; + +$data = []; +$data[0] = __('Check type'); +$data[1] = html_print_select($http_checks_type, 'tcp_port', $tcp_port, false, '', '', true, false, false); + +push_table_advanced($data, 'web_0'); + +$data = []; +$data[0] = __('Requests'); +$data[1] = html_print_input_text('plugin_pass', $plugin_pass, '', 10, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy); +$data[2] = ''; +$data[3] = __('Agent browser id'); +$data[4] = html_print_input_text('plugin_user', $plugin_user, '', 30, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy); + +push_table_advanced($data, 'web_1'); + +$data = []; +$data[0] = __('HTTP auth (login)'); +$data[1] = html_print_input_text('http_user', $plugin_parameter_http_user, '', 10, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy); +$data[2] = ''; +$data[3] = __('HTTP auth (password)'); +$data[4] = html_print_input_password('http_pass', $plugin_parameter_http_pass, '', 30, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy); + +push_table_advanced($data, 'web_2'); + +$data = []; + +$data[0] = __('Proxy URL'); +$data[1] = html_print_input_text('snmp_oid', $snmp_oid, '', 30, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy); +$data[2] = $data[3] = $data[4] = ''; +push_table_advanced($data, 'web_3'); + +$data = []; + +$data[0] = __('Proxy auth (login)'); +$data[1] = html_print_input_text('tcp_send', $tcp_send, '', 30, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy); + +$data[2] = ''; +$data[3] = __('Proxy auth (pass)'); +$data[4] = html_print_input_password('tcp_rcv', $tcp_rcv, '', 30, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy); + +push_table_advanced($data, 'web_4'); + +$data = []; + +$data[0] = __('Proxy auth (server)'); +$data[1] = html_print_input_text('ip_target', $ip_target, '', 30, 100, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy); + +$data[2] = ''; +$data[3] = __('Proxy auth (realm)'); +$data[4] = html_print_input_text('snmp_community', $snmp_community, '', 30, 100, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy); + +push_table_advanced($data, 'web_5'); + +// Add some strings to be used from javascript +$texts = [ + 'lines_before_begin' => __('First line must be "task_begin"'), + 'missed_begin' => __('Webchecks configuration is empty'), + 'missed_end' => __('Last line must be "task_end"'), + 'lines_after_end' => __('Last line must be "task_end"'), + 'unknown_token' => __("There is a line with a unknown token 'token_fail'."), + 'missed_get_post' => __("There isn't get or post"), + 'correct' => __('Web checks are built correctly'), +]; + +foreach ($texts as $code => $text) { + echo ''; +} +?> + \ No newline at end of file diff --git a/pandora_console/include/ajax/web_server_module_debug.php b/pandora_console/include/ajax/web_server_module_debug.php new file mode 100644 index 0000000000..d243257cbd --- /dev/null +++ b/pandora_console/include/ajax/web_server_module_debug.php @@ -0,0 +1,74 @@ + '[WebServerModuleDebug]'.$e->getMessage() ]); + exit; + } else { + echo '[WebServerModuleDebug]'.$e->getMessage(); + } + + // Stop this execution, but continue 'globally'. + return; +} + +// AJAX controller. +if (is_ajax()) { + $method = get_parameter('method'); + + if (method_exists($obj, $method) === true) { + $obj->{$method}(); + } else { + $obj->error('Method not found. ['.$method.']'); + } + + // Stop any execution. + exit; +} else { + // Run. + $obj->run(); +} diff --git a/pandora_console/include/class/WebServerModuleDebug.class.php b/pandora_console/include/class/WebServerModuleDebug.class.php new file mode 100644 index 0000000000..e0e6f23c84 --- /dev/null +++ b/pandora_console/include/class/WebServerModuleDebug.class.php @@ -0,0 +1,407 @@ + 'noaccess']); + } + + include 'general/noaccess.php'; + exit; + } + + // Parameter assigments. + $this->ajaxController = $ajaxController; + $this->query = ''; + $this->idAgentModule = $idAgentModule; + // Hardcoded request timeout. + $this->requestTimeout = 15; + + return $this; + + } + + + /** + * Run Module Debug window. + * + * @return void + */ + public function run() + { + // Added all necessary basic files for QueryResult. + ui_require_css_file('ace'); + ui_require_javascript_file('ace', 'include/javascript/ace/'); + // Load Javascript. + $this->loadJS(); + // CSS. + ui_require_css_file('wizard'); + ui_require_css_file('discovery'); + // Specific CSS for this feature. + ui_require_css_file('WebServerModuleDebug', '/include/styles/', true); + + } + + + /** + * Show the modal with the QueryResult. + * + * @return void + */ + public function showWebServerDebug() + { + // Show QueryResult editor. + ui_query_result_editor('webserverdebug'); + // Spinner for wait loads. + html_print_div( + [ + 'id' => 'WebServerDebugSpinner', + 'style' => 'visibility: hidden;', + 'content' => __('Performing query. Please wait.').' '.html_print_image('images/spinner.gif', true), + ] + ); + ?> + + + + $this->idAgentModule, + ] + ); + + $this->query = ($outputDebugQuery !== false) ? $outputDebugQuery : __('Please, wait for a first execution of module'); + + return $this->query; + } + + + /** + * Perform the cURL execution. + * + * @return void + * @throws Exception $e Error message. + */ + public function executeCommand() + { + try { + $executionForPerform = io_safe_output(get_parameter('text')); + // If the execution comes empty. + if (empty($executionForPerform) === true) { + throw new Exception('Execution failed'); + } + + // For security reasons, only allow the 'curl' command. + $executionForPerform = strstr($executionForPerform, 'curl'); + // Avoid pipes or concatenation of commands. + $unallowedChars = [ + '|', + '&', + '||', + '&&', + ';', + '\n', + ]; + $executionForPerform = str_replace( + $unallowedChars, + ' ', + $executionForPerform + ); + // Set execution timeout. + $executionForPerform .= sprintf( + $executionForPerform.' -m %d', + $this->requestTimeout + ); + + // Perform the execution. + system($executionForPerform, $returnCode); + // If execution does not got well. + if ($returnCode != 0) { + switch ($returnCode) { + case '2': + throw new Exception('Failed to initialize. Review the syntax.'); + + case '3': + throw new Exception('URL malformed. The syntax was not correct.'); + + case '5': + throw new Exception('Couldn\'t resolve proxy. The given proxy host could not be resolved.'); + + case '6': + throw new Exception('Couldn\'t resolve host. The given remote host could not be resolved.'); + + case '7': + throw new Exception('Failed to connect to host.'); + + default: + throw new Exception('Failed getting data.'); + } + } + } catch (Exception $e) { + // Show execution error message. + echo __($e->getMessage()); + } + + exit; + } + + + /** + * Loads JS and return code. + * + * @return string + */ + public function loadJS() + { + $str = ''; + ob_start(); + ?> + + + + Date: Mon, 22 Mar 2021 17:39:24 +0100 Subject: [PATCH 03/50] WIP: Backup upload --- .../godmode/agentes/module_manager.php | 164 ++++++++++++------ .../godmode/agentes/module_manager_editor.php | 16 ++ pandora_server/bin/pandora_server | 2 + pandora_server/lib/PandoraFMS/WebServer.pm | 20 ++- 4 files changed, 144 insertions(+), 58 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 91c6395b96..6f2747de19 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -1,22 +1,38 @@ '; } else { echo '
'; @@ -73,25 +89,31 @@ echo '
'; $network_available = db_get_sql( 'SELECT count(*) FROM tserver - WHERE server_type = 1' + WHERE server_type = '.SERVER_TYPE_NETWORK ); // POSTGRESQL AND ORACLE COMPATIBLE. $wmi_available = db_get_sql( 'SELECT count(*) FROM tserver - WHERE server_type = 6' + WHERE server_type = '.SERVER_TYPE_WMI ); // POSTGRESQL AND ORACLE COMPATIBLE. $plugin_available = db_get_sql( 'SELECT count(*) FROM tserver - WHERE server_type = 4' + WHERE server_type = '.SERVER_TYPE_PLUGIN ); // POSTGRESQL AND ORACLE COMPATIBLE. $prediction_available = db_get_sql( 'SELECT count(*) FROM tserver - WHERE server_type = 5' + WHERE server_type = '.SERVER_TYPE_PREDICTION +); +// POSTGRESQL AND ORACLE COMPATIBLE. +$web_available = db_get_sql( + 'SELECT count(*) +FROM tserver +WHERE server_type = '.SERVER_TYPE_WEB ); // POSTGRESQL AND ORACLE COMPATIBLE. // Development mode to use all servers. @@ -122,6 +144,10 @@ if ($prediction_available) { $modules['predictionserver'] = __('Create a new prediction server module'); } +if ($web_available) { + $modules['webserver'] = __('Create a new web Server module'); +} + if (enterprise_installed()) { set_enterprise_module_types($modules); } @@ -298,6 +324,7 @@ if ($module_action === 'delete') { switch ($config['dbtype']) { case 'mysql': case 'postgresql': + default: $result = db_process_sql_delete( 'tagente_estado', ['id_agente_modulo' => $id_agent_module_del] @@ -388,10 +415,8 @@ if ($module_action === 'delete') { } } - // Check for errors. - if ($error != 0) { - } else { + if ((int) $error == 0) { $count_correct_delete_modules++; } } @@ -489,6 +514,7 @@ switch ($sortField) { switch ($config['dbtype']) { case 'mysql': case 'postgresql': + default: $order[] = [ 'field' => 'tagente_modulo.nombre', 'order' => 'ASC', @@ -509,6 +535,7 @@ switch ($sortField) { switch ($config['dbtype']) { case 'mysql': case 'postgresql': + default: $order[] = [ 'field' => 'tagente_modulo.nombre', 'order' => 'DESC', @@ -523,6 +550,10 @@ switch ($sortField) { break; } break; + + default: + // Do none. + break; } break; @@ -543,6 +574,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Do none. + break; } break; @@ -563,6 +598,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Do none. + break; } break; @@ -583,6 +622,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Do none. + break; } break; @@ -598,6 +641,7 @@ switch ($sortField) { switch ($config['dbtype']) { case 'mysql': case 'postgresql': + default: $order[] = [ 'field' => 'nombre', 'order' => 'ASC', @@ -622,7 +666,7 @@ if (!empty($order)) { $first = true; foreach ($order as $ord) { - if ($first) { + if ($first === true) { $first = false; } else { $order_sql .= ','; @@ -635,31 +679,35 @@ foreach ($order as $ord) { $limit = (int) $config['block_size']; $offset = (int) get_parameter('offset'); -$params = ($checked) ? 'tagente_modulo.*, tmodule_group.*' : implode( - ',', - [ - 'tagente_modulo.id_agente_modulo', - 'id_tipo_modulo', - 'descripcion', - 'nombre', - 'max', - 'min', - 'module_interval', - 'id_modulo', - 'id_module_group', - 'disabled', - 'max_warning', - 'min_warning', - 'str_warning', - 'max_critical', - 'min_critical', - 'str_critical', - 'quiet', - 'critical_inverse', - 'warning_inverse', - 'id_policy_module', - ] -); +if ((bool) $checked === true) { + $params = 'tagente_modulo.*, tmodule_group.*'; +} else { + $params = implode( + ',', + [ + 'tagente_modulo.id_agente_modulo', + 'id_tipo_modulo', + 'descripcion', + 'nombre', + 'max', + 'min', + 'module_interval', + 'id_modulo', + 'id_module_group', + 'disabled', + 'max_warning', + 'min_warning', + 'str_warning', + 'max_critical', + 'min_critical', + 'str_critical', + 'quiet', + 'critical_inverse', + 'warning_inverse', + 'id_policy_module', + ] + ); +} $where = sprintf('delete_pending = 0 AND id_agente = %s', $id_agente); @@ -686,7 +734,11 @@ if (isset($config['paginate_module'])) { if ($paginate_module) { if (!isset($limit_sql)) { - $limit_sql = " LIMIT $offset, $limit "; + $limit_sql = sprintf( + 'LIMIT %s, %s', + $offset, + $limit + ); } } else { $limit_sql = ''; @@ -732,7 +784,13 @@ if ($modules === false) { } // Prepare pagination. -$url = '?'.'sec=gagente&'.'tab=module&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$id_agente.'&'.'sort_field='.$sortField.'&'.'&sort='.$sort.'&'.'search_string='.urlencode($search_string); +$url = sprintf( + '?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente=%s&sort_field=%s&sort=%s&search_string=%s', + $id_agente, + $sortField, + $sort, + urlencode($search_string) +); if ($paginate_module) { ui_pagination($total_modules, $url); diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index c350866cf0..1310fa80bb 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -682,6 +682,22 @@ switch ($moduletype) { include 'module_manager_editor_wmi.php'; break; + case 'webserver': + case MODULE_WEB: + $moduletype = MODULE_WEB; + // Remove content of $ip_target when it is ip_agent because + // it is used as HTTP auth (server) ....ONLY IN NEW MODULE!!! + if (empty($id_agent_module) + && ($ip_target === agents_get_address($id_agente)) + ) { + $ip_target = ''; + } + + $categories = [9]; + include 'module_manager_editor_common.php'; + include 'module_manager_editor_web.php'; + break; + // WARNING: type 7 is reserved on enterprise. default: if (enterprise_include( diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index d82944f93b..44d1e4dd33 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -38,6 +38,7 @@ use PandoraFMS::DiscoveryServer; use PandoraFMS::WMIServer; use PandoraFMS::PluginServer; use PandoraFMS::PredictionServer; +use PandoraFMS::WebServer; # Constants for Win32 services. use constant WIN32_SERVICE_STOPPED => 0x01; @@ -123,6 +124,7 @@ sub pandora_startup () { push (@Servers, new PandoraFMS::WMIServer (\%Config, $DBH)); push (@Servers, new PandoraFMS::PluginServer (\%Config, $DBH)); push (@Servers, new PandoraFMS::PredictionServer (\%Config, $DBH)); + push (@Servers, new PandoraFMS::WebServer (\%Config, $DBH)); } else { # Metaconsole service modules are run by the prediction server push (@Servers, new PandoraFMS::PredictionServer (\%Config, $DBH)); diff --git a/pandora_server/lib/PandoraFMS/WebServer.pm b/pandora_server/lib/PandoraFMS/WebServer.pm index 5b08e26b9d..6723848d9f 100644 --- a/pandora_server/lib/PandoraFMS/WebServer.pm +++ b/pandora_server/lib/PandoraFMS/WebServer.pm @@ -1,10 +1,20 @@ package PandoraFMS::WebServer; - ########################################################################## # Pandora FMS Web Server. +# Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org ########################################################################## # Copyright (c) 2007-2021 Artica Soluciones Tecnologicas S.L -# This code is not free or OpenSource. Please don't redistribute. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser 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. ########################################################################## use strict; @@ -21,14 +31,14 @@ use POSIX qw(strftime); # Default lib dir for RPM and DEB packages use lib '/usr/lib/perl5'; -use PandoraFMS::Goliat::GoliatTools; -use PandoraFMS::Goliat::GoliatConfig; - use PandoraFMS::Tools; use PandoraFMS::DB; use PandoraFMS::Core; use PandoraFMS::ProducerConsumerServer; +use Goliat::GoliatTools; +use Goliat::GoliatConfig; + # Inherits from PandoraFMS::ProducerConsumerServer our @ISA = qw(PandoraFMS::ProducerConsumerServer); From 4ee0c580bb8aad79b1bd66e7d7fd6e5e46aab649 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 22 Mar 2021 17:52:11 +0100 Subject: [PATCH 04/50] WIP: Backup upload --- .../godmode/agentes/module_manager_editor_web.php | 6 +++--- pandora_console/include/ajax/web_server_module_debug.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_web.php b/pandora_console/godmode/agentes/module_manager_editor_web.php index a15da07caa..3d02289160 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_web.php +++ b/pandora_console/godmode/agentes/module_manager_editor_web.php @@ -92,16 +92,16 @@ $data[0] = __('Web checks'); $adopt = false; if (isset($id_agent_module)) { - $adopt = policies_is_module_adopt($id_agent_module); + $adopt = enterprise_hook('policies_is_module_adopt', [$id_agent_module]); } $id_policy_module = (int) get_parameter('id_policy_module', ''); if ($id_policy_module) { - $module = policies_get_module($id_policy_module); + $module = enterprise_hook('policies_get_module', [$id_policy_module]); $plugin_parameter = $module['plugin_parameter']; } -if (!$adopt) { +if ((bool) $adopt === false) { $data[1] = html_print_textarea( 'plugin_parameter', 15, diff --git a/pandora_console/include/ajax/web_server_module_debug.php b/pandora_console/include/ajax/web_server_module_debug.php index d243257cbd..36d82165fe 100644 --- a/pandora_console/include/ajax/web_server_module_debug.php +++ b/pandora_console/include/ajax/web_server_module_debug.php @@ -33,7 +33,7 @@ global $id_agent_module; require_once $config['homedir'].'/include/class/WebServerModuleDebug.class.php'; // This page. -$ajaxPage = '/include/ajax/web_server_module_debug'; +$ajaxPage = $config['homedir'].'/include/ajax/web_server_module_debug'; // Control call flow for debug window. try { From 3cb504397f3d727ac8bb12673204fc724c57a4d2 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 23 Mar 2021 15:15:07 +0100 Subject: [PATCH 05/50] Solve issues for compilation --- pandora_server/lib/PandoraFMS/Goliat/GoliatCURL.pm | 4 ++-- pandora_server/lib/PandoraFMS/Goliat/GoliatConfig.pm | 4 ++-- pandora_server/lib/PandoraFMS/Goliat/GoliatLWP.pm | 4 ++-- pandora_server/lib/PandoraFMS/Goliat/GoliatTools.pm | 2 +- pandora_server/lib/PandoraFMS/WebServer.pm | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Goliat/GoliatCURL.pm b/pandora_server/lib/PandoraFMS/Goliat/GoliatCURL.pm index 6f82ba3a00..63fe5ca5de 100755 --- a/pandora_server/lib/PandoraFMS/Goliat/GoliatCURL.pm +++ b/pandora_server/lib/PandoraFMS/Goliat/GoliatCURL.pm @@ -5,9 +5,9 @@ # This code is not free or OpenSource. Please don't redistribute. ################################################################################## -package Goliat::GoliatCURL; +package PandoraFMS::Goliat::GoliatCURL; -use Goliat::GoliatTools; +use PandoraFMS::Goliat::GoliatTools; use strict; use warnings; diff --git a/pandora_server/lib/PandoraFMS/Goliat/GoliatConfig.pm b/pandora_server/lib/PandoraFMS/Goliat/GoliatConfig.pm index 25ae73b30f..da3247c1e8 100755 --- a/pandora_server/lib/PandoraFMS/Goliat/GoliatConfig.pm +++ b/pandora_server/lib/PandoraFMS/Goliat/GoliatConfig.pm @@ -5,12 +5,12 @@ # This code is not free or OpenSource. Please don't redistribute. ########################################################################## -package Goliat::GoliatConfig; +package PandoraFMS::Goliat::GoliatConfig; use strict; use warnings; -use Goliat::GoliatTools; use PandoraFMS::Tools; +use PandoraFMS::Goliat::GoliatTools; require Exporter; our @ISA = ("Exporter"); diff --git a/pandora_server/lib/PandoraFMS/Goliat/GoliatLWP.pm b/pandora_server/lib/PandoraFMS/Goliat/GoliatLWP.pm index 7b66d2457e..3117ab1515 100755 --- a/pandora_server/lib/PandoraFMS/Goliat/GoliatLWP.pm +++ b/pandora_server/lib/PandoraFMS/Goliat/GoliatLWP.pm @@ -5,9 +5,9 @@ # This code is not free or OpenSource. Please don't redistribute. ################################################################################## -package Goliat::GoliatLWP; +package PandoraFMS::Goliat::GoliatLWP; -use Goliat::GoliatTools; +use PandoraFMS::Goliat::GoliatTools; use strict; use warnings; diff --git a/pandora_server/lib/PandoraFMS/Goliat/GoliatTools.pm b/pandora_server/lib/PandoraFMS/Goliat/GoliatTools.pm index 42e1cc0836..2c320477dc 100755 --- a/pandora_server/lib/PandoraFMS/Goliat/GoliatTools.pm +++ b/pandora_server/lib/PandoraFMS/Goliat/GoliatTools.pm @@ -5,7 +5,7 @@ # This code is not free or OpenSource. Please don't redistribute. ############################################################################### -package Goliat::GoliatTools; +package PandoraFMS::Goliat::GoliatTools; use 5.008004; use strict; diff --git a/pandora_server/lib/PandoraFMS/WebServer.pm b/pandora_server/lib/PandoraFMS/WebServer.pm index 6723848d9f..69ae4dbf93 100644 --- a/pandora_server/lib/PandoraFMS/WebServer.pm +++ b/pandora_server/lib/PandoraFMS/WebServer.pm @@ -36,8 +36,8 @@ use PandoraFMS::DB; use PandoraFMS::Core; use PandoraFMS::ProducerConsumerServer; -use Goliat::GoliatTools; -use Goliat::GoliatConfig; +use PandoraFMS::Goliat::GoliatTools; +use PandoraFMS::Goliat::GoliatConfig; # Inherits from PandoraFMS::ProducerConsumerServer our @ISA = qw(PandoraFMS::ProducerConsumerServer); From a8e3c10846f8933ac29c9f5797ccfb2cc880cbd5 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 30 Mar 2021 16:31:45 +0200 Subject: [PATCH 06/50] Added comments header and improve code --- pandora_console/include/functions_api.php | 43 ++++++++++++++++------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 6691ccc605..46be09aa9a 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1,16 +1,33 @@ Date: Thu, 8 Apr 2021 11:28:01 +0200 Subject: [PATCH 07/50] Avoiding clickjacking --- pandora_console/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/index.php b/pandora_console/index.php index 09cbdb7962..1add9babbe 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -220,7 +220,8 @@ echo ''."\n"; // This starts the page head. In the callback function, // $page['head'] array content will be processed into the head. ob_start('ui_process_page_head'); - +// Avoid clickjacking. +header('X-Frame-Options: SAMEORIGIN'); // Enterprise main. enterprise_include_once('index.php'); From 93f355132626d25baa51c0180cafd4f7a710ab26 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 12 Apr 2021 18:17:09 +0200 Subject: [PATCH 08/50] Create interface views --- pandora_console/include/ajax/agent.php | 16 + .../agentes/interface_view.functions.php | 738 ++++++++++++++++++ .../operation/agentes/interface_view.php | 259 ++++++ .../operation/agentes/ver_agente.php | 32 + pandora_console/operation/menu.php | 3 + 5 files changed, 1048 insertions(+) create mode 100644 pandora_console/operation/agentes/interface_view.functions.php create mode 100644 pandora_console/operation/agentes/interface_view.php diff --git a/pandora_console/include/ajax/agent.php b/pandora_console/include/ajax/agent.php index 9386dfa7e9..c593a35240 100644 --- a/pandora_console/include/ajax/agent.php +++ b/pandora_console/include/ajax/agent.php @@ -27,12 +27,28 @@ ob_clean(); // * q // * id_group $search_agents = (bool) get_parameter('search_agents'); +$get_agents_interfaces = (bool) get_parameter('get_agents_interfaces'); +$id_agents = get_parameter('id_agents', []); $get_agents_group = (bool) get_parameter('get_agents_group', false); $force_local = (bool) get_parameter('force_local', false); if (https_is_running()) { header('Content-type: application/json'); } +if ($get_agents_interfaces) { + $agents_interfaces = agents_get_network_interfaces($id_agents); + + // Include alias per agent. + foreach ($agents_interfaces as $key => $value) { + $agent_alias = agents_get_alias($key); + $agents_interfaces[$key]['agent_alias'] = $agent_alias; + } + + echo json_encode($agents_interfaces); + + return; +} + if ($get_agents_group) { $id_group = (int) get_parameter('id_group', -1); $mode = (string) get_parameter('mode', 'json'); diff --git a/pandora_console/operation/agentes/interface_view.functions.php b/pandora_console/operation/agentes/interface_view.functions.php new file mode 100644 index 0000000000..df0371c8fe --- /dev/null +++ b/pandora_console/operation/agentes/interface_view.functions.php @@ -0,0 +1,738 @@ +width = '100%'; + $table->cellspacing = 0; + $table->cellpadding = 0; + $table->class = 'databox filters'; + + if ($sec === 'view') { + $table->style[0] = 'font-weight: bold;'; + $table->style[1] = 'font-weight: bold;'; + $table->style[2] = 'font-weight: bold;'; + $table->style[3] = 'font-weight: bold;'; + $table->style[4] = 'font-weight: bold;'; + + $table->data[0][0] = __('Group'); + $table->data[0][1] .= html_print_select_groups( + $config['id_user'], + 'AR', + true, + 'group_id', + $ag_group, + '', + '', + '0', + true, + false, + false, + '', + false, + '', + false, + false, + 'id_grupo', + false + ); + + $table->data[0][2] = __('Recursion'); + + $table->data[0][2] .= html_print_input( + [ + 'type' => 'checkbox', + 'name' => 'recursion', + 'return' => true, + 'checked' => $recursion, + 'value' => 1, + ] + ); + + $table->data[1][0] = __('Agents'); + + if (empty($agents) === true || $agents == -1) { + $agents = []; + } + + $table->data[1][1] = html_print_select( + [], + 'selected_agents[]', + '', + '', + '', + 0, + true, + true, + true, + '', + false, + 'min-width: 180px; max-width: 200px;' + ); + + // Interfaces. + $table->data[1][3] = ''.__('Interfaces').''; + $table->data[1][4] = html_print_select( + [], + 'selected_interfaces[]', + $selected_interfaces, + '', + '', + 0, + true, + true, + true, + '', + false, + 'min-width: 180px; max-width: 200px;' + ); + + $table->data[2][4] = html_print_submit_button( + __('Show'), + 'uptbutton', + false, + 'class="sub search mgn_tp_0"', + true + ); + + $filters = '
'; + + $filters .= html_print_table($table, true); + $filters .= '
'; + } else { + $table->style[0] = 'font-weight: bold;'; + + $table->data[0][0] = ''.__('Interfaces').''; + $table->data[0][1] = html_print_select( + [], + 'selected_interfaces[]', + $selected_interfaces, + '', + '', + 0, + true, + true, + true, + '', + false, + 'min-width: 180px; max-width: 200px;' + ); + + $table->data[1][1] = html_print_submit_button( + __('Show'), + 'uptbutton', + false, + 'class="sub search mgn_tp_0"', + true + ); + + $filters = '
'; + + $filters .= html_print_table($table, true); + $filters .= '
'; + } + + ui_toggle( + $filters, + __('Interface filter'), + __('Interface filter'), + 'ui_toggle_if_filter' + ); + unset($table); +} + + +/** + * Print interfaces table. + * + * @param array data Array containing data of interfaces. + * @param array selected_agents Selected agents. + * @param array selected_interfaces Selected interfaces. + * @param string sort_field Field used to sort table. + * @param string sort Direction used to sort by field. + * @param int pagination_index Active page (used for pagination). + * @param string sec Active section of page. + */ +function print_table( + $data, + $selected_agents, + $selected_interfaces, + $sort_field, + $sort, + $pagination_index, + $sec +) { + global $config; + + $selected = true; + $select_if_name_up = false; + $select_if_name_down = false; + $select_if_speed_data_up = false; + $select_if_speed_data_down = false; + $select_if_in_octets_up = false; + $select_if_in_octets_down = false; + $select_if_out_octets_up = false; + $select_if_out_octets_down = false; + $select_if_usage_module_data_in_up = false; + $select_if_usage_module_data_in_down = false; + $select_if_usage_module_data_out_up = false; + $select_if_usage_module_data_out_down = false; + $select_if_last_data_up = false; + $select_if_last_data_down = false; + $order = null; + + switch ($sort_field) { + case 'if_agent_name': + switch ($sort) { + case 'up': + $select_if_agent_name_up = $selected; + $order = [ + 'field' => 'if_agent_name', + 'order' => 'ASC', + ]; + break; + + case 'down': + default: + $select_if_agent_name_down = $selected; + $order = [ + 'field' => 'if_agent_name', + 'order' => 'DESC', + ]; + break; + } + break; + + case 'if_name': + switch ($sort) { + case 'up': + $select_if_name_up = $selected; + $order = [ + 'field' => 'if_name', + 'order' => 'ASC', + ]; + break; + + case 'down': + default: + $select_if_name_down = $selected; + $order = [ + 'field' => 'if_name', + 'order' => 'DESC', + ]; + break; + } + break; + + case 'if_speed_data': + switch ($sort) { + case 'up': + $select_if_speed_data_up = $selected; + $order = [ + 'field' => 'if_speed_data', + 'order' => 'ASC', + ]; + break; + + case 'down': + default: + $select_if_speed_data_down = $selected; + $order = [ + 'field' => 'if_speed_data', + 'order' => 'DESC', + ]; + break; + } + break; + + case 'if_in_octets': + switch ($sort) { + case 'up': + $select_if_in_octets_up = $selected; + $order = [ + 'field' => 'if_in_octets', + 'order' => 'ASC', + ]; + break; + + case 'down': + default: + $select_if_in_octets_down = $selected; + $order = [ + 'field' => 'if_in_octets', + 'order' => 'DESC', + ]; + break; + } + break; + + case 'if_out_octets': + switch ($sort) { + case 'up': + $select_if_out_octets_up = $selected; + $order = [ + 'field' => 'if_out_octets', + 'order' => 'ASC', + ]; + break; + + case 'down': + default: + $select_if_out_octets_down = $selected; + $order = [ + 'field' => 'if_out_octets', + 'order' => 'DESC', + ]; + break; + } + break; + + case 'if_usage_module_data_in': + switch ($sort) { + case 'up': + $select_if_usage_module_data_in_up = $selected; + $order = [ + 'field' => 'if_usage_module_data_in', + 'order' => 'ASC', + ]; + break; + + case 'down': + default: + $select_if_usage_module_data_in_down = $selected; + $order = [ + 'field' => 'if_usage_module_data_in', + 'order' => 'DESC', + ]; + break; + } + break; + + case 'if_usage_module_data_out': + switch ($sort) { + case 'up': + $select_if_usage_module_data_out_up = $selected; + $order = [ + 'field' => 'if_usage_module_data_out', + 'order' => 'ASC', + ]; + break; + + case 'down': + default: + $select_if_usage_module_data_out_down = $selected; + $order = [ + 'field' => 'if_usage_module_data_out', + 'order' => 'DESC', + ]; + break; + } + break; + + case 'if_last_data': + switch ($sort) { + case 'up': + $select_if_last_data_up = $selected; + $order = [ + 'field' => 'if_last_data', + 'order' => 'ASC', + ]; + break; + + case 'down': + default: + $select_if_last_data_down = $selected; + $order = [ + 'field' => 'if_last_data', + 'order' => 'DESC', + ]; + break; + } + break; + + default: + $select_if_agent_name = ($sec === 'view') ? true : false; + $select_if_name_up = ($sec === 'estado') ? true : false; + $select_if_name_down = false; + $select_if_speed_data_up = false; + $select_if_speed_data_down = false; + $select_if_in_octets_up = false; + $select_if_in_octets_down = false; + $select_if_out_octets_up = false; + $select_if_out_octets_down = false; + $select_if_usage_module_data_in_up = false; + $select_if_usage_module_data_in_down = false; + $select_if_usage_module_data_out_up = false; + $select_if_usage_module_data_out_down = false; + $select_if_last_data_up = false; + $select_if_last_data_down = false; + break; + } + + if ($sec === 'estado') { + $agent_id = (int) get_parameter('id_agente', 0); + + $sort_url_page = 'ver_agente'; + $sec = 'estado'; + $query_params = '&id_agente='.$agent_id.'&tab=interface'; + } else { + $sort_url_page = 'interface_view'; + $sec = 'view'; + $query_params = ''; + } + + // Build URLs to sort the table. + $url_if_agent_name = 'index.php?sec='.$sec.'&sec2=operation/agentes/'.$sort_url_page.$query_params; + $url_if_name = 'index.php?sec='.$sec.'&sec2=operation/agentes/'.$sort_url_page.$query_params; + $url_if_speed = 'index.php?sec='.$sec.'&sec2=operation/agentes/'.$sort_url_page.$query_params; + $url_if_in_octets = 'index.php?sec='.$sec.'&sec2=operation/agentes/'.$sort_url_page.$query_params; + $url_if_out_octets = 'index.php?sec='.$sec.'&sec2=operation/agentes/'.$sort_url_page.$query_params; + $url_if_bandwidth_usage_in = 'index.php?sec='.$sec.'&sec2=operation/agentes/'.$sort_url_page.$query_params; + $url_if_bandwidth_usage_out = 'index.php?sec='.$sec.'&sec2=operation/agentes/'.$sort_url_page.$query_params; + $last_data = 'index.php?sec='.$sec.'&sec2=operation/agentes/'.$sort_url_page.$query_params; + + $selected_agents_query_str = ''; + $selected_interfaces_query_str = ''; + + foreach ($selected_agents as $key => $agent) { + $selected_agents_query_str .= '&selected_agents['.$key.']='.$agent; + } + + foreach ($selected_interfaces as $key => $interface) { + $selected_interfaces_query_str .= '&selected_interfaces['.$key.']='.$interface; + } + + $url_if_agent_name .= $selected_agents_query_str.'&'.$selected_interfaces_query_str; + $url_if_name .= $selected_agents_query_str.'&'.$selected_interfaces_query_str; + $url_if_speed .= $selected_agents_query_str.'&'.$selected_interfaces_query_str; + $url_if_in_octets .= $selected_agents_query_str.'&'.$selected_interfaces_query_str; + $url_if_out_octets .= $selected_agents_query_str.'&'.$selected_interfaces_query_str; + $url_if_bandwidth_usage_in .= $selected_agents_query_str.'&'.$selected_interfaces_query_str; + $url_if_bandwidth_usage_out .= $selected_agents_query_str.'&'.$selected_interfaces_query_str; + $last_data .= $selected_agents_query_str.'&'.$selected_interfaces_query_str; + + $url_if_agent_name .= '&recursion='.$recursion; + $url_if_name .= '&recursion='.$recursion; + $url_if_speed .= '&recursion='.$recursion; + $url_if_in_octets .= '&recursion='.$recursion; + $url_if_out_octets .= '&recursion='.$recursion; + $url_if_bandwidth_usage_in .= '&recursion='.$recursion; + $url_if_bandwidth_usage_out .= '&recursion='.$recursion; + $last_data .= '&recursion='.$recursion; + + $url_if_agent_name .= '&sort_field=if_agent_name&sort='; + $url_if_name .= '&sort_field=if_name&sort='; + $url_if_speed .= '&sort_field=if_speed_data&sort='; + $url_if_in_octets .= '&sort_field=if_in_octets&sort='; + $url_if_out_octets .= '&sort_field=if_out_octets&sort='; + $url_if_bandwidth_usage_in .= '&sort_field=if_usage_module_data_in&sort='; + $url_if_bandwidth_usage_out .= '&sort_field=if_usage_module_data_out&sort='; + $last_data .= '&sort_field=if_last_data&sort='; + + if (empty($data) === false) { + $table = new StdClass(); + $table->cellpadding = 0; + $table->cellspacing = 0; + $table->width = '100%'; + $table->class = 'info_table'; + $table->head = []; + $table->data = []; + $table->size = []; + $table->align = []; + + $show_fields = explode(',', $config['status_monitor_fields']); + + if ($sec === 'view') { + $table->head[0] = __('Agent'); + $table->head[0] .= ui_get_sorting_arrows( + $url_if_agent_name.'up', + $url_if_agent_name.'down', + $select_if_agent_name_up, + $select_if_agent_name_down + ); + } + + $table->head[1] = __('IfName'); + $table->head[1] .= ui_get_sorting_arrows( + $url_if_name.'up', + $url_if_name.'down', + $select_if_name_up, + $select_if_name_down + ); + + $table->head[2] = __('Status'); + + $table->head[3] = __('IfSpeed'); + $table->head[3] .= ui_get_sorting_arrows( + $url_if_speed.'up', + $url_if_speed.'down', + $select_if_speed_data_up, + $select_if_speed_data_down + ); + + $table->head[4] = __('IfInOctets'); + $table->head[4] .= ui_get_sorting_arrows( + $url_if_in_octets.'up', + $url_if_in_octets.'down', + $select_if_in_octets_up, + $select_if_in_octets_down + ); + + $table->head[5] = __('IfOutOctets'); + $table->head[5] .= ui_get_sorting_arrows( + $url_if_out_octets.'up', + $url_if_out_octets.'down', + $select_if_out_octets_up, + $select_if_out_octets_down + ); + + $table->head[6] = __('% Bandwidth usage (in)'); + $table->head[6] .= ui_get_sorting_arrows( + $url_if_bandwidth_usage_in.'up', + $url_if_bandwidth_usage_in.'down', + $select_if_usage_module_data_in_up, + $select_if_usage_module_data_in_down + ); + + $table->head[7] = __('% Bandwidth usage (out)'); + $table->head[7] .= ui_get_sorting_arrows( + $url_if_bandwidth_usage_out.'up', + $url_if_bandwidth_usage_out.'down', + $select_if_usage_module_data_out_up, + $select_if_usage_module_data_out_down + ); + + $table->head[8] = __('Last data'); + $table->head[8] .= ui_get_sorting_arrows( + $last_data.'up', + $last_data.'down', + $select_if_last_data_up, + $select_if_last_data_down + ); + + $loop_index = 0; + $table_data = []; + + $interfaces_array = array_column($data, 'interfaces'); + $agents = array_column($data, 'name'); + + $all_interfaces = []; + + foreach ($data as $value) { + $agent_alias = agents_get_alias($value['name']); + + foreach ($value['interfaces'] as $if_name => $interface) { + $interface['agent_id'] = $value['name']; + $interface['agent_alias'] = $agent_alias; + $interface['if_name'] = $if_name; + $all_interfaces[$if_name] = $interface; + } + } + + if ($sec === 'estado' + && is_array($selected_interfaces) === true + && empty($selected_interfaces) === true + ) { + $filtered_interfaces = $all_interfaces; + } else { + // Filter interfaces array. + $filtered_interfaces = array_filter( + $all_interfaces, + function ($interface) use ($selected_interfaces) { + return in_array( + $interface['status_module_id'], + $selected_interfaces + ) === true; + } + ); + } + + $data = []; + + foreach ($filtered_interfaces as $if_name => $agent_interfaces) { + // Get usage modules. + $usage_module_in = db_get_row( + 'tagente_modulo', + 'nombre', + $if_name.'_inUsage' + ); + $usage_module_out = db_get_row( + 'tagente_modulo', + 'nombre', + $if_name.'_outUsage' + ); + + $usage_module_id_in = $usage_module_in['id_agente_modulo']; + $usage_module_id_out = $usage_module_out['id_agente_modulo']; + $usage_module_description = $usage_module_in['descripcion']; + + // Get usage modules data. + $usage_module_data_in = modules_get_previous_data( + $usage_module_id_in, + time() + ); + + $usage_module_data_out = modules_get_previous_data( + $usage_module_id_out, + time() + ); + + // Extract ifSpeed from description of usage module. + $if_speed_str = strstr($usage_module_description, 'Speed:'); + $if_speed_str = substr($if_speed_str, 0, -1); + $if_speed_str = explode(':', $if_speed_str)[1]; + + $matches = []; + preg_match_all('/\d+/', $if_speed_str, $matches); + + $if_speed_value = $matches[0][0]; + + // Transform ifSpeed unit. + $divisor = 1000; + $counter = 0; + while ($if_speed_value >= $divisor) { + if ($if_speed_value >= $divisor) { + $if_speed_value = ($if_speed_value / $divisor); + } + + $counter++; + } + + $if_speed_unit = 'bps'; + + switch ($counter) { + case 1: + $if_speed_unit = 'Kbps'; + break; + + case 2: + $if_speed_unit = 'Mbps'; + break; + + case 3: + $if_speed_unit = 'Gbps'; + break; + + case 4: + $if_speed_unit = 'Tbps'; + break; + + default: + $if_speed_unit = 'bps'; + break; + } + + // Get in and out traffic. + $ifInOctets = modules_get_previous_data( + $agent_interfaces['traffic']['in'], + time() + ); + $ifOutOctets = modules_get_previous_data( + $agent_interfaces['traffic']['out'], + time() + ); + + // Get last data timestamp. + $timestamps_array = array_merge( + array_column(ifInOctets, 'utimestamp'), + array_column(ifOutOctets, 'utimestamp') + ); + + if ($sec === 'view') { + $table_data[$loop_index]['if_agent_name'] = ''.$agent_interfaces['agent_alias'].''; + } + + $table_data[$loop_index]['if_name'] = $agent_interfaces['if_name']; + $table_data[$loop_index]['if_status_image'] = $agent_interfaces['status_image']; + $table_data[$loop_index]['if_speed_data'] = ($if_speed_value === null) ? __('N/A') : $if_speed_value.' '.$if_speed_unit; + $table_data[$loop_index]['if_in_octets'] = ($ifInOctets['datos'] === null) ? __('N/A') : $ifInOctets['datos']; + $table_data[$loop_index]['if_out_octets'] = ($ifOutOctets['datos'] === null) ? __('N/A') : $ifOutOctets['datos']; + $table_data[$loop_index]['if_usage_module_data_in'] = ($usage_module_data_in['datos'] === null) ? __('N/A') : $usage_module_data_in['datos']; + $table_data[$loop_index]['if_usage_module_data_out'] = ($usage_module_data_out['datos'] === null) ? __('N/A') : $usage_module_data_out['datos']; + $table_data[$loop_index]['if_last_data'] = human_time_comparation( + max( + $ifInOctets['utimestamp'], + $ifOutOctets['utimestamp'] + ) + ); + + $loop_index++; + } + + // Sort array of previously processed table values. + if ($sort === 'up') { + $res = usort( + $table_data, + function ($a, $b) use ($sort_field) { + if ($a[$sort_field] > $b[$sort_field]) { + return 1; + } else { + return -1; + } + } + ); + } + + if ($sort === 'down') { + $res = usort( + $table_data, + function ($a, $b) use ($sort_field) { + if ($b[$sort_field] > $a[$sort_field]) { + return 1; + } else { + return -1; + } + } + ); + } + + $sliced_table_data = array_slice( + $table_data, + $pagination_index, + $config['block_size'] + ); + + foreach ($sliced_table_data as $value) { + array_push($table->data, array_values($value)); + } + + html_print_table($table); + + if (count($selected_interfaces) > $config['block_size']) { + ui_pagination(count($selected_interfaces), false, $pagination_index, 0, false, 'offset', true, 'pagination-bottom'); + } + } else { + ui_print_info_message(['no_close' => true, 'message' => __('No search parameters')]); + } +} diff --git a/pandora_console/operation/agentes/interface_view.php b/pandora_console/operation/agentes/interface_view.php new file mode 100644 index 0000000000..a24788edd0 --- /dev/null +++ b/pandora_console/operation/agentes/interface_view.php @@ -0,0 +1,259 @@ + $agent_id]; + +// Autosearch if search parameters are different from those by default. +if (empty($selected_agents) === false || empty($selected_interfaces) === false + || $sort_field !== '' || $sort !== 'none' || $sec === 'estado' +) { + $autosearch = true; +} + +print_filters($sec); + +$result = false; + +if ($autosearch === true) { + if ($sec === 'estado') { + $result = agents_get_network_interfaces(false, $agent_filter); + } else { + $result = agents_get_network_interfaces($selected_agents); + } + + if ($result === false) { + $result = []; + } else { + ui_pagination( + count($selected_interfaces), + false, + $offset, + 0, + false, + 'offset', + true + ); + } +} + +print_table( + $result, + $selected_agents, + $selected_interfaces, + $sort_field, + $sort, + $offset, + $sec +); + +?> + diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 01a21bf19d..b220362a37 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -1231,7 +1231,30 @@ if ($tab == 'main') { $maintab['active'] = false; } +// Interfaces tab. +$agent_interfaces = agents_get_network_interfaces( + false, + ['id_agente' => $id_agente] +); +$agent_interfaces_count = count($agent_interfaces[$id_agente]['interfaces']); + +if ($agent_interfaces_count > 0) { + $interfacetab['text'] = ''.html_print_image( + 'images/link.png', + true, + [ + 'title' => __('Interfaces'), + 'class' => 'invert_filter', + ] + ).''; + + if ($tab == 'interface') { + $interfacetab['active'] = true; + } else { + $interfacetab['active'] = false; + } +} // Alert tab. $alerttab['text'] = ''.html_print_image( @@ -1512,6 +1535,7 @@ $onheader = [ 'manage' => $managetab, 'main' => $maintab, 'alert' => $alerttab, + 'interface' => $interfacetab, 'inventory' => $inventorytab, 'collection' => $collectiontab, 'gis' => $gistab, @@ -1630,6 +1654,10 @@ switch ($tab) { $tab_name = ''; break; + case 'interface': + $tab_name = 'Interfaces'; + break; + case 'alert': $tab_name = 'Alerts'; break; @@ -1760,6 +1788,10 @@ switch ($tab) { include 'datos_agente.php'; break; + case 'interface': + include 'interface_view.php'; + break; + case 'alert': include 'alerts_status.php'; break; diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index d43829b753..9013cd7c32 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -58,6 +58,9 @@ if (check_acl($config['id_user'], 0, 'AR')) { $sub2['operation/agentes/status_monitor']['text'] = __('Monitor detail'); $sub2['operation/agentes/status_monitor']['refr'] = 0; + $sub2['operation/agentes/interface_view']['text'] = __('Interface view'); + $sub2['operation/agentes/interface_view']['refr'] = 0; + enterprise_hook('tag_view_submenu'); $sub2['operation/agentes/alerts_status']['text'] = __('Alert detail'); From bdbfe81f3155926f81c5acd295f4837113f13928 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 13 Apr 2021 12:24:35 +0200 Subject: [PATCH 09/50] Fixed id_agente_modulo in sql condiction --- pandora_console/operation/agentes/status_monitor.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index ee20c2d8c1..a6811c1856 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -244,6 +244,10 @@ if ($ag_modulename != '') { $sql_conditions .= " AND tagente_modulo.nombre LIKE '%".$ag_modulename."%'"; } +if ($id_module) { + $sql_conditions .= sprintf(' AND tagente_modulo.id_agente_modulo = \'%d\'', $id_module); +} + if ($module_option !== 0) { if ($module_option == 1) { // Only enabled From fa7ca4d77bf518a4816c90d5a09c2336185260e7 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 13 Apr 2021 12:52:11 +0200 Subject: [PATCH 10/50] Added function for use templates in emails --- .../include/functions_reporting.php | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 947218a7a9..e82bac98ce 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -42,6 +42,7 @@ require_once $config['homedir'].'/include/functions_users.php'; enterprise_include_once('include/functions_reporting.php'); enterprise_include_once('include/functions_metaconsole.php'); enterprise_include_once('include/functions_inventory.php'); +enterprise_include_once('include/functions_cron.php'); require_once $config['homedir'].'/include/functions_forecast.php'; require_once $config['homedir'].'/include/functions_ui.php'; require_once $config['homedir'].'/include/functions_netflow.php'; @@ -13948,3 +13949,69 @@ function reporting_module_histogram_graph($report, $content, $pdf=0) return reporting_check_structure_content($return); } + + +/** + * Email template for sending reports. + * + * @param string $subjectEmail Subject of email. + * @param string $bodyEmail Body of email. + * @param string $scheduled Id of schedule report. + * @param string $reportName Report name. + * @param string $email Serialized list of destination emails. + * @param array $attachments Attachments. + * + * @return void + */ +function reporting_email_template( + string $subjectEmail='', + string $bodyEmail='', + string $scheduled='', + string $reportName='', + string $email='', + array $attachments=null +) { + // Subject. + $subject = (empty($subjectEmail) === true) ? '[Pandora] '.__('Reports') : $subjectEmail; + // Body. + if (empty($bodyEmail) === true) { + $body = __('Greetings').','; + $body .= '

'; + $body .= __('Attached to this email there\'s a PDF file of the').' '; + $body .= $scheduled.' '.__('report'); + $body .= ' "'.$reportName.'"'; + $body .= '

'; + $body .= __('Generated at').' '.date('Y/m/d H:i:s'); + $body .= '

'; + $body .= __('Thanks for your time.'); + $body .= '

'; + $body .= __('Best regards, Pandora FMS'); + $body .= '

'; + $body .= ''.__('This is an automatically generated email from Pandora FMS, please do not reply.').''; + } else { + $bodyEmail = str_replace( + [ + "\r\n", + "\r", + ' ', + ], + "\n", + $bodyEmail + ); + + $body = '

'.implode("

\n

", explode("\n", $bodyEmail)).'

'; + } + + // Extract list of emails. + $destinationEmails = explode(',', io_safe_output($email)); + foreach ($destinationEmails as $destination) { + $destination = trim($destination); + + // Skip the empty 'to'. + if (empty($destination) === false) { + send_email_attachment($destination, $body, $subject, $attachments); + } else { + db_pandora_audit('ERROR:', 'Cron jobs mail, empty destination email.'); + } + } +} From 256d4333c6ed99838c6bd7f99ef451562fc895a4 Mon Sep 17 00:00:00 2001 From: Calvo Date: Fri, 16 Apr 2021 15:36:12 +0200 Subject: [PATCH 11/50] Fixed encoding ampersand on mail alerts --- pandora_server/lib/PandoraFMS/Core.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 40cd75f4d9..19aaeb8228 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1322,6 +1322,9 @@ sub pandora_execute_action ($$$$$$$$$;$) { my $cid_data = "CID_IMAGE"; my $dataname = "CID_IMAGE.png"; + # Decode ampersand. Used for macros with encoded names. + $field3 =~ s/&/&/g; + if (defined($data) && $data =~ /^data:image\/png;base64, /) { # macro _data_ substitution in case is image. $attach_data_as_image = 1; From a05c5cf55514bf0f566651b622c2c93b7708d3e0 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 20 Apr 2021 11:46:33 +0200 Subject: [PATCH 12/50] #6618 Added random name css --- pandora_console/include/styles/pandora.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 740e5c6053..850842cb1e 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -8500,3 +8500,8 @@ div.stat-win-spinner img { .font_11pt { font-size: 11pt; } + +.checkbox-random-name { + width: 100px !important; + margin-left: 20px; +} From 998ad91b69d79fb991b9ad692687c9c17d277ad2 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 21 Apr 2021 11:07:20 +0200 Subject: [PATCH 13/50] Fixed errors diagnostic --- pandora_console/include/class/Diagnostics.class.php | 8 ++++++-- pandora_console/include/styles/diagnostics.css | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index d1bb2c3572..6a6b888b08 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -286,7 +286,11 @@ class Diagnostics extends Wizard $return .= ''; } - return false; + if ($this->pdf === true) { + return $return; + } else { + return false; + } } @@ -1599,7 +1603,7 @@ class Diagnostics extends Wizard } } - return true; + return $result; } diff --git a/pandora_console/include/styles/diagnostics.css b/pandora_console/include/styles/diagnostics.css index 17109ed57f..6591adabff 100644 --- a/pandora_console/include/styles/diagnostics.css +++ b/pandora_console/include/styles/diagnostics.css @@ -19,6 +19,7 @@ .dataTables_wrapper { min-height: 150px; + margin-bottom: 20px; } .datatables-td-title { From 1f5e08a9feb9facb658f9bf59bb61dbe52b23e24 Mon Sep 17 00:00:00 2001 From: marcos Date: Wed, 5 May 2021 09:23:47 +0200 Subject: [PATCH 14/50] fixed wrong string --- pandora_console/operation/agentes/pandora_networkmap.editor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/pandora_networkmap.editor.php b/pandora_console/operation/agentes/pandora_networkmap.editor.php index 4937b3d38f..8f735e72de 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.editor.php +++ b/pandora_console/operation/agentes/pandora_networkmap.editor.php @@ -390,7 +390,7 @@ if ($not_found) { 'circo' => 'circular', 'neato' => 'spring1', 'fdp' => 'spring2', - 'radial_dinamic' => 'radial dinamic', + 'radial_dinamic' => 'radial dynamic', ]; $table->data[7][0] = __('Method generation networkmap'); From 25867a0fd7ace97404106e29432e444aa4342b96 Mon Sep 17 00:00:00 2001 From: marcos Date: Wed, 5 May 2021 09:36:16 +0200 Subject: [PATCH 15/50] fixed visual error black theme --- pandora_console/include/styles/pandora_black.css | 1 - 1 file changed, 1 deletion(-) diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index 49d669fd0d..7b4b74c6ba 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -387,7 +387,6 @@ table#diagnostic_info tbody td div { color: #fff; } -.ui-widget-content.ui-autocomplete, .ui-widget-content.ui-autocomplete a { color: #333; } From 256750bcb00395425394f2d61280eea302c5dae9 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 5 May 2021 09:51:21 +0200 Subject: [PATCH 16/50] fixed bug in file attachment --- .../incidents/dashboard_detail_integriaims_incident.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php b/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php index c4d7cb8617..d534df5902 100644 --- a/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php +++ b/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php @@ -159,7 +159,9 @@ if ($upload_file && ($_FILES['userfile']['name'] != '')) { $filecontent = base64_encode(file_get_contents($_FILES['userfile']['tmp_name'])); - $result_api_call = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'attach_file', [$incident_id, $filename, $filesize, $filedescription, $filecontent], false, '', ';'); + $filename = str_replace(' ', '+', $filename); + + $result_api_call = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'attach_file', [$incident_id, $filename, $filesize, $filedescription, $filecontent], false, '', '|;|'); // API method returns '0' string if success. $file_added = ($result_api_call === '0') ? true : false; @@ -485,4 +487,4 @@ $(document).ready (function () { }); }); - \ No newline at end of file + From d358fd894d24eec265dcaa69621975c484dca859 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 5 May 2021 11:03:32 +0200 Subject: [PATCH 17/50] minor change in integria ims setup --- pandora_console/godmode/setup/setup_integria.php | 2 +- pandora_console/include/functions_integriaims.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/setup/setup_integria.php b/pandora_console/godmode/setup/setup_integria.php index 9e63fb3639..2488647ecd 100644 --- a/pandora_console/godmode/setup/setup_integria.php +++ b/pandora_console/godmode/setup/setup_integria.php @@ -282,7 +282,7 @@ $table_remote->data['integria_pass'] = $row; // Integria hostname. $row = []; -$row['name'] = __('API Hostname'); +$row['name'] = __('URL to Integria IMS setup').ui_print_help_tip(__('Full URL to your Integria IMS setup (e.g., http://192.168.1.20/integria, https://support.mycompany.com).'), true); $row['control'] = html_print_input_text('integria_hostname', $config['integria_hostname'], '', 30, 100, true); $table_remote->data['integria_hostname'] = $row; diff --git a/pandora_console/include/functions_integriaims.php b/pandora_console/include/functions_integriaims.php index 436e189a9d..c117b679e5 100644 --- a/pandora_console/include/functions_integriaims.php +++ b/pandora_console/include/functions_integriaims.php @@ -188,7 +188,7 @@ function integria_api_call($api_hostname, $user, $user_pass, $api_pass, $operati } // Build URL for API request. - $url = $api_hostname.'/integria/include/api.php'; + $url = $api_hostname.'/include/api.php'; // ob_start(); // $out = fopen('php://output', 'w'); From aa4769d331cbf0e5d034f713be6379154e6f70f9 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 5 May 2021 13:02:53 +0200 Subject: [PATCH 18/50] minor changes --- .../godmode/setup/setup_integria.php | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/pandora_console/godmode/setup/setup_integria.php b/pandora_console/godmode/setup/setup_integria.php index 9e63fb3639..f68c7f3e76 100644 --- a/pandora_console/godmode/setup/setup_integria.php +++ b/pandora_console/godmode/setup/setup_integria.php @@ -329,22 +329,20 @@ $row['control'] = html_print_input_text( true, false, false -).ui_print_help_icon('alert_macros', true); +); $table_alert_settings->data['custom_response_incident_title'] = $row; // Alert incident description. $row = []; -$row['name'] = __('Description'); -$row['control'] = html_print_input_text( +$row['name'] = __('Ticket body'); +$row['control'] = html_print_textarea( 'incident_content', + 7, + 25, $config['incident_content'], '', - 50, - 100, - true, - false, - false -).ui_print_help_icon('alert_macros', true); + true +); $table_alert_settings->data['custom_response_incident_content'] = $row; // Alert default group. @@ -452,22 +450,21 @@ $row['control'] = html_print_input_text( true, false, false -).ui_print_help_icon('response_macros', true); +); $table_cr_settings->data['custom_response_incident_title'] = $row; // Custom response incident description. $row = []; -$row['name'] = __('Description'); -$row['control'] = html_print_input_text( +$row['name'] = __('Ticket body'); +$row['control'] = html_print_textarea( 'cr_incident_content', + 7, + 25, $config['cr_incident_content'], '', - 50, - 100, - true, - false, - false -).ui_print_help_icon('response_macros', true); + true +); + $table_cr_settings->data['custom_response_incident_content'] = $row; // Custom response default group. @@ -599,7 +596,7 @@ if ($has_connection != false) { // Form alert default settings. echo '
'; echo '
'; - echo ''.__('Alert default values').''; + echo ''.__('Alert default values').' '.ui_print_help_icon('alert_macros', true).''; html_print_table($table_alert_settings); @@ -609,7 +606,7 @@ if ($has_connection != false) { // Form custom response default settings. echo '
'; echo '
'; - echo ''.__('Event custom response default values').''; + echo ''.__('Event custom response default values').' '.ui_print_help_icon('alert_macros', true).''; html_print_table($table_cr_settings); From f4e0e9f799ba3c46294eff96d64aea1399f565e8 Mon Sep 17 00:00:00 2001 From: Kike Date: Fri, 7 May 2021 14:04:29 +0200 Subject: [PATCH 19/50] Issue with custom agent installation --- pandora_agents/unix/pandora_agent_installer | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 344dc88a15..6a3232d63c 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -152,8 +152,8 @@ uninstall () { fi # Stops the agent on uninstall - if [ -f $PANDORA_BASE/etc/init.d/pandora_agent_daemon ]; then - $PANDORA_BASE/etc/init.d/pandora_agent_daemon stop 12> /dev/null + if [ -f /etc/init.d/pandora_agent_daemon ]; then + /etc/init.d/pandora_agent_daemon stop 12> /dev/null else echo "$PANDORA_BASE/etc/init.d/pandora_agent_daemon not found to stop agent" fi From fdeaf529121afe60000dc21e62ef5336da127204 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Fri, 7 May 2021 14:29:29 +0200 Subject: [PATCH 20/50] implemented user level authentication for integria ims integration --- pandora_console/extras/mr/47.sql | 6 + .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 + .../godmode/agentes/agent_incidents.php | 2 +- .../godmode/alerts/configure_alert_action.php | 2 +- .../godmode/setup/setup_integria.php | 49 +++++-- .../include/ajax/integria_incidents.ajax.php | 2 +- pandora_console/include/functions_config.php | 8 ++ pandora_console/include/functions_graph.php | 14 +- .../include/functions_integriaims.php | 47 ++++++- pandora_console/include/styles/pandora.css | 3 +- .../configure_integriaims_incident.php | 18 +-- .../dashboard_detail_integriaims_incident.php | 22 ++-- .../incidents/list_integriaims_incidents.php | 10 +- pandora_console/operation/users/user_edit.php | 123 +++++++++++++++++- pandora_console/pandoradb.sql | 2 + 15 files changed, 257 insertions(+), 53 deletions(-) create mode 100644 pandora_console/extras/mr/47.sql diff --git a/pandora_console/extras/mr/47.sql b/pandora_console/extras/mr/47.sql new file mode 100644 index 0000000000..99597d995f --- /dev/null +++ b/pandora_console/extras/mr/47.sql @@ -0,0 +1,6 @@ +START TRANSACTION; + +ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_user` VARCHAR(60); +ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_pass` VARCHAR(45); + +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 fce9be7024..b8242b07e8 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 @@ -1527,6 +1527,8 @@ ALTER TABLE `tusuario` MODIFY COLUMN `default_event_filter` int(10) unsigned NOT ADD CONSTRAINT `fk_filter_id` FOREIGN KEY `fk_filter_id` (`id_filter`) REFERENCES `tevent_filter` (`id_filter`) ON DELETE SET NULL ON UPDATE RESTRICT, DROP FOREIGN KEY `fk_id_filter`, DROP INDEX `fk_id_filter`; +ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_user` VARCHAR(60); +ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_pass` VARCHAR(45); -- --------------------------------------------------------------------- diff --git a/pandora_console/godmode/agentes/agent_incidents.php b/pandora_console/godmode/agentes/agent_incidents.php index 16cdd9370c..c92dca6fab 100644 --- a/pandora_console/godmode/agentes/agent_incidents.php +++ b/pandora_console/godmode/agentes/agent_incidents.php @@ -55,7 +55,7 @@ $params = [ agents_get_name($id_agent), ]; -$result = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_incidents', $params, false, 'json', ','); +$result = integria_api_call(null, null, null, null, 'get_incidents', $params, false, 'json', ','); $result = json_decode($result, true); diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index 459b12d1ac..e6e7dcfbad 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -43,7 +43,7 @@ if (is_ajax()) { if ($get_integria_ticket_custom_types) { $ticket_type_id = get_parameter('ticket_type_id'); - $api_call = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_incident_fields', $ticket_type_id, false, 'json'); + $api_call = integria_api_call(null, null, null, null, 'get_incident_fields', $ticket_type_id, false, 'json'); echo $api_call; return; diff --git a/pandora_console/godmode/setup/setup_integria.php b/pandora_console/godmode/setup/setup_integria.php index 9e63fb3639..7d87e6f5c3 100644 --- a/pandora_console/godmode/setup/setup_integria.php +++ b/pandora_console/godmode/setup/setup_integria.php @@ -41,8 +41,10 @@ if (is_ajax()) { $integria_pass = get_parameter('integria_pass', ''); $integria_api_hostname = get_parameter('api_hostname', ''); $integria_api_pass = get_parameter('api_pass', ''); + $user_level_conf = get_parameter('user_level_conf', 0); + $user_level_conf_bool = $user_level_conf === 'true' ? true : false; - $login_result = integria_api_call($integria_api_hostname, $integria_user, $integria_pass, $integria_api_pass, 'get_login', []); + $login_result = integria_api_call($integria_api_hostname, $integria_user, $integria_pass, $integria_api_pass, 'get_login', [], false, '', '', $user_level_conf_bool); if ($login_result != false) { echo json_encode(['login' => 1]); @@ -53,7 +55,7 @@ if (is_ajax()) { return; } -$has_connection = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_login', []); +$has_connection = integria_api_call(null, null, null, null, 'get_login', []); if ($has_connection === false && $config['integria_enabled']) { ui_print_error_message(__('Integria IMS API is not reachable')); @@ -86,7 +88,7 @@ if (get_parameter('update_config', 0) == 1) { ); } - $ticket_types = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_types', '', false, 'json'); + $ticket_types = integria_api_call(null, null, null, null, 'get_types', '', false, 'json'); $types_string = ''; @@ -216,19 +218,19 @@ $integria_users_values = []; $integria_types_values = []; $integria_status_values = []; -$integria_groups_csv = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_groups', []); +$integria_groups_csv = integria_api_call(null, null, null, null, 'get_groups', []); get_array_from_csv_data_pair($integria_groups_csv, $integria_group_values); -$integria_status_csv = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_incidents_status', []); +$integria_status_csv = integria_api_call(null, null, null, null, 'get_incidents_status', []); get_array_from_csv_data_pair($integria_status_csv, $integria_status_values); -$integria_criticity_levels_csv = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_incident_priorities', []); +$integria_criticity_levels_csv = integria_api_call(null, null, null, null, 'get_incident_priorities', []); get_array_from_csv_data_pair($integria_criticity_levels_csv, $integria_criticity_values); -$integria_users_csv = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_users', []); +$integria_users_csv = integria_api_call(null, null, null, null, 'get_users', []); $csv_array = explode("\n", $integria_users_csv); @@ -238,7 +240,7 @@ foreach ($csv_array as $csv_line) { } } -$integria_types_csv = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_types', []); +$integria_types_csv = integria_api_call(null, null, null, null, 'get_types', []); get_array_from_csv_data_pair($integria_types_csv, $integria_types_values); @@ -267,6 +269,12 @@ $table_remote->class = 'databox filters'; $table_remote->size['name'] = '30%'; $table_remote->style['name'] = 'font-weight: bold'; +// Enable eHorus user configuration. +$row = []; +$row['name'] = ('Integria configuration at user level'); +$row['control'] = html_print_checkbox_switch('integria_user_level_conf', 1, $config['integria_user_level_conf'], true); +$table_remote->data['integria_user_level_conf'] = $row; + // Integria user. $row = []; $row['name'] = __('User'); @@ -632,6 +640,29 @@ echo ''; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index be106eef9d..b06ee1709a 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1267,6 +1267,8 @@ CREATE TABLE IF NOT EXISTS `tusuario` ( `ehorus_user_level_user` VARCHAR(60), `ehorus_user_level_pass` VARCHAR(45), `ehorus_user_level_enabled` TINYINT(1), + `integria_user_level_user` VARCHAR(60), + `integria_user_level_pass` VARCHAR(45), CONSTRAINT `fk_filter_id` FOREIGN KEY (`id_filter`) REFERENCES tevent_filter (`id_filter`) ON DELETE SET NULL, UNIQUE KEY `id_user` (`id_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 6939ec4d44ecac60bdc11681546c64baa68e99b1 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 10 May 2021 17:58:17 +0200 Subject: [PATCH 21/50] Unify the format of product version messages. --- extras/pandora_update_version.sh | 6 +++--- pandora_agents/unix/pandora_agent | 3 ++- pandora_agents/win32/main.cc | 4 ++-- pandora_agents/win32/pandora.cc | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/util/pandora_db.pl | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/extras/pandora_update_version.sh b/extras/pandora_update_version.sh index 23ea7a4627..71d29feb10 100755 --- a/extras/pandora_update_version.sh +++ b/extras/pandora_update_version.sh @@ -160,9 +160,9 @@ echo "Updating Pandora Server version..." sed -i -e "s/my\s\s*\$pandora_version\s*=.*/my \$pandora_version = \"$VERSION\";/" "$SERVER_FILE" sed -i -e "s/my\s\s*\$pandora_build\s*=.*/my \$pandora_build = \"$BUILD\";/" "$SERVER_FILE" echo "Updating DB maintenance script version..." -sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION PS$BUILD\";/" "$SERVER_DB_FILE" +sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION Build $BUILD\";/" "$SERVER_DB_FILE" echo "Updating CLI script version..." -sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION PS$BUILD\";/" "$SERVER_CLI_FILE" +sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION Build $BUILD\";/" "$SERVER_CLI_FILE" sed -i -e "s/\s*\#\s*\Version.*/\# Version $VERSION/" "$SERVER_CONF_FILE" sed -i -e "s/\s*\!define PRODUCT_VERSION.*/\!define PRODUCT_VERSION \"$VERSION\"/" "$SERVER_WIN_MPI_OPEN_FILE" sed -i -e "s/\s*\!define PRODUCT_VERSION.*/\!define PRODUCT_VERSION \"$VERSION\"/" "$SERVER_WIN_MPI_ENT_FILE" @@ -197,7 +197,7 @@ echo "Updating Pandora Unix Agent version..." sed -i -e "s/\s*use\s*constant\s*AGENT_VERSION =>.*/use constant AGENT_VERSION => '$VERSION';/" "$AGENT_UNIX_FILE" sed -i -e "s/\s*use\s*constant\s*AGENT_BUILD =>.*/use constant AGENT_BUILD => '$BUILD';/" "$AGENT_UNIX_FILE" echo "Updating Pandora Windows Agent version..." -sed -i -e "s/\s*#define\s*PANDORA_VERSION\s*.*/#define PANDORA_VERSION (\"$VERSION(Build $BUILD)\")/" "$AGENT_WIN_FILE" +sed -i -e "s/\s*#define\s*PANDORA_VERSION\s*.*/#define PANDORA_VERSION (\"$VERSION Build $BUILD\")/" "$AGENT_WIN_FILE" sed -i -e "s/{Pandora FMS Windows Agent v.*}/{Pandora FMS Windows Agent v$VERSION}/" "$AGENT_WIN_MPI_FILE" NUMERIC_VERSION=$(echo $VERSION | sed -e "s/\([0-9]*\.[0-9]*\).*/\1/") sed -i -n "1h;1!H;\${;g;s/[\r\n]InstallVersion[\r\n]{\S*}/\nInstallVersion\n{$NUMERIC_VERSION.0.0}/g;p;}" "$AGENT_WIN_MPI_FILE" diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 2702989549..3652392791 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1229,7 +1229,8 @@ use constant MAX_LOOP_COUNTER => 1000000000; # Print usage information and exit. ################################################################################ sub print_usage () { - print "\nUsage: $0 \n\n"; + print "Pandora FMS Agent for Linux v" . AGENT_VERSION . " Build " . AGENT_BUILD . "\n\n"; + print "Usage: $0 \n\n"; print "\tPandora home is the directory where pandora_agent.conf is located,\n"; print "\tby default /etc/pandora.\n\n"; exit 1; diff --git a/pandora_agents/win32/main.cc b/pandora_agents/win32/main.cc index 70f35e66e9..802a4e3a65 100644 --- a/pandora_agents/win32/main.cc +++ b/pandora_agents/win32/main.cc @@ -115,8 +115,8 @@ main (int argc, char *argv[]) { return 0; } else if (_stricmp(argv[i], HELP_CMDLINE_PARAM) == 0) { /* Help parameter */ - cout << "Pandora agent for Windows. "; - cout << "Version " << getPandoraAgentVersion () << endl; + cout << "Pandora agent for Windows "; + cout << "v" << getPandoraAgentVersion () << endl << endl; cout << "Usage: " << argv[0] << " [OPTION]" << endl << endl; cout << "Available options are:" << endl; cout << "\t" << SERVICE_INSTALL_CMDLINE_PARAM; diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 467d3d6a04..c4e4166b6a 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.754(Build 210510)") +#define PANDORA_VERSION ("7.0NG.754 Build 210510") string pandora_path; string pandora_dir; diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 30e7c59d5c..6a76d73323 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -77,7 +77,7 @@ sub help_screen { sub pandora_init { my $pa_config = $_[0]; my $init_string = $_[1]; - print "\n$init_string $pandora_version Build $pandora_build Copyright (c) 2004-20".substr($pandora_build,0,2)." " . pandora_get_initial_copyright_notice() . "\n"; + print "$init_string v$pandora_version Build $pandora_build\n\n"; print "This program is OpenSource, licensed under the terms of GPL License version 2.\n"; print "You can download latest versions and documentation at official web page.\n\n"; diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index a1e0360b4f..42fc0c1695 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.754 PS210510"; +my $version = "7.0NG.754 Build 210510"; # Pandora server configuration my %conf; @@ -548,7 +548,7 @@ sub pandora_compactdb ($$$) { sub pandora_init_pdb ($) { my $conf = shift; - log_message ('', "\nDB Tool $version Copyright (c) 2004-2018 " . pandora_get_initial_copyright_notice() . "\n"); + log_message ('', "Pandora FMS DB Tool v$version\n\n"); log_message ('', "This program is Free Software, licensed under the terms of GPL License v2\n"); log_message ('', "You can download latest versions and documentation at official web\n\n"); From 9c234eef8542febb8165a49bde2327b773be5b8b Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 11 May 2021 13:48:09 +0000 Subject: [PATCH 22/50] Ent 7087 mensaje duplicado en los test mails --- pandora_console/godmode/setup/setup_general.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 50733b2727..f611b14b7f 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -641,8 +641,8 @@ echo ''.__('Mail configuration').''; $table_mail_test->width = '100%'; $table_mail_test->class = 'databox filters'; $table_mail_test->data = []; - $table_mail_test->style[0] = 'font-weight: bold'; - $table_mail_test->colspan[1][0] = 2; + $table_mail_test->style[0] = 'font-weight: bold;'; + $table_mail_test->style[1] = 'font-weight: bold;display: flex;height: 54px;align-items: center;'; $table_mail_test->data[0][0] = __('Address'); $table_mail_test->data[0][1] = html_print_input_text( @@ -661,7 +661,9 @@ echo ''.__('Mail configuration').''; '', 'class="sub next"', true - ).'  Email could not be sent'; + ); + + $table_mail_test->data[1][1] = '  Email could not be sent'; echo ''; } @@ -703,6 +705,9 @@ function show_email_test(id) { } function perform_email_test () { + $('#email_test_sent_message').hide(); + $('#email_test_failure_message').hide(); + var test_address = $('#text-email_test_address').val(); $.ajax({ @@ -713,12 +718,15 @@ function perform_email_test () { success: function(data) { if (parseInt(data) === 1) { $('#email_test_sent_message').show(); + $('#email_test_failure_message').hide(); } else { $('#email_test_failure_message').show(); + $('#email_test_sent_message').hide(); } }, error: function() { $('#email_test_failure_message').show(); + $('#email_test_sent_message').hide(); }, }); } From b9398604f6304993aacc9e2cea311eb7433f0977 Mon Sep 17 00:00:00 2001 From: Luis Date: Tue, 11 May 2021 13:49:40 +0000 Subject: [PATCH 23/50] Fixed visual bug on event modal event responses --- pandora_console/include/functions_events.php | 2 +- pandora_console/include/javascript/pandora_events.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index e36e2f16e3..eee8fc093d 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -3792,7 +3792,7 @@ function events_page_responses($event, $childrens_ids=[]) $('.params_rows').remove(); $('#responses_table') - .append('".__('Description')."'+description+''); + .append('".__('Description')."'+description+''); if (params.length == 1 && params[0] == '') { return; diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index 0304fcc080..b5d684324c 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -48,6 +48,8 @@ function show_event_dialog(event, dialog_page, result) { resizable: true, draggable: true, modal: true, + minWidth: 710, + minHeight: 600, close: function() { $("#refrcounter").countdown("resume"); $("div.vc-countdown").countdown("resume"); From 47c73518bd740928ed6b2c71027972d1ffeff004 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 11 May 2021 16:13:52 +0200 Subject: [PATCH 24/50] Add a comment regarding snmp_logfile. There's an entry for pandora_snmptrap.log in /etc/logrotate.d/pandora_server which should be updated if snmp_logfile is changed in pandora_server.conf. Ref. pandora_enterprise#7027. --- pandora_server/conf/pandora_server.conf.new | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 2b80300950..95128e3602 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -25,6 +25,7 @@ incomingdir /var/spool/pandora/data_in log_file /var/log/pandora/pandora_server.log # Log file for Pandora FMS SNMP console. Its generated by NetSNMP Trap daemon +# If you change it, please update the file /etc/logrotate.d/pandora_server accordingly. snmp_logfile /var/log/pandora/pandora_snmptrap.log From 671c1ca0a3dc1ef434f2966fe196c5ba35b714dd Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 12 May 2021 01:00:48 +0200 Subject: [PATCH 25/50] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 76acd4b169..d5bc31c3d5 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.754-210511 +Version: 7.0NG.754-210512 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 ba8ff1c9f9..5bceedb77b 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.754-210511" +pandora_version="7.0NG.754-210512" 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 b904a3bc42..05141afe28 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.754'; -use constant AGENT_BUILD => '210511'; +use constant AGENT_BUILD => '210512'; # 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 8984992513..02fcf95fba 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.754 -%define release 210511 +%define release 210512 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 2124636e4f..faad25be9b 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.754 -%define release 210511 +%define release 210512 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 a7c46ced17..7d404141ea 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210511" +PI_BUILD="210512" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 39f0e0ea99..4f4323ebc9 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210511} +{210512} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 5df547c181..e7a797dba6 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.754(Build 210511)") +#define PANDORA_VERSION ("7.0NG.754(Build 210512)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 84320d0433..e87c3b25a4 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.754(Build 210511))" + VALUE "ProductVersion", "(7.0NG.754(Build 210512))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index ca82b95067..e8e4aadb78 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.754-210511 +Version: 7.0NG.754-210512 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 6d9f92c008..bf5d4464a2 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.754-210511" +pandora_version="7.0NG.754-210512" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1cd5f34cd9..827c80179e 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 = 'PC210511'; +$build_version = 'PC210512'; $pandora_version = 'v7.0NG.754'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index cbd529980a..35d1b47938 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 35726363dd..d19af75b60 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.754 -%define release 210511 +%define release 210512 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 8fc4aece9f..ec3596edb0 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.754 -%define release 210511 +%define release 210512 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index be07ace396..a5890a25d9 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210511" +PI_BUILD="210512" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index a601c8a258..ae17729999 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.754 PS210511"; +my $version = "7.0NG.754 PS210512"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 78815064ac..fa47a00410 100755 --- 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.754 PS210511"; +my $version = "7.0NG.754 PS210512"; # save program name for logging my $progname = basename($0); From 90573feb1b158fefe5143cb74cade1689525f769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Gonz=C3=A1lez?= Date: Wed, 12 May 2021 09:35:35 +0200 Subject: [PATCH 26/50] Issue with Perl5 paths --- pandora_server/lib/PandoraFMS/WebServer.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/WebServer.pm b/pandora_server/lib/PandoraFMS/WebServer.pm index 69ae4dbf93..b900c21fb9 100644 --- a/pandora_server/lib/PandoraFMS/WebServer.pm +++ b/pandora_server/lib/PandoraFMS/WebServer.pm @@ -80,8 +80,8 @@ sub run ($) { # Use Goliat with CURL if ($pa_config->{'web_engine'} eq 'curl') { - require Goliat::GoliatCURL; - Goliat::GoliatCURL->import; + require PandoraFMS::Goliat::GoliatCURL; + PandoraFMS::Goliat::GoliatCURL->import; # Check for CURL binary if (system ("curl -V >$DEVNULL 2>&1") >> 8 != 0) { @@ -98,8 +98,8 @@ sub run ($) { } # Use LWP by default else { - require Goliat::GoliatLWP; - Goliat::GoliatLWP->import; + require PandoraFMS::Goliat::GoliatLWP; + PandoraFMS::Goliat::GoliatLWP->import; if (! LWP::UserAgent->can('ssl_opts')) { logger($pa_config, "LWP version $LWP::VERSION does not support SSL. Make sure version 6.0 or higher is installed.", 1); From b0b50654db8c9596ab5d266a3261203db1a9d0bf Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 12 May 2021 13:29:59 +0200 Subject: [PATCH 27/50] Revert "Specify -C option to Launch tentacle_server when using SSL proxy mode." This reverts commit ed53b3c67bd57eb3ac4c78c344458bda58158882. -C is not a valid option for tentacle_server. --- pandora_agents/win32/pandora_windows_service.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pandora_agents/win32/pandora_windows_service.cc b/pandora_agents/win32/pandora_windows_service.cc index 70ce28b1f1..900694183c 100644 --- a/pandora_agents/win32/pandora_windows_service.cc +++ b/pandora_agents/win32/pandora_windows_service.cc @@ -423,7 +423,7 @@ Pandora_Windows_Service::killTentacleProxy() { int Pandora_Windows_Service::launchTentacleProxy() { - string server_ip, server_port, proxy_max_connections, proxy_timeout, server_ssl; + string server_ip, server_port, proxy_max_connections, proxy_timeout; string proxy_cmd, proxy_address, proxy_port; PROCESS_INFORMATION pi; STARTUPINFO si; @@ -451,15 +451,6 @@ Pandora_Windows_Service::launchTentacleProxy() { server_port = "41121"; } - server_ssl = conf->getValue("server_ssl"); - - if (server_ssl == "1") { - proxy_cmd = "tentacle_server.exe -C"; - } - else { - proxy_cmd = "tentacle_server.exe"; - } - // Proxy address. proxy_address = conf->getValue("proxy_address"); if (proxy_address == "") { @@ -472,7 +463,7 @@ Pandora_Windows_Service::launchTentacleProxy() { proxy_port = "41121"; } - proxy_cmd += " -b " + server_ip + " -g " + server_port + " -c " + proxy_max_connections + " -t " + proxy_timeout + " -a " + proxy_address + " -p " + proxy_port; + proxy_cmd = "tentacle_server.exe -b " + server_ip + " -g " + server_port + " -c " + proxy_max_connections + " -t " + proxy_timeout + " -a " + proxy_address + " -p " + proxy_port; ZeroMemory (&si, sizeof (si)); ZeroMemory (&pi, sizeof (pi)); From f8eafa5015fce37a4b4c0d50acee2ba7435fa3c4 Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Wed, 12 May 2021 12:52:44 +0000 Subject: [PATCH 28/50] fixed visual error on snmp interfaces agent graphs black theme --- .../extensions/realtime_graphs.php | 12 +++++++--- .../include/styles/pandora_black.css | 17 ++++++++++++++ .../agentes/interface_traffic_graph_win.php | 22 +++++++++---------- .../operation/agentes/realtime_win.php | 8 +++++++ 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index 86fcfc4f0e..37593d5355 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -42,6 +42,10 @@ function pandora_realtime_graphs() global $config; check_login(); + if ($config['style'] === 'pandora_black') { + ui_require_css_file('pandora_black', 'include/styles/', true); + } + $id_network = get_parameter('id_network', 0); $action = get_parameter('action', 'list'); @@ -66,8 +70,8 @@ function pandora_realtime_graphs() $long_index = []; $no_data_image = ''; - $canvas = '
'; - $canvas .= '
'; + $canvas = '
'; + $canvas .= '
'; $width = 800; $height = 300; @@ -239,7 +243,9 @@ function pandora_realtime_graphs() echo ''; echo ''; - echo ''; + if ($config['style'] !== 'pandora_black') { + echo ''; + } // Store servers timezone offset to be retrieved from js. set_js_value('timezone_offset', date('Z', time())); diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index b3342794cf..6918850a57 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -1000,6 +1000,23 @@ table.databox { .tactical_set { border-color: #707070; } + li.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab { border: 1px solid #707070; } +.chartLegend { + width: 100%; + position: relative; + height: 30px; +} + +.chartLegend table { + position: absolute; + right: 0px; +} + +.graph_container { + width: 800px; + margin: 20px auto; + border-radius: 3px; +} diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index cb06076ac2..dd3b36d546 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -68,6 +68,9 @@ if (file_exists('../../include/languages/'.$user_language.'.mo')) { } echo ''; +if ($config['style'] === 'pandora_black') { + ui_require_css_file('pandora_black', 'include/styles/', true); +} $interface_name = (string) $params['interface_name']; $agent_id = (int) $params['agent_id']; @@ -190,6 +193,7 @@ $data[1] .= html_print_image( [ 'onclick' => "scwShow(scwID('text-start_date'),this);", 'style' => 'vertical-align: bottom;', + 'class' => 'invert_filter', ], false, false, @@ -251,7 +255,8 @@ $options[2] = 'x2'; $options[3] = 'x3'; $options[4] = 'x4'; $options[5] = __('Full'); -$data[1] = html_print_select( +/* + $data[1] = html_print_select( $options, 'zoom', $zoom, @@ -261,9 +266,9 @@ $data[1] = html_print_select( true, false, false -); -$table->data[] = $data; -$table->rowclass[] = ''; + ); + $table->data[] = $data; +$table->rowclass[] = '';*/ $form_table = html_print_table($table, true); $form_table .= '
'; @@ -284,7 +289,7 @@ if (empty($server_id) === false) { $menu_form .= html_print_input_hidden('server', $server_id, true); } -$menu_form .= '
'; +$menu_form .= '
'; $menu_form .= '
'; $menu_form .= html_print_image( 'images/arrow_down_green.png', @@ -312,13 +317,6 @@ $menu_form .= '
'; $menu_form .= ''; echo $menu_form; -echo '
-
- '.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).' - '.__('Graph configuration menu').'
- -
'; -echo ''; // Hidden div to forced title. html_print_div( diff --git a/pandora_console/operation/agentes/realtime_win.php b/pandora_console/operation/agentes/realtime_win.php index 53837e7c5b..0068fb7425 100644 --- a/pandora_console/operation/agentes/realtime_win.php +++ b/pandora_console/operation/agentes/realtime_win.php @@ -64,6 +64,10 @@ if (file_exists('../../include/languages/'.$user_language.'.mo')) { $l10n->load_tables(); } +if ($config['style'] === 'pandora_black') { + ui_require_css_file('pandora_black', 'include/styles/', true); +} + echo ''; ?> @@ -92,6 +96,10 @@ echo ' Date: Wed, 12 May 2021 12:54:36 +0000 Subject: [PATCH 29/50] Added missing fields to alert snmp actions --- pandora_console/extras/mr/47.sql | 9 +++++++++ .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 5 +++++ pandora_console/pandoradb.sql | 5 +++++ pandora_server/lib/PandoraFMS/Core.pm | 20 +++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 pandora_console/extras/mr/47.sql diff --git a/pandora_console/extras/mr/47.sql b/pandora_console/extras/mr/47.sql new file mode 100644 index 0000000000..fa5d161a0c --- /dev/null +++ b/pandora_console/extras/mr/47.sql @@ -0,0 +1,9 @@ +START TRANSACTION; + +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field16` TEXT NOT NULL AFTER `al_field15`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field17` TEXT NOT NULL AFTER `al_field16`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field18` TEXT NOT NULL AFTER `al_field17`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field19` TEXT NOT NULL AFTER `al_field18`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field20` TEXT NOT NULL AFTER `al_field19`; + +COMMIT; \ No newline at end of file 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 fce9be7024..3a22bd4f90 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 @@ -1334,6 +1334,11 @@ ALTER TABLE talert_snmp_action ADD COLUMN `al_field12` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp_action ADD COLUMN `al_field13` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp_action ADD COLUMN `al_field14` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp_action ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field16` TEXT NOT NULL AFTER `al_field15`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field17` TEXT NOT NULL AFTER `al_field16`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field18` TEXT NOT NULL AFTER `al_field17`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field19` TEXT NOT NULL AFTER `al_field18`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field20` TEXT NOT NULL AFTER `al_field19`; -- ---------------------------------------------------------------------- -- Table `tserver` diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index be106eef9d..90f2e4a076 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2263,6 +2263,11 @@ CREATE TABLE IF NOT EXISTS `talert_snmp_action` ( `al_field13` text NOT NULL, `al_field14` text NOT NULL, `al_field15` text NOT NULL, + `al_field16` text NOT NULL, + `al_field17` text NOT NULL, + `al_field18` text NOT NULL, + `al_field19` text NOT NULL, + `al_field20` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index b3f8db192a..a384d3701e 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4031,6 +4031,12 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) { $alert->{'al_field13'} = subst_alert_macros ($alert->{'al_field13'}, \%macros); $alert->{'al_field14'} = subst_alert_macros ($alert->{'al_field14'}, \%macros); $alert->{'al_field15'} = subst_alert_macros ($alert->{'al_field15'}, \%macros); + $alert->{'al_field16'} = subst_alert_macros ($alert->{'al_field16'}, \%macros); + $alert->{'al_field17'} = subst_alert_macros ($alert->{'al_field17'}, \%macros); + $alert->{'al_field18'} = subst_alert_macros ($alert->{'al_field18'}, \%macros); + $alert->{'al_field19'} = subst_alert_macros ($alert->{'al_field19'}, \%macros); + $alert->{'al_field20'} = subst_alert_macros ($alert->{'al_field20'}, \%macros); + # Check time threshold $alert->{'last_fired'} = '1970-01-01 00:00:00' unless defined ($alert->{'last_fired'}); @@ -4070,6 +4076,14 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) { 'field13' => $alert->{'al_field13'}, 'field14' => $alert->{'al_field14'}, 'field15' => $alert->{'al_field15'}, + 'field16' => $alert->{'al_field16'}, + 'field17' => $alert->{'al_field17'}, + 'field18' => $alert->{'al_field18'}, + 'field19' => $alert->{'al_field19'}, + 'field20' => $alert->{'al_field20'}, + + + 'description' => $alert->{'description'}, 'times_fired' => $times_fired, 'time_threshold' => 0, @@ -4155,6 +4169,12 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) { 'field13' => $other_alert->{'al_field13'}, 'field14' => $other_alert->{'al_field14'}, 'field15' => $other_alert->{'al_field15'}, + 'field16' => $other_alert->{'al_field16'}, + 'field17' => $other_alert->{'al_field17'}, + 'field18' => $other_alert->{'al_field18'}, + 'field19' => $other_alert->{'al_field19'}, + 'field20' => $other_alert->{'al_field20'}, + 'description' => '', 'times_fired' => $times_fired, 'time_threshold' => 0, From 3758c800193de8481d0ac02c81aef167f0f2f2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Gonz=C3=A1lez?= <79-jose.gonzalez@users.noreply.brutus.artica.es> Date: Wed, 12 May 2021 13:07:45 +0000 Subject: [PATCH 30/50] Fixed delete_files entries. --- .../extras/delete_files/delete_files.txt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt index 4249b8c0c2..50d4b78c33 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -74,15 +74,10 @@ enterprise/extensions/ipam enterprise/extensions/disabled/visual_console_manager.php enterprise/extensions/visual_console_manager.php pandora_console/extensions/net_tools.php -pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatCURL.pm -pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatConfig.pm -pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatLWP.pm -pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/Goliat/GoliatTools.pm -pandora_enterprise/pandora_server/PandoraFMS-Enterprise/lib/PandoraFMS/WebServer.pm -pandora_console/enterprise/godmode/agentes/module_manager_editor_web.php -pandora_console/enterprise/include/ajax/web_server_module_debug.php -pandora_console/enterprise/include/class/WebServerModuleDebug.class.php -pandora_console/enterprise/include/styles/WebServerModuleDebug.css +enterprise/godmode/agentes/module_manager_editor_web.php +enterprise/include/ajax/web_server_module_debug.php +enterprise/include/class/WebServerModuleDebug.class.php +enterprise/include/styles/WebServerModuleDebug.css include/lib/WSManager.php include/lib/WebSocketServer.php include/lib/WebSocketUser.php From 7d7c4db8f4592f4e91d5874d40f4da89aed3b36a Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 12 May 2021 15:21:44 +0200 Subject: [PATCH 31/50] Revert "Use -C to invoke tentacle_server when using SSL proxy mode (see also e8e59f3e3e98)." This reverts commit f005b00eb64d715ee6eca5d1ac795a56a1be068c. -C is not a valid option for tentacle_server. --- pandora_agents/unix/pandora_agent | 3 --- 1 file changed, 3 deletions(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index f85a2db72c..4613479ae1 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -2331,9 +2331,6 @@ sub launch_tentacle_proxy () { #Execute tentacle server as a daemon my $new_process = "tentacle_server -a ".$Conf{'proxy_address'}." -p ".$Conf{'proxy_port'}." -b ".$Conf{'server_ip'}." -g ".$Conf{'server_port'}." -c ".$Conf{'proxy_max_connection'}." -t ".$Conf{'proxy_timeout'}; - - $new_process .= ' -C' if ($Conf{'server_ssl'} eq '1'); - log_message ('setup', 'Proxy mode enabled'); exec ($new_process); } From afa48e815df5b542e57539a7a53a3c180fa1cb60 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 13 May 2021 01:00:45 +0200 Subject: [PATCH 32/50] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index d5bc31c3d5..36e53ecea4 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.754-210512 +Version: 7.0NG.754-210513 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 5bceedb77b..cf86004742 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.754-210512" +pandora_version="7.0NG.754-210513" 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 f85a2db72c..248f0fd4a1 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.754'; -use constant AGENT_BUILD => '210512'; +use constant AGENT_BUILD => '210513'; # 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 02fcf95fba..2e51763325 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.754 -%define release 210512 +%define release 210513 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 faad25be9b..7e85bcba76 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.754 -%define release 210512 +%define release 210513 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 7d404141ea..99f7f5d086 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210512" +PI_BUILD="210513" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 4f4323ebc9..d1cb263733 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210512} +{210513} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 945516e0c3..57c368a773 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.754 Build 210512") +#define PANDORA_VERSION ("7.0NG.754 Build 210513") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e87c3b25a4..895e32ceb8 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.754(Build 210512))" + VALUE "ProductVersion", "(7.0NG.754(Build 210513))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index e8e4aadb78..f0bb243dba 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.754-210512 +Version: 7.0NG.754-210513 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 bf5d4464a2..0c82e3b4f4 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.754-210512" +pandora_version="7.0NG.754-210513" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 827c80179e..ac57a8e236 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 = 'PC210512'; +$build_version = 'PC210513'; $pandora_version = 'v7.0NG.754'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 35d1b47938..579f810b12 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index d19af75b60..8a8cfd64fa 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.754 -%define release 210512 +%define release 210513 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index ec3596edb0..36504c200e 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.754 -%define release 210512 +%define release 210513 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index a5890a25d9..34be4a360a 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210512" +PI_BUILD="210513" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 5552b64b69..83a9dfdec9 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.754 Build 210512"; +my $version = "7.0NG.754 Build 210513"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index fa47a00410..0d8a97ae19 100755 --- 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.754 PS210512"; +my $version = "7.0NG.754 Build 210513"; # save program name for logging my $progname = basename($0); From d711d713927e5d5e59c9a31c93ed3cca80f70607 Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 13 May 2021 13:09:42 +0200 Subject: [PATCH 33/50] remove vamos a ver --- pandora_console/operation/tree.php | 1 - 1 file changed, 1 deletion(-) diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index 93e1c18813..c7e5097c55 100755 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -444,7 +444,6 @@ enterprise_hook('close_meta_frame'); .hide() .prop("id", "module_details_window") .appendTo('body'); - console.log("vamos a ver"); function show_module_detail_dialog(module_id, id_agent, server_name, offset, period, module_name) { var params = {}; var f = new Date(); From 40cfe62e9652cdea66b7f832253e154d6f73c56f Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 13 May 2021 13:14:16 +0200 Subject: [PATCH 34/50] changed bell orange --- pandora_console/images/bell_orange.png | Bin 898 -> 432 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/pandora_console/images/bell_orange.png b/pandora_console/images/bell_orange.png index f9ded2982548ed97d3db221bb5c54b7199509269..e54f00a367d855eb5c6e1d2ec80e02ba4653f018 100644 GIT binary patch literal 432 zcmV;h0Z;ykP)hiO zM+Qm&KmbvWfX*oZVg+<@CLHeW2jctaallAK+L{3LY$1xt*sO(u0&LDmAmkS&Qap~V zn4gehSbjBtJX`D4z;}hD@MFCQ^U~7pM@~2zA{D ae0l&BD0uNljDjTq0000nP38T>!MAjrWW#2~=TsKme|$jB_n z`2PswA_fLVRz@&jfC5G)p!?X^IXJnv1sIqZnVFebm_e=us;mXdF|Y`-3Mm>ovIz$! zvMUve7&T5@$f4}C@t|nX#SbdRNkvVZTw>x9l2WQ_>Kd9_CZ=ZQ7M51dF0O9w9-dyo zA)#U65s^{JDXD4c8JStdC8cHM6_r)ZEv;?s9i3g1CQq3GGAU*RJ2VdF$b$$4{OPfBE|D`;VW$ z7#Wx$-T{&j4Gc)#w^HS&+zN@x8*+` zuKtl66wmR(xVClaHlcfQ%YWUmE0mId_#kEC`7?$+GV9;0|F}E+quY{yLf6yG&x)>` zcJAZP=^PFk&wuQ&WcmDQ&U0lM{kO^={xck%b-cGUUiAEeb<-CayXMOtz4~{<{jE-I z%4aO@_OUNBK9^~qww|eCx!1>Sb05vl;dZjZiQ>wnjN^QZY=lc#-n{&erp#r2ulw`cwSvh~}A zU-yrTiQSssVp?5&x?c{LippR{O#DPZ}@fzrLA&YJXH=|8-GLK7=OHK QS?hY}SMl3V_Wy4J0A~(ig8%>k From 9cde8c345fcc8ef8255a5dd360abcc8ba0a8be4a Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Thu, 13 May 2021 13:33:45 +0200 Subject: [PATCH 35/50] removed deprecated incident permissions --- pandora_console/extras/mr/47.sql | 3 + .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 3 + pandora_console/general/main_menu.php | 1 - .../godmode/agentes/agent_incidents.php | 2 +- .../godmode/gis_maps/configure_gis_map.php | 4 +- .../godmode/netflow/nf_item_list.php | 9 - .../godmode/setup/setup_netflow.php | 9 - .../godmode/users/configure_profile.php | 27 +-- .../godmode/users/profile_list.php | 27 +-- .../include/class/NetworkMap.class.php | 2 +- pandora_console/include/functions.php | 23 +-- pandora_console/include/functions_api.php | 186 ++++-------------- .../include/functions_integriaims.php | 20 +- pandora_console/include/functions_netflow.php | 2 +- .../include/functions_networkmap.php | 2 +- pandora_console/include/functions_users.php | 3 - .../configure_integriaims_incident.php | 7 - .../dashboard_detail_integriaims_incident.php | 30 +-- .../incidents/incident_statistics.php | 8 +- .../incidents/integriaims_export_csv.php | 8 - .../incidents/list_integriaims_incidents.php | 41 ++-- pandora_console/operation/menu.php | 47 ++--- .../operation/netflow/nf_live_view.php | 2 +- .../operation/search_graphs.getdata.php | 2 +- pandora_console/operation/search_graphs.php | 2 +- pandora_console/operation/search_helps.php | 2 - .../operation/search_maps.getdata.php | 2 +- pandora_console/operation/search_maps.php | 2 +- pandora_console/operation/search_reports.php | 4 +- pandora_console/operation/search_results.php | 3 +- .../operation/snmpconsole/snmp_view.php | 87 +++----- pandora_console/pandoradb.sql | 3 - pandora_server/util/pandora_manage.pl | 28 +-- 33 files changed, 156 insertions(+), 445 deletions(-) diff --git a/pandora_console/extras/mr/47.sql b/pandora_console/extras/mr/47.sql index 99597d995f..ff25ad522f 100644 --- a/pandora_console/extras/mr/47.sql +++ b/pandora_console/extras/mr/47.sql @@ -2,5 +2,8 @@ START TRANSACTION; ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_user` VARCHAR(60); ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_pass` VARCHAR(45); +ALTER TABLE `tperfil` DROP COLUMN `incident_view`; +ALTER TABLE `tperfil` DROP COLUMN `incident_edit`; +ALTER TABLE `tperfil` DROP COLUMN `incident_management`; 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 b8242b07e8..801327f212 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 @@ -4027,3 +4027,6 @@ DELETE FROM `tconfig` WHERE `token` = 'ipam_installed'; DELETE FROM `tconfig` WHERE `token` = 'ipam_recon_script_id'; +ALTER TABLE `tperfil` DROP COLUMN `incident_view`; +ALTER TABLE `tperfil` DROP COLUMN `incident_edit`; +ALTER TABLE `tperfil` DROP COLUMN `incident_management`; \ No newline at end of file diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index 9a5e4168b4..5a45058c58 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -88,7 +88,6 @@ if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'LM') || check_acl($config['id_user'], 0, 'UM') || check_acl($config['id_user'], 0, 'LW') - || check_acl($config['id_user'], 0, 'IW') || check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, 'DW') ) { diff --git a/pandora_console/godmode/agentes/agent_incidents.php b/pandora_console/godmode/agentes/agent_incidents.php index c92dca6fab..3917c2f81a 100644 --- a/pandora_console/godmode/agentes/agent_incidents.php +++ b/pandora_console/godmode/agentes/agent_incidents.php @@ -39,7 +39,7 @@ $offset = (int) get_parameter('offset', 0); // See if id_agente is set (either POST or GET, otherwise -1 $id_agent = (int) get_parameter('id_agente'); -$groups = users_get_groups($config['id_user'], 'IR'); +$groups = users_get_groups($config['id_user'], 'AR'); $filter = ' AND id_agent = '.$id_agent; $url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=incident&id_agente='.$id_agent; diff --git a/pandora_console/godmode/gis_maps/configure_gis_map.php b/pandora_console/godmode/gis_maps/configure_gis_map.php index 5b68afaf37..4c921525e6 100644 --- a/pandora_console/godmode/gis_maps/configure_gis_map.php +++ b/pandora_console/godmode/gis_maps/configure_gis_map.php @@ -15,7 +15,7 @@ global $config; check_login(); -$gis_w = check_acl($config['id_user'], 0, 'MW'); +$gis_w = check_acl($config['id_user'], 0, 'MW', false, true, true); $gis_m = check_acl($config['id_user'], 0, 'MM'); $access = ($gis_w == true) ? 'MW' : (($gis_m == true) ? 'MM' : 'MW'); @@ -490,7 +490,7 @@ if (users_can_manage_group_all('MM') === true) { $table->data[2][0] = __('Group'); $table->data[2][1] = html_print_select_groups( false, - 'IW', + 'AR', $return_all_group, 'map_group_id', $map_group_id, diff --git a/pandora_console/godmode/netflow/nf_item_list.php b/pandora_console/godmode/netflow/nf_item_list.php index 558cbb339c..d7a267aed6 100644 --- a/pandora_console/godmode/netflow/nf_item_list.php +++ b/pandora_console/godmode/netflow/nf_item_list.php @@ -20,15 +20,6 @@ require_once $config['homedir'].'/include/functions_html.php'; check_login(); -if (! check_acl($config['id_user'], 0, 'IW')) { - db_pandora_audit( - 'ACL Violation', - 'Trying to access event viewer' - ); - include 'general/noaccess.php'; - return; -} - // id report $id = (int) get_parameter('id'); diff --git a/pandora_console/godmode/setup/setup_netflow.php b/pandora_console/godmode/setup/setup_netflow.php index 33ceb5295f..47d93790b4 100644 --- a/pandora_console/godmode/setup/setup_netflow.php +++ b/pandora_console/godmode/setup/setup_netflow.php @@ -24,15 +24,6 @@ require_once 'include/functions_ui.php'; check_login(); -if (! check_acl($config['id_user'], 0, 'IR')) { - db_pandora_audit( - 'ACL Violation', - 'Trying to access netflow setup' - ); - include 'general/noaccess.php'; - return; -} - $update = (bool) get_parameter('update'); $table->width = '100%'; diff --git a/pandora_console/godmode/users/configure_profile.php b/pandora_console/godmode/users/configure_profile.php index e41be191ea..44ef0e6a1e 100644 --- a/pandora_console/godmode/users/configure_profile.php +++ b/pandora_console/godmode/users/configure_profile.php @@ -85,11 +85,6 @@ if ($id_profile || $new_profile) { // Name $name = ''; - // Incidents - $incident_view = 0; - $incident_edit = 0; - $incident_management = 0; - // Agents $agent_view = 0; $agent_edit = 0; @@ -148,11 +143,6 @@ if ($id_profile || $new_profile) { // Name $name = $profile['name']; - // Incidents - $incident_view = (bool) $profile['incident_view']; - $incident_edit = (bool) $profile['incident_edit']; - $incident_management = (bool) $profile['incident_management']; - // Agents $agent_view = (bool) $profile['agent_view']; $agent_edit = (bool) $profile['agent_edit']; @@ -197,7 +187,7 @@ if ($id_profile || $new_profile) { ); enterprise_include_once('include/functions_audit.php'); - $info = 'Name: '.$name.' Incident view: '.$incident_view.' Incident edit: '.$incident_edit.' Incident management: '.$incident_management.' Agent view: '.$agent_view.' Agent edit: '.$agent_edit.' Agent disable: '.$agent_disable.' Alert edit: '.$alert_edit.' Alert management: '.$alert_management.' User management: '.$user_management.' DB management: '.$db_management.' Event view: '.$event_view.' Event edit: '.$event_edit.' Event management: '.$event_management.' Report view: '.$report_view.' Report edit: '.$report_edit.' Report management: '.$report_management.' Network map view: '.$map_view.' Network map edit: '.$map_edit.' Network map management: '.$map_management.' Visual console view: '.$vconsole_view.' Visual console edit: '.$vconsole_edit.' Visual console management: '.$vconsole_management.' '.get_product_name().' Management: '.$pandora_management; + $info = 'Name: '.$name.' Agent view: '.$agent_view.' Agent edit: '.$agent_edit.' Agent disable: '.$agent_disable.' Alert edit: '.$alert_edit.' Alert management: '.$alert_management.' User management: '.$user_management.' DB management: '.$db_management.' Event view: '.$event_view.' Event edit: '.$event_edit.' Event management: '.$event_management.' Report view: '.$report_view.' Report edit: '.$report_edit.' Report management: '.$report_management.' Network map view: '.$map_view.' Network map edit: '.$map_edit.' Network map management: '.$map_management.' Visual console view: '.$vconsole_view.' Visual console edit: '.$vconsole_edit.' Visual console management: '.$vconsole_management.' '.get_product_name().' Management: '.$pandora_management; enterprise_hook('audit_pandora_enterprise', [$id_audit, $info]); @@ -319,21 +309,6 @@ if ($id_profile || $new_profile) { $table->data['VM'] = $row; $table->data[] = '
'; - // Incidents - $row = []; - $row['name'] = __('View incidents'); - $row['input'] = html_print_checkbox('incident_view', 1, $incident_view, true); - $table->data['IR'] = $row; - $row = []; - $row['name'] = __('Edit incidents'); - $row['input'] = html_print_checkbox('incident_edit', 1, $incident_edit, true, false, 'autoclick_profile_users(\'incident_edit\', \'incident_view\', \'false\')'); - $table->data['IW'] = $row; - $row = []; - $row['name'] = __('Manage incidents'); - $row['input'] = html_print_checkbox('incident_management', 1, $incident_management, true, false, 'autoclick_profile_users(\'incident_management\', \'incident_view\', \'incident_edit\');'); - $table->data['IM'] = $row; - $table->data[] = '
'; - $disable_option = 'javascript: return false;'; if (check_acl($config['id_user'], 0, 'PM') || users_is_admin()) { $disable_option = ''; diff --git a/pandora_console/godmode/users/profile_list.php b/pandora_console/godmode/users/profile_list.php index bd66475968..81973f6df7 100644 --- a/pandora_console/godmode/users/profile_list.php +++ b/pandora_console/godmode/users/profile_list.php @@ -107,11 +107,6 @@ if ($delete_profile) { if ($create_profile || $update_profile) { $name = get_parameter('name'); - // Incidents - $incident_view = (bool) get_parameter('incident_view'); - $incident_edit = (bool) get_parameter('incident_edit'); - $incident_management = (bool) get_parameter('incident_management'); - // Agents $agent_view = (bool) get_parameter('agent_view'); $agent_edit = (bool) get_parameter('agent_edit'); @@ -152,9 +147,6 @@ if ($create_profile || $update_profile) { $values = [ 'name' => $name, - 'incident_view' => $incident_view, - 'incident_edit' => $incident_edit, - 'incident_management' => $incident_management, 'agent_view' => $agent_view, 'agent_edit' => $agent_edit, 'agent_disable' => $agent_disable, @@ -183,10 +175,7 @@ if ($update_profile) { if ($name) { $ret = db_process_sql_update('tperfil', $values, ['id_perfil' => $id_profile]); if ($ret !== false) { - $info = '{"Name":"'.$incident_view.'", - "Incident view":"'.$incident_view.'", - "Incident edit":"'.$incident_edit.'", - "Incident management":"'.$incident_management.'", + $info = '{"Name":"'.$name.'", "Agent view":"'.$agent_view.'", "Agent edit":"'.$agent_edit.'", "Agent disable":"'.$agent_disable.'", @@ -234,10 +223,7 @@ if ($create_profile) { if ($ret !== false) { ui_print_success_message(__('Successfully created')); - $info = '{"Name":"'.$incident_view.'", - "Incident view":"'.$incident_view.'", - "Incident edit":"'.$incident_edit.'", - "Incident management":"'.$incident_management.'", + $info = '{"Name":"'.$name.'", "Agent view":"'.$agent_view.'", "Agent edit":"'.$agent_edit.'", "Agent disable":"'.$agent_disable.'", @@ -289,9 +275,6 @@ $table->align = []; $table->head['profiles'] = __('Profiles'); -$table->head['IR'] = 'IR'; -$table->head['IW'] = 'IW'; -$table->head['IM'] = 'IM'; $table->head['AR'] = 'AR'; $table->head['AW'] = 'AW'; $table->head['AD'] = 'AD'; @@ -317,9 +300,6 @@ $table->head['operations'] = ''.__('Op.').''; $table->align = array_fill(1, 11, 'center'); $table->size['profiles'] = '200px'; -$table->size['IR'] = '10px'; -$table->size['IW'] = '10px'; -$table->size['IM'] = '10px'; $table->size['AR'] = '10px'; $table->size['AW'] = '10px'; $table->size['AD'] = '10px'; @@ -358,9 +338,6 @@ $img = html_print_image( foreach ($profiles as $profile) { $data['profiles'] = ''.$profile['name'].''; - $data['IR'] = ($profile['incident_view'] ? $img : ''); - $data['IW'] = ($profile['incident_edit'] ? $img : ''); - $data['IM'] = ($profile['incident_management'] ? $img : ''); $data['AR'] = ($profile['agent_view'] ? $img : ''); $data['AW'] = ($profile['agent_edit'] ? $img : ''); $data['AD'] = ($profile['agent_disable'] ? $img : ''); diff --git a/pandora_console/include/class/NetworkMap.class.php b/pandora_console/include/class/NetworkMap.class.php index 1298fe1ef1..c953b74dec 100644 --- a/pandora_console/include/class/NetworkMap.class.php +++ b/pandora_console/include/class/NetworkMap.class.php @@ -3207,7 +3207,7 @@ class NetworkMap $table->data[0][0] = __('Group'); $table->data[0][1] = html_print_select_groups( false, - 'IW', + 'AR', false, 'group_for_show_agents', -1, diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 32312238ce..20d7422053 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2281,9 +2281,6 @@ function check_login($output=true) * Check access privileges to resources * * Access can be: - * IR - Incident/report Read - * IW - Incident/report Write - * IM - Incident/report Management * AR - Agent Read * AW - Agent Write * LW - Alert Write @@ -2374,9 +2371,6 @@ function check_acl_one_of_groups($id_user, $groups, $access, $cache=true) * Check access privileges to resources (write or management is not allowed for 'all' group ) * * Access can be: - * IR - Incident/report Read - * IW - Incident/report Write - * IM - Incident/report Management * AR - Agent Read * AW - Agent Write * LW - Alert Write @@ -2445,18 +2439,6 @@ function check_acl_restricted_all($id_user, $id_group, $access, $onlyOneGroup=fa function get_acl_column($access) { switch ($access) { - case 'IR': - return 'incident_view'; - - break; - case 'IW': - return 'incident_edit'; - - break; - case 'IM': - return 'incident_management'; - - break; case 'AR': return 'agent_view'; @@ -2552,10 +2534,7 @@ function get_users_acl($id_user) $rowdup = $users_acl_cache[$id_user]; } else { $query = sprintf( - "SELECT sum(tperfil.incident_view) as incident_view, - sum(tperfil.incident_edit) as incident_edit, - sum(tperfil.incident_management) as incident_management, - sum(tperfil.agent_view) as agent_view, + "SELECT sum(tperfil.agent_view) as agent_view, sum(tperfil.agent_edit) as agent_edit, sum(tperfil.alert_edit) as alert_edit, sum(tperfil.alert_management) as alert_management, diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index de094fabad..0fd46701b4 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -486,7 +486,7 @@ function api_get_groups($thrash1, $thrash2, $other, $returnType, $user_in_db) $returnAllColumns = ( $other['data'][2] == '1' ? true : false); } - $groups = users_get_groups($user_in_db, 'IR', $returnAllGroup, $returnAllColumns); + $groups = users_get_groups($user_in_db, 'AR', $returnAllGroup, $returnAllColumns); $data_groups = []; foreach ($groups as $id => $group) { @@ -11358,9 +11358,6 @@ function api_get_user_profiles_info($thrash1, $thrash2, $thrash3, $returnType) [ 'id_perfil', 'name', - 'incident_view as IR', - 'incident_edit as IW', - 'incident_management as IM', 'agent_view as AR', 'agent_edit as AW', 'agent_disable as AD', @@ -11413,29 +11410,26 @@ function api_set_create_user_profile_info($thrash1, $thrash2, $other, $returnTyp $values = [ 'name' => (string) $other['data'][0], - 'incident_view' => (bool) $other['data'][1] ? 1 : 0, - 'incident_edit' => (bool) $other['data'][2] ? 1 : 0, - 'incident_management' => (bool) $other['data'][3] ? 1 : 0, - 'agent_view' => (bool) $other['data'][4] ? 1 : 0, - 'agent_edit' => (bool) $other['data'][5] ? 1 : 0, - 'agent_disable' => (bool) $other['data'][6] ? 1 : 0, - 'alert_edit' => (bool) $other['data'][7] ? 1 : 0, - 'alert_management' => (bool) $other['data'][8] ? 1 : 0, - 'user_management' => (bool) $other['data'][9] ? 1 : 0, - 'db_management' => (bool) $other['data'][10] ? 1 : 0, - 'event_view' => (bool) $other['data'][11] ? 1 : 0, - 'event_edit' => (bool) $other['data'][12] ? 1 : 0, - 'event_management' => (bool) $other['data'][13] ? 1 : 0, - 'report_view' => (bool) $other['data'][14] ? 1 : 0, - 'report_edit' => (bool) $other['data'][15] ? 1 : 0, - 'report_management' => (bool) $other['data'][16] ? 1 : 0, - 'map_view' => (bool) $other['data'][17] ? 1 : 0, - 'map_edit' => (bool) $other['data'][18] ? 1 : 0, - 'map_management' => (bool) $other['data'][19] ? 1 : 0, - 'vconsole_view' => (bool) $other['data'][20] ? 1 : 0, - 'vconsole_edit' => (bool) $other['data'][21] ? 1 : 0, - 'vconsole_management' => (bool) $other['data'][22] ? 1 : 0, - 'pandora_management' => (bool) $other['data'][23] ? 1 : 0, + 'agent_view' => (bool) $other['data'][1] ? 1 : 0, + 'agent_edit' => (bool) $other['data'][2] ? 1 : 0, + 'agent_disable' => (bool) $other['data'][3] ? 1 : 0, + 'alert_edit' => (bool) $other['data'][4] ? 1 : 0, + 'alert_management' => (bool) $other['data'][5] ? 1 : 0, + 'user_management' => (bool) $other['data'][6] ? 1 : 0, + 'db_management' => (bool) $other['data'][7] ? 1 : 0, + 'event_view' => (bool) $other['data'][8] ? 1 : 0, + 'event_edit' => (bool) $other['data'][9] ? 1 : 0, + 'event_management' => (bool) $other['data'][10] ? 1 : 0, + 'report_view' => (bool) $other['data'][11] ? 1 : 0, + 'report_edit' => (bool) $other['data'][12] ? 1 : 0, + 'report_management' => (bool) $other['data'][13] ? 1 : 0, + 'map_view' => (bool) $other['data'][14] ? 1 : 0, + 'map_edit' => (bool) $other['data'][15] ? 1 : 0, + 'map_management' => (bool) $other['data'][16] ? 1 : 0, + 'vconsole_view' => (bool) $other['data'][17] ? 1 : 0, + 'vconsole_edit' => (bool) $other['data'][18] ? 1 : 0, + 'vconsole_management' => (bool) $other['data'][19] ? 1 : 0, + 'pandora_management' => (bool) $other['data'][20] ? 1 : 0, ]; $return = db_process_sql_insert('tperfil', $values); @@ -11475,29 +11469,26 @@ function api_set_update_user_profile_info($id_profile, $thrash1, $other, $return $values = [ 'name' => $other['data'][0] == '' ? $profile['name'] : (string) $other['data'][0], - 'incident_view' => $other['data'][1] == '' ? $profile['incident_view'] : (bool) $other['data'][1] ? 1 : 0, - 'incident_edit' => $other['data'][2] == '' ? $profile['incident_edit'] : (bool) $other['data'][2] ? 1 : 0, - 'incident_management' => $other['data'][3] == '' ? $profile['incident_management'] : (bool) $other['data'][3] ? 1 : 0, - 'agent_view' => $other['data'][4] == '' ? $profile['agent_view'] : (bool) $other['data'][4] ? 1 : 0, - 'agent_edit' => $other['data'][5] == '' ? $profile['agent_edit'] : (bool) $other['data'][5] ? 1 : 0, - 'agent_disable' => $other['data'][6] == '' ? $profile['agent_disable'] : (bool) $other['data'][6] ? 1 : 0, - 'alert_edit' => $other['data'][7] == '' ? $profile['alert_edit'] : (bool) $other['data'][7] ? 1 : 0, - 'alert_management' => $other['data'][8] == '' ? $profile['alert_management'] : (bool) $other['data'][8] ? 1 : 0, - 'user_management' => $other['data'][9] == '' ? $profile['user_management'] : (bool) $other['data'][9] ? 1 : 0, - 'db_management' => $other['data'][10] == '' ? $profile['db_management'] : (bool) $other['data'][10] ? 1 : 0, - 'event_view' => $other['data'][11] == '' ? $profile['event_view'] : (bool) $other['data'][11] ? 1 : 0, - 'event_edit' => $other['data'][12] == '' ? $profile['event_edit'] : (bool) $other['data'][12] ? 1 : 0, - 'event_management' => $other['data'][13] == '' ? $profile['event_management'] : (bool) $other['data'][13] ? 1 : 0, - 'report_view' => $other['data'][14] == '' ? $profile['report_view'] : (bool) $other['data'][14] ? 1 : 0, - 'report_edit' => $other['data'][15] == '' ? $profile['report_edit'] : (bool) $other['data'][15] ? 1 : 0, - 'report_management' => $other['data'][16] == '' ? $profile['report_management'] : (bool) $other['data'][16] ? 1 : 0, - 'map_view' => $other['data'][17] == '' ? $profile['map_view'] : (bool) $other['data'][17] ? 1 : 0, - 'map_edit' => $other['data'][18] == '' ? $profile['map_edit'] : (bool) $other['data'][18] ? 1 : 0, - 'map_management' => $other['data'][19] == '' ? $profile['map_management'] : (bool) $other['data'][19] ? 1 : 0, - 'vconsole_view' => $other['data'][20] == '' ? $profile['vconsole_view'] : (bool) $other['data'][20] ? 1 : 0, - 'vconsole_edit' => $other['data'][21] == '' ? $profile['vconsole_edit'] : (bool) $other['data'][21] ? 1 : 0, - 'vconsole_management' => $other['data'][22] == '' ? $profile['vconsole_management'] : (bool) $other['data'][22] ? 1 : 0, - 'pandora_management' => $other['data'][23] == '' ? $profile['pandora_management'] : (bool) $other['data'][23] ? 1 : 0, + 'agent_view' => $other['data'][1] == '' ? $profile['agent_view'] : (bool) $other['data'][1] ? 1 : 0, + 'agent_edit' => $other['data'][2] == '' ? $profile['agent_edit'] : (bool) $other['data'][2] ? 1 : 0, + 'agent_disable' => $other['data'][3] == '' ? $profile['agent_disable'] : (bool) $other['data'][3] ? 1 : 0, + 'alert_edit' => $other['data'][4] == '' ? $profile['alert_edit'] : (bool) $other['data'][4] ? 1 : 0, + 'alert_management' => $other['data'][5] == '' ? $profile['alert_management'] : (bool) $other['data'][5] ? 1 : 0, + 'user_management' => $other['data'][6] == '' ? $profile['user_management'] : (bool) $other['data'][6] ? 1 : 0, + 'db_management' => $other['data'][7] == '' ? $profile['db_management'] : (bool) $other['data'][7] ? 1 : 0, + 'event_view' => $other['data'][8] == '' ? $profile['event_view'] : (bool) $other['data'][8] ? 1 : 0, + 'event_edit' => $other['data'][9] == '' ? $profile['event_edit'] : (bool) $other['data'][9] ? 1 : 0, + 'event_management' => $other['data'][10] == '' ? $profile['event_management'] : (bool) $other['data'][10] ? 1 : 0, + 'report_view' => $other['data'][11] == '' ? $profile['report_view'] : (bool) $other['data'][11] ? 1 : 0, + 'report_edit' => $other['data'][12] == '' ? $profile['report_edit'] : (bool) $other['data'][12] ? 1 : 0, + 'report_management' => $other['data'][13] == '' ? $profile['report_management'] : (bool) $other['data'][13] ? 1 : 0, + 'map_view' => $other['data'][14] == '' ? $profile['map_view'] : (bool) $other['data'][14] ? 1 : 0, + 'map_edit' => $other['data'][15] == '' ? $profile['map_edit'] : (bool) $other['data'][15] ? 1 : 0, + 'map_management' => $other['data'][16] == '' ? $profile['map_management'] : (bool) $other['data'][16] ? 1 : 0, + 'vconsole_view' => $other['data'][17] == '' ? $profile['vconsole_view'] : (bool) $other['data'][17] ? 1 : 0, + 'vconsole_edit' => $other['data'][18] == '' ? $profile['vconsole_edit'] : (bool) $other['data'][18] ? 1 : 0, + 'vconsole_management' => $other['data'][19] == '' ? $profile['vconsole_management'] : (bool) $other['data'][19] ? 1 : 0, + 'pandora_management' => $other['data'][20] == '' ? $profile['pandora_management'] : (bool) $other['data'][20] ? 1 : 0, ]; $return = db_process_sql_update('tperfil', $values, ['id_perfil' => $id_profile]); @@ -11545,101 +11536,6 @@ function api_set_delete_user_profile_info($id_profile, $thrash1, $thrash2, $retu } -/** - * Create new incident in Pandora. - * - * @param $thrash1 Don't use. - * @param $thrash2 Don't use. - * @param array $other it's array, $other as param is ;<description>; - * <origin>;<priority>;<state>;<group> in this order and separator char - * (after text ; ) and separator (pass in param othermode as - * othermode=url_encode_separator_<separator>) - * example: - * - * api.php?op=set&op2=new_incident&other=titulo|descripcion%20texto|Logfiles|2|10|12&other_mode=url_encode_separator_| - * - * @param $thrash3 Don't use. - */ -function api_set_new_incident($thrash1, $thrash2, $other, $thrash3) -{ - global $config; - - if (defined('METACONSOLE')) { - return; - } - - if (!check_acl($config['id_user'], 0, 'IW')) { - returnError('forbidden', 'string'); - return; - } - - $title = $other['data'][0]; - $description = $other['data'][1]; - $origin = $other['data'][2]; - $priority = $other['data'][3]; - $id_creator = 'API'; - $state = $other['data'][4]; - $group = $other['data'][5]; - - $values = [ - 'inicio' => 'NOW()', - 'actualizacion' => 'NOW()', - 'titulo' => $title, - 'descripcion' => $description, - 'id_usuario' => 'API', - 'origen' => $origin, - 'estado' => $state, - 'prioridad' => $priority, - 'id_grupo' => $group, - 'id_creator' => $id_creator, - ]; - $idIncident = db_process_sql_insert('tincidencia', $values); - - if ($idIncident === false) { - returnError('A new incident could not be created.'); - } else { - returnData('string', ['type' => 'string', 'data' => $idIncident]); - } -} - - -/** - * Add note into a incident. - * - * @param $id string Username author of note. - * @param $id2 integer ID of incident. - * @param $other string Note. - * @param $thrash2 Don't use. - */ -function api_set_new_note_incident($id, $id2, $other, $thrash2) -{ - global $config; - - if (defined('METACONSOLE')) { - return; - } - - if (!check_acl($config['id_user'], 0, 'IW')) { - returnError('forbidden', 'string'); - return; - } - - $values = [ - 'id_usuario' => $id, - 'id_incident' => $id2, - 'nota' => $other['data'], - ]; - - $idNote = db_process_sql_insert('tnota', $values); - - if ($idNote === false) { - returnError('A new incident could not be created+.'); - } else { - returnData('string', ['type' => 'string', 'data' => $idNote]); - } -} - - /** * Disable a module, given agent and module name. * diff --git a/pandora_console/include/functions_integriaims.php b/pandora_console/include/functions_integriaims.php index fd7e1b7c7c..e7463db933 100644 --- a/pandora_console/include/functions_integriaims.php +++ b/pandora_console/include/functions_integriaims.php @@ -79,22 +79,10 @@ function integriaims_tabs($active_tab, $view=false) } $onheader = []; - - if (check_acl($config['id_user'], 0, 'IR') && $view) { - $onheader['view'] = $view_tab; - } - - if (check_acl($config['id_user'], 0, 'PM')) { - $onheader['configure'] = $setup_tab; - } - - if (check_acl($config['id_user'], 0, 'IR')) { - $onheader['list'] = $list_tab; - } - - if (check_acl($config['id_user'], 0, 'IW')) { - $onheader['create'] = $create_tab; - } + $onheader['view'] = $view_tab; + $onheader['configure'] = $setup_tab; + $onheader['list'] = $list_tab; + $onheader['create'] = $create_tab; return $onheader; } diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index 69d9a85cd5..cd31986a2a 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -120,7 +120,7 @@ function netflow_check_filter_group($id_sg) $id_group = db_get_value('id_group', 'tnetflow_filter', 'id_sg', $id_sg); $own_info = get_user_info($config['id_user']); // Get group list that user has access. - $groups_user = users_get_groups($config['id_user'], 'IW', $own_info['is_admin'], true); + $groups_user = users_get_groups($config['id_user'], 'AR', $own_info['is_admin'], true); $groups_id = []; $has_permission = false; diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index ed76a6b880..7e0a467041 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -1500,7 +1500,7 @@ function networkmap_delete_relations($id_map) function get_networkmaps($id) { - $groups = array_keys(users_get_groups(null, 'IW')); + $groups = array_keys(users_get_groups(null, 'MW')); $filter = []; $filter['id_group'] = $groups; diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php index 17e2d8baf0..6eb975eaff 100755 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -235,9 +235,6 @@ function groups_combine_acl($acl_group_a, $acl_group_b) } $acl_list = [ - 'incident_view' => 1, - 'incident_edit' => 1, - 'incident_management' => 1, 'agent_view' => 1, 'agent_edit' => 1, 'agent_disable' => 1, diff --git a/pandora_console/operation/incidents/configure_integriaims_incident.php b/pandora_console/operation/incidents/configure_integriaims_incident.php index c86fa428da..b8eceefd81 100644 --- a/pandora_console/operation/incidents/configure_integriaims_incident.php +++ b/pandora_console/operation/incidents/configure_integriaims_incident.php @@ -16,13 +16,6 @@ global $config; check_login(); -if (!(check_acl($config['id_user'], 0, 'IW') && check_acl($config['id_user'], 0, 'IR'))) { - // Doesn't have access to this page. - db_pandora_audit('ACL Violation', 'Trying to access IntegriaIMS ticket creation'); - include 'general/noaccess.php'; - exit; -} - require_once $config['homedir'].'/include/functions_integriaims.php'; $update = (isset($_GET['incident_id']) === true); diff --git a/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php b/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php index 596a336360..03f96c4a51 100644 --- a/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php +++ b/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php @@ -18,13 +18,6 @@ require_once 'include/functions_integriaims.php'; check_login(); -if (!check_acl($config['id_user'], 0, 'IR')) { - // Doesn't have access to this page. - db_pandora_audit('ACL Violation', 'Trying to access IntegriaIMS ticket creation'); - include 'general/noaccess.php'; - exit; -} - // Check if Integria integration enabled. if ($config['integria_enabled'] == 0) { ui_print_error_message(__('In order to access ticket management system, integration with Integria IMS must be enabled and properly configured')); @@ -124,10 +117,7 @@ $table_files->head[1] = __('Timestamp'); $table_files->head[2] = __('Description'); $table_files->head[3] = __('User'); $table_files->head[4] = __('Size'); - -if (check_acl($config['id_user'], 0, 'IW')) { - $table_files->head[5] = __('Delete'); -} +$table_files->head[5] = __('Delete'); $table_files->data = []; @@ -240,11 +230,10 @@ foreach ($files as $key => $value) { $table_files->data[$i][2] = $value[12]; $table_files->data[$i][3] = $value[8]; $table_files->data[$i][4] = $value[13]; - if (check_acl($config['id_user'], 0, 'IW')) { - $table_files->data[$i][5] .= '<a id="link_delete_file" href="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/dashboard_detail_integriaims_incident&incident_id='.$incident_id.'&delete_file='.$value[0]).'" - onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">'; - $table_files->data[$i][5] .= html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']); - } + $table_files->data[$i][5] .= '<a id="link_delete_file" href="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/dashboard_detail_integriaims_incident&incident_id='.$incident_id.'&delete_file='.$value[0]).'" + onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">'; + $table_files->data[$i][5] .= html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']); + $table_files->data[$i][5] .= '</a>'; @@ -267,9 +256,7 @@ $table_files_section->data[2][0] .= '<div class="w100p right">'.html_print_submi $upload_file_form = '<div class="w100p">'; -if (check_acl($config['id_user'], 0, 'IW')) { - $upload_file_form .= '<form method="post" id="file_control" enctype="multipart/form-data">'.'<h4>'.__('Add attachment').'</h4>'.html_print_table($table_files_section, true).html_print_input_hidden('upload_file', 1, true); -} +$upload_file_form .= '<form method="post" id="file_control" enctype="multipart/form-data">'.'<h4>'.__('Add attachment').'</h4>'.html_print_table($table_files_section, true).html_print_input_hidden('upload_file', 1, true); $upload_file_form .= '<h4>'.__('Attached files').'</h4>'.html_print_table($table_files, true).'</form></div>'; @@ -361,9 +348,8 @@ if (!empty($comments)) { $upload_comment_form = '<div class="w100p">'; -if (check_acl($config['id_user'], 0, 'IW')) { - $upload_comment_form .= '<form method="post" id="comment_form" enctype="multipart/form-data"><h4>'.__('Add comment').'</h4>'.html_print_table($table_comments_section, true).html_print_input_hidden('upload_comment', 1, true).'</form>'; -} +$upload_comment_form .= '<form method="post" id="comment_form" enctype="multipart/form-data"><h4>'.__('Add comment').'</h4>'.html_print_table($table_comments_section, true).html_print_input_hidden('upload_comment', 1, true).'</form>'; + $upload_comment_form .= '<h4>'.__('Comments').'</h4>'.$comment_table.'</div>'; diff --git a/pandora_console/operation/incidents/incident_statistics.php b/pandora_console/operation/incidents/incident_statistics.php index af1867264f..2aa97ad46c 100755 --- a/pandora_console/operation/incidents/incident_statistics.php +++ b/pandora_console/operation/incidents/incident_statistics.php @@ -18,11 +18,9 @@ require_once $config['homedir'].'/include/functions_graph.php'; check_login(); -if (! check_acl($config['id_user'], 0, 'IR') && ! check_acl($config['id_user'], 0, 'IW') && ! check_acl($config['id_user'], 0, 'IM')) { - db_pandora_audit('ACL Violation', 'Trying to access Incident section'); - include 'general/noaccess.php'; - exit; -} +db_pandora_audit('ACL Violation', 'Trying to access Incident section'); +require 'general/noaccess.php'; +exit; ui_print_page_header(__('Incidents').' » '.__('Statistics'), 'images/book_edit.png', false, '', false, ''); diff --git a/pandora_console/operation/incidents/integriaims_export_csv.php b/pandora_console/operation/incidents/integriaims_export_csv.php index d4be4443d6..04e0970ab4 100644 --- a/pandora_console/operation/incidents/integriaims_export_csv.php +++ b/pandora_console/operation/incidents/integriaims_export_csv.php @@ -20,14 +20,6 @@ require_once '../../include/functions_integriaims.php'; check_login(); -if (! check_acl($config['id_user'], 0, 'IR') && ! check_acl($config['id_user'], 0, 'IW') && ! check_acl($config['id_user'], 0, 'IM')) { - // Doesn't have access to this page. - db_pandora_audit('ACL Violation', 'Trying to access IntegriaIMS ticket creation'); - include 'general/noaccess.php'; - exit; -} - - // API calls. $status_incident = integriaims_get_details('status'); $group_incident = integriaims_get_details('group'); diff --git a/pandora_console/operation/incidents/list_integriaims_incidents.php b/pandora_console/operation/incidents/list_integriaims_incidents.php index c6f64750f1..eadf892b04 100644 --- a/pandora_console/operation/incidents/list_integriaims_incidents.php +++ b/pandora_console/operation/incidents/list_integriaims_incidents.php @@ -18,13 +18,6 @@ require_once 'include/functions_integriaims.php'; check_login(); -if (! check_acl($config['id_user'], 0, 'IR')) { - // Doesn't have access to this page. - db_pandora_audit('ACL Violation', 'Trying to access IntegriaIMS ticket creation'); - include 'general/noaccess.php'; - exit; -} - // Header tabs. $onheader = integriaims_tabs('list_tab'); ui_print_page_header( @@ -266,9 +259,7 @@ $table->head[4] = __('Prior'); $table->head[5] = __('Updated/Started'); $table->head[6] = __('Creator'); $table->head[7] = __('Owner'); -if (check_acl($config['id_user'], 0, 'IW') || check_acl($config['id_user'], 0, 'IM')) { - $table->head[8] = ''; -} +$table->head[8] = ''; $table->data = []; $i = 0; @@ -294,18 +285,14 @@ foreach ($incidents_paginated as $key => $value) { $table->data[$i][7] = $array_get_incidents[$key][5]; $table->data[$i][8] = ''; $table->cellclass[$i][8] = 'action_buttons'; - if (check_acl($config['id_user'], 0, 'IW')) { - $table->data[$i][8] .= '<a href="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/configure_integriaims_incident&incident_id='.$array_get_incidents[$key][0]).'">'; - $table->data[$i][8] .= html_print_image('images/config.png', true, ['title' => __('Edit')]); - $table->data[$i][8] .= '</a>'; - } + $table->data[$i][8] .= '<a href="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/configure_integriaims_incident&incident_id='.$array_get_incidents[$key][0]).'">'; + $table->data[$i][8] .= html_print_image('images/config.png', true, ['title' => __('Edit')]); + $table->data[$i][8] .= '</a>'; - if (check_acl($config['id_user'], 0, 'IM')) { - $table->data[$i][8] .= '<a id="link_delete_incident" href="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/list_integriaims_incidents&delete_incident='.$array_get_incidents[$key][0]).'" - onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">'; - $table->data[$i][8] .= html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']); - $table->data[$i][8] .= '</a>'; - } + $table->data[$i][8] .= '<a id="link_delete_incident" href="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/list_integriaims_incidents&delete_incident='.$array_get_incidents[$key][0]).'" + onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">'; + $table->data[$i][8] .= html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']); + $table->data[$i][8] .= '</a>'; $i++; } @@ -320,13 +307,11 @@ if (empty($table->data) === true) { } // Show button to create incident. -if (check_acl($config['id_user'], 0, 'IR')) { - echo '<form method="POST" action="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/configure_integriaims_incident').'">'; - echo '<div class="wi100p right">'; - html_print_submit_button(__('Create'), 'create_new_incident', false, 'class="sub next"'); - echo '</div>'; - echo '</form>'; -} +echo '<form method="POST" action="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/configure_integriaims_incident').'">'; + echo '<div class="wi100p right">'; + html_print_submit_button(__('Create'), 'create_new_incident', false, 'class="sub next"'); + echo '</div>'; +echo '</form>'; // Datapicker library for show calendar. ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/'); diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index d43829b753..11b873e0b3 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -267,9 +267,9 @@ if (check_acl($config['id_user'], 0, 'MR') || check_acl($config['id_user'], 0, ' $own_info = get_user_info($config['id_user']); if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) { - $own_groups = array_keys(users_get_groups($config['id_user'], 'IR')); + $own_groups = array_keys(users_get_groups($config['id_user'], 'MR')); } else { - $own_groups = array_keys(users_get_groups($config['id_user'], 'IR', false)); + $own_groups = array_keys(users_get_groups($config['id_user'], 'MR', false)); } foreach ($gisMaps as $gisMap) { @@ -278,10 +278,6 @@ if (check_acl($config['id_user'], 0, 'MR') || check_acl($config['id_user'], 0, ' continue; } - if (! check_acl($config['id_user'], $gisMap['group_id'], 'IR')) { - continue; - } - $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['text'] = mb_substr(io_safe_output($gisMap['map_name']), 0, 15); $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['id'] = mb_substr(io_safe_output($gisMap['map_name']), 0, 15); $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['title'] = io_safe_output($gisMap['map_name']); @@ -459,30 +455,25 @@ $sub['operation/users/user_edit_notifications']['refr'] = 0; // Incidents. -if (check_acl($config['id_user'], 0, 'IR') - || check_acl($config['id_user'], 0, 'IW') - || check_acl($config['id_user'], 0, 'IM') -) { - $temp_sec2 = $sec2; - $sec2 = 'incident'; - $sec2sub = 'operation/incidents/incident_statistics'; - $sub[$sec2]['text'] = __('Incidents'); - $sub[$sec2]['id'] = 'Incidents'; - $sub[$sec2]['type'] = 'direct'; - $sub[$sec2]['subtype'] = 'nolink'; - $sub[$sec2]['refr'] = 0; - $sub[$sec2]['subsecs'] = [ - 'operation/incidents/incident_detail', - 'operation/integria_incidents', - ]; +$temp_sec2 = $sec2; +$sec2 = 'incident'; +$sec2sub = 'operation/incidents/incident_statistics'; +$sub[$sec2]['text'] = __('Incidents'); +$sub[$sec2]['id'] = 'Incidents'; +$sub[$sec2]['type'] = 'direct'; +$sub[$sec2]['subtype'] = 'nolink'; +$sub[$sec2]['refr'] = 0; +$sub[$sec2]['subsecs'] = [ + 'operation/incidents/incident_detail', + 'operation/integria_incidents', +]; - $sub2 = []; - $sub2[$sec2sub]['text'] = __('Integria IMS statistics'); - $sub2['operation/incidents/list_integriaims_incidents']['text'] = __('Integria IMS ticket list'); +$sub2 = []; +$sub2[$sec2sub]['text'] = __('Integria IMS statistics'); +$sub2['operation/incidents/list_integriaims_incidents']['text'] = __('Integria IMS ticket list'); - $sub[$sec2]['sub2'] = $sub2; - $sec2 = $temp_sec2; -} +$sub[$sec2]['sub2'] = $sub2; +$sec2 = $temp_sec2; // Messages. diff --git a/pandora_console/operation/netflow/nf_live_view.php b/pandora_console/operation/netflow/nf_live_view.php index dae0c9457a..a27686f8a7 100644 --- a/pandora_console/operation/netflow/nf_live_view.php +++ b/pandora_console/operation/netflow/nf_live_view.php @@ -370,7 +370,7 @@ if (is_metaconsole()) { ).'</td>'; $own_info = get_user_info($config['id_user']); echo '<td><span id="filter_group_color"><b>'.__('Group').'</b></span></td>'; - echo "<td colspan='2'>".html_print_select_groups($config['id_user'], 'IW', $own_info['is_admin'], 'assign_group', $filter['id_group'], '', '', -1, true, false, false).'</td>'; + echo "<td colspan='2'>".html_print_select_groups($config['id_user'], 'AR', $own_info['is_admin'], 'assign_group', $filter['id_group'], '', '', -1, true, false, false).'</td>'; echo '</tr>'; $advanced_toggle = '<table class="w100p">'; diff --git a/pandora_console/operation/search_graphs.getdata.php b/pandora_console/operation/search_graphs.getdata.php index 9874ef37e2..13db4c2923 100644 --- a/pandora_console/operation/search_graphs.getdata.php +++ b/pandora_console/operation/search_graphs.getdata.php @@ -16,7 +16,7 @@ global $config; require_once 'include/functions_custom_graphs.php'; // Check ACL -$searchGraphs = check_acl($config['id_user'], 0, 'IR'); +$searchGraphs = check_acl($config['id_user'], 0, 'RR'); $graphs = false; diff --git a/pandora_console/operation/search_graphs.php b/pandora_console/operation/search_graphs.php index 69df4e4ded..8f76f0dea8 100755 --- a/pandora_console/operation/search_graphs.php +++ b/pandora_console/operation/search_graphs.php @@ -15,7 +15,7 @@ global $config; require_once 'include/functions_custom_graphs.php'; -$searchGraphs = check_acl($config['id_user'], 0, 'IR'); +$searchGraphs = check_acl($config['id_user'], 0, 'RR'); if ($graphs === false || !$searchGraphs) { echo "<br><div class='nf'>".__('Zero results found')."</div>\n"; diff --git a/pandora_console/operation/search_helps.php b/pandora_console/operation/search_helps.php index 2433355571..b205d265ef 100644 --- a/pandora_console/operation/search_helps.php +++ b/pandora_console/operation/search_helps.php @@ -13,8 +13,6 @@ // GNU General Public License for more details. global $config; -$totalHelps = check_acl($config['id_user'], 0, 'IR'); - if ($helps === false || !$searchHelps) { echo "<br><div class='nf'>".__('Zero results found.').sprintf( __('You can find more help in the <a class="underline" href="%s">wiki</a>'), diff --git a/pandora_console/operation/search_maps.getdata.php b/pandora_console/operation/search_maps.getdata.php index 2f8fa18a49..e96113cbb3 100644 --- a/pandora_console/operation/search_maps.getdata.php +++ b/pandora_console/operation/search_maps.getdata.php @@ -13,7 +13,7 @@ // GNU General Public License for more details. global $config; -$searchMaps = check_acl($config['id_user'], 0, 'IR'); +$searchMaps = check_acl($config['id_user'], 0, 'VR'); $maps = false; $totalMaps = 0; diff --git a/pandora_console/operation/search_maps.php b/pandora_console/operation/search_maps.php index 804051f000..0ab656d9b5 100755 --- a/pandora_console/operation/search_maps.php +++ b/pandora_console/operation/search_maps.php @@ -13,7 +13,7 @@ // GNU General Public License for more details. global $config; -$searchMaps = check_acl($config['id_user'], 0, 'IR'); +$searchMaps = check_acl($config['id_user'], 0, 'VR'); if ($maps === false || !$searchMaps) { echo "<br><div class='nf'>".__('Zero results found')."</div>\n"; diff --git a/pandora_console/operation/search_reports.php b/pandora_console/operation/search_reports.php index ee565676eb..d86b0c5446 100755 --- a/pandora_console/operation/search_reports.php +++ b/pandora_console/operation/search_reports.php @@ -19,9 +19,7 @@ require_once 'include/functions_reports.php'; $linkReport = false; $searchReports = check_acl($config['id_user'], 0, 'RR'); -if (check_acl($config['id_user'], 0, 'IW')) { - $linkReport = true; -} +$linkReport = true; if ($reports === false || !$searchReports) { echo "<br><div class='nf'>".__('Zero results found')."</div>\n"; diff --git a/pandora_console/operation/search_results.php b/pandora_console/operation/search_results.php index e1a9d078e3..5e0fa14384 100644 --- a/pandora_console/operation/search_results.php +++ b/pandora_console/operation/search_results.php @@ -19,7 +19,8 @@ enterprise_include('operation/reporting/custom_reporting.php'); $searchAgents = $searchAlerts = $searchModules = check_acl($config['id_user'], 0, 'AR'); $searchUsers = $searchPolicies = check_acl($config['id_user'], 0, 'AR'); -$searchMaps = $searchReports = $searchGraphs = check_acl($config['id_user'], 0, 'IR'); +$searchReports = $searchGraphs = check_acl($config['id_user'], 0, 'RR'); +$searchMaps = check_acl($config['id_user'], 0, 'VR'); $searchMain = true; $searchHelps = true; diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index 5442f75823..1ac05621bc 100755 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -133,10 +133,10 @@ if ($config['pure']) { // OPERATIONS -// Delete SNMP Trap entry Event (only incident management access). +// Delete SNMP Trap entry Event. if (isset($_GET['delete'])) { $id_trap = (int) get_parameter_get('delete', 0); - if ($id_trap > 0 && check_acl($config['id_user'], 0, 'IM')) { + if ($id_trap > 0) { if ($group_by) { $sql_ids_traps = 'SELECT id_trap, source FROM ttrap WHERE oid IN (SELECT oid FROM ttrap WHERE id_trap = '.$id_trap.') AND source IN (SELECT source FROM ttrap WHERE id_trap = '.$id_trap.')'; @@ -156,42 +156,30 @@ if (isset($_GET['delete'])) { __('Could not be deleted') ); } - } else { - db_pandora_audit( - 'ACL Violation', - 'Trying to delete SNMP event ID #'.$id_trap - ); } } -// Check Event (only incident write access). +// Check Event. if (isset($_GET['check'])) { $id_trap = (int) get_parameter_get('check', 0); - if (check_acl($config['id_user'], 0, 'IW')) { - $values = [ - 'status' => 1, - 'id_usuario' => $config['id_user'], - ]; - $result = db_process_sql_update('ttrap', $values, ['id_trap' => $id_trap]); - enterprise_hook('snmp_update_forwarded_modules', [$id_trap]); + $values = [ + 'status' => 1, + 'id_usuario' => $config['id_user'], + ]; + $result = db_process_sql_update('ttrap', $values, ['id_trap' => $id_trap]); + enterprise_hook('snmp_update_forwarded_modules', [$id_trap]); - ui_print_result_message( - $result, - __('Successfully updated'), - __('Could not be updated') - ); - } else { - db_pandora_audit( - 'ACL Violation', - 'Trying to checkout SNMP Trap ID'.$id_trap - ); - } + ui_print_result_message( + $result, + __('Successfully updated'), + __('Could not be updated') + ); } // Mass-process DELETE. if (isset($_POST['deletebt'])) { $trap_ids = get_parameter_post('snmptrapid', []); - if (is_array($trap_ids) && check_acl($config['id_user'], 0, 'IW')) { + if (is_array($trap_ids)) { if ($group_by) { foreach ($trap_ids as $key => $value) { $sql_ids_traps = 'SELECT id_trap, source FROM ttrap WHERE oid IN (SELECT oid FROM ttrap WHERE id_trap = '.$value.') @@ -210,28 +198,18 @@ if (isset($_POST['deletebt'])) { enterprise_hook('snmp_update_forwarded_modules', [$forward_info]); } } - } else { - db_pandora_audit( - 'ACL Violation', - 'Trying to mass-delete SNMP Trap ID' - ); } } // Mass-process UPDATE. if (isset($_POST['updatebt'])) { $trap_ids = get_parameter_post('snmptrapid', []); - if (is_array($trap_ids) && check_acl($config['id_user'], 0, 'IW')) { + if (is_array($trap_ids)) { foreach ($trap_ids as $id_trap) { $sql = sprintf("UPDATE ttrap SET status = 1, id_usuario = '%s' WHERE id_trap = %d", $config['id_user'], $id_trap); db_process_sql($sql); enterprise_hook('snmp_update_forwarded_modules', [$id_trap]); } - } else { - db_pandora_audit( - 'ACL Violation', - 'Trying to mass-delete SNMP Trap ID' - ); } } @@ -1025,7 +1003,7 @@ if ($traps !== false) { // Actions. $data[8] = ''; - if (empty($trap['status']) && check_acl($config['id_user'], 0, 'IW')) { + if (empty($trap['status'])) { $data[8] .= '<a href="'.$urlPagination.'&check='.$trap['id_trap'].'">'.html_print_image('images/ok.png', true, ['border' => '0', 'title' => __('Validate')]).'</a> '; } @@ -1045,17 +1023,15 @@ if ($traps !== false) { } else { $agent_trap_group = db_get_value('id_grupo', 'tagente', 'nombre', $trap['source']); - if ((check_acl($config['id_user'], $agent_trap_group, 'IM'))) { - $data[8] .= '<a href="'.$urlPagination.'&delete='.$trap['id_trap'].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">'.html_print_image( - 'images/cross.png', - true, - [ - 'border' => '0', - 'title' => __('Delete'), - 'class' => 'invert_filter', - ] - ).'</a> '; - } + $data[8] .= '<a href="'.$urlPagination.'&delete='.$trap['id_trap'].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">'.html_print_image( + 'images/cross.png', + true, + [ + 'border' => '0', + 'title' => __('Delete'), + 'class' => 'invert_filter', + ] + ).'</a> '; } $data[8] .= '<a href="javascript: toggleVisibleExtendedInfo('.$trap['id_trap'].');">'.html_print_image( @@ -1217,14 +1193,11 @@ if ($idx == 0) { unset($table); echo '<div class="w98p right">'; -if (check_acl($config['id_user'], 0, 'IW')) { - html_print_submit_button(__('Validate'), 'updatebt', false, 'class="sub ok"'); -} -if (check_acl($config['id_user'], 0, 'IM')) { - echo ' '; - html_print_submit_button(__('Delete'), 'deletebt', false, 'class="sub delete" onClick="javascript:return confirm(\''.__('Are you sure?').'\')"'); -} +html_print_submit_button(__('Validate'), 'updatebt', false, 'class="sub ok"'); + +echo ' '; +html_print_submit_button(__('Delete'), 'deletebt', false, 'class="sub delete" onClick="javascript:return confirm(\''.__('Are you sure?').'\')"'); echo '</div></form>'; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index b06ee1709a..59bfa1996e 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1049,9 +1049,6 @@ CREATE TABLE IF NOT EXISTS `torigen` ( CREATE TABLE IF NOT EXISTS `tperfil` ( `id_perfil` int(10) unsigned NOT NULL auto_increment, `name` TEXT NOT NULL, - `incident_edit` tinyint(1) NOT NULL DEFAULT 0, - `incident_view` tinyint(1) NOT NULL DEFAULT 0, - `incident_management` tinyint(1) NOT NULL DEFAULT 0, `agent_view` tinyint(1) NOT NULL DEFAULT 0, `agent_edit` tinyint(1) NOT NULL DEFAULT 0, `alert_edit` tinyint(1) NOT NULL DEFAULT 0, diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 49a8ea7d76..cfdced90cf 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -192,8 +192,8 @@ sub help_screen{ help_screen_line('--add_profile', '<user_name> <profile_name> <group_name>', 'Add perfil to user'); help_screen_line('--delete_profile', '<user_name> <profile_name> <group_name>', 'Delete perfil from user'); help_screen_line('--add_profile_to_user', '<user_id> <profile_name> [<group_name>]', 'Add a profile in group to a user'); - help_screen_line('--create_profile', "<profile_name> <incident_view> <incident_edit> <incident_management> <agent_view>\n\t <agent_edit> <agent_disable> <alert_edit> <alert_management> <user_management> <db_management>\n\t <event_view> <event_edit> <event_management> <report_view> <report_edit> <report_management>\n\t <map_view> <map_edit> <map_management> <vconsole_view> <vconsole_edit> <vconsole_management>\n\t <pandora_management>", 'Create profile'); - help_screen_line('--update_profile', "<profile_name> <incident_view> <incident_edit> <incident_management> <agent_view>\n\t <agent_edit> <agent_disable> <alert_edit> <alert_management> <user_management> <db_management>\n\t <event_view> <event_edit> <event_management> <report_view> <report_edit> <report_management>\n\t <map_view> <map_edit> <map_management> <vconsole_view> <vconsole_edit> <vconsole_management>\n\t <pandora_management>", 'Modify profile'); + help_screen_line('--create_profile', "<profile_name> <agent_view>\n\t <agent_edit> <agent_disable> <alert_edit> <alert_management> <user_management> <db_management>\n\t <event_view> <event_edit> <event_management> <report_view> <report_edit> <report_management>\n\t <map_view> <map_edit> <map_management> <vconsole_view> <vconsole_edit> <vconsole_management>\n\t <pandora_management>", 'Create profile'); + help_screen_line('--update_profile', "<profile_name> <agent_view>\n\t <agent_edit> <agent_disable> <alert_edit> <alert_management> <user_management> <db_management>\n\t <event_view> <event_edit> <event_management> <report_view> <report_edit> <report_management>\n\t <map_view> <map_edit> <map_management> <vconsole_view> <vconsole_edit> <vconsole_management>\n\t <pandora_management>", 'Modify profile'); help_screen_line('--disable_eacl', '', 'Disable enterprise ACL system'); help_screen_line('--enable_eacl', '', 'Enable enterprise ACL system'); help_screen_line('--disable_double_auth', '<user_name>', 'Disable the double authentication for the specified user'); @@ -563,14 +563,14 @@ sub pandora_create_user_profile ($$$$) { ########################################################################## ## Create profile. ########################################################################## -sub pandora_create_profile ($$$$$$$$$$$$$$$$$$$$$$$$$) { - my ($dbh, $profile_name, $incident_view,$incident_edit, $incident_management, $agent_view, +sub pandora_create_profile ($$$$$$$$$$$$$$$$$$$$$$) { + my ($dbh, $profile_name, $agent_view, $agent_edit, $agent_disable, $alert_edit, $alert_management, $user_management, $db_management, $event_view, $event_edit, $event_management, $report_view, $report_edit, $report_management, $map_view, $map_edit, $map_management, $vconsole_view, $vconsole_edit, $vconsole_management, $pandora_management) = @_; - return db_insert ($dbh, 'id_up', 'INSERT INTO tperfil (name,incident_view,incident_edit,incident_management,agent_view,agent_edit,agent_disable,alert_edit,alert_management,user_management,db_management,event_view,event_edit,event_management,report_view,report_edit,report_management,map_view,map_edit,map_management,vconsole_view,vconsole_edit,vconsole_management,pandora_management) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);', - safe_input($profile_name), $incident_view,$incident_edit, $incident_management, $agent_view, + return db_insert ($dbh, 'id_up', 'INSERT INTO tperfil (name,agent_view,agent_edit,agent_disable,alert_edit,alert_management,user_management,db_management,event_view,event_edit,event_management,report_view,report_edit,report_management,map_view,map_edit,map_management,vconsole_view,vconsole_edit,vconsole_management,pandora_management) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);', + safe_input($profile_name), $agent_view, $agent_edit, $agent_disable, $alert_edit, $alert_management, $user_management, $db_management, $event_view, $event_edit, $event_management, $report_view, $report_edit, $report_management, $map_view, $map_edit, $map_management, $vconsole_view, $vconsole_edit, $vconsole_management, $pandora_management); @@ -579,14 +579,14 @@ sub pandora_create_profile ($$$$$$$$$$$$$$$$$$$$$$$$$) { ########################################################################## #### Update profile. ########################################################################### -sub pandora_update_profile ($$$$$$$$$$$$$$$$$$$$$$$$$) { - my ($dbh, $profile_name, $incident_view,$incident_edit, $incident_management, $agent_view, +sub pandora_update_profile ($$$$$$$$$$$$$$$$$$$$$$) { + my ($dbh, $profile_name, $agent_view, $agent_edit, $agent_disable, $alert_edit, $alert_management, $user_management, $db_management, $event_view, $event_edit, $event_management, $report_view, $report_edit, $report_management, $map_view, $map_edit, $map_management, $vconsole_view, $vconsole_edit, $vconsole_management, $pandora_management) = @_; - return db_update ($dbh, 'UPDATE tperfil SET incident_view = ?, incident_edit = ?, incident_management = ?, agent_view = ?, agent_edit = ?, agent_disable = ?, alert_edit = ?, alert_management = ?, user_management = ?, db_management = ?, event_view = ?, event_edit = ?, event_management = ?, report_view = ?, report_edit = ?, report_management = ?, map_view = ?, map_edit = ?, map_management = ?, vconsole_view = ?, vconsole_edit = ?, vconsole_management = ?, pandora_management = ? WHERE name=?;', - $incident_view,$incident_edit, $incident_management, $agent_view, + return db_update ($dbh, 'UPDATE tperfil SET agent_view = ?, agent_edit = ?, agent_disable = ?, alert_edit = ?, alert_management = ?, user_management = ?, db_management = ?, event_view = ?, event_edit = ?, event_management = ?, report_view = ?, report_edit = ?, report_management = ?, map_view = ?, map_edit = ?, map_management = ?, vconsole_view = ?, vconsole_edit = ?, vconsole_management = ?, pandora_management = ? WHERE name=?;', + $agent_view, $agent_edit, $agent_disable, $alert_edit, $alert_management, $user_management, $db_management, $event_view, $event_edit, $event_management, $report_view, $report_edit, $report_management, $map_view, $map_edit, $map_management, $vconsole_view, $vconsole_edit, $vconsole_management, $pandora_management, safe_input($profile_name)); @@ -4008,7 +4008,7 @@ sub cli_add_profile() { ############################################################################## sub cli_create_profile() { - my ($profile_name,$incident_view,$incident_edit,$incident_management,$agent_view, + my ($profile_name,$agent_view, $agent_edit,$agent_disable,$alert_edit,$alert_management,$user_management,$db_management, $event_view,$event_edit,$event_management,$report_view,$report_edit,$report_management, $map_view,$map_edit,$map_management,$vconsole_view,$vconsole_edit,$vconsole_management,$pandora_management) = @ARGV[2..25]; @@ -4016,7 +4016,7 @@ sub cli_create_profile() { my $id_profile = get_profile_id($dbh,$profile_name); non_exist_check($id_profile,'profile',$profile_name); - pandora_create_profile ($dbh, $profile_name, $incident_view, $incident_edit, $incident_management, $agent_view, + pandora_create_profile ($dbh, $profile_name, $agent_view, $agent_edit, $agent_disable, $alert_edit, $alert_management, $user_management, $db_management, $event_view, $event_edit, $event_management, $report_view, $report_edit, $report_management, $map_view, $map_edit, $map_management, $vconsole_view, $vconsole_edit, $vconsole_management, $pandora_management); @@ -4028,7 +4028,7 @@ sub cli_create_profile() { ############################################################################## # sub cli_update_profile() { - my ($profile_name,$incident_view,$incident_edit,$incident_management,$agent_view, + my ($profile_name,$agent_view, $agent_edit,$agent_disable,$alert_edit,$alert_management,$user_management,$db_management, $event_view,$event_edit,$event_management,$report_view,$report_edit,$report_management, $map_view,$map_edit,$map_management,$vconsole_view,$vconsole_edit,$vconsole_management,$pandora_management) = @ARGV[2..25]; @@ -4036,7 +4036,7 @@ sub cli_update_profile() { my $id_profile = get_profile_id($dbh,$profile_name); exist_check($id_profile,'profile',$profile_name); - pandora_update_profile ($dbh, $profile_name, $incident_view, $incident_edit, $incident_management, $agent_view, + pandora_update_profile ($dbh, $profile_name, $agent_view, $agent_edit, $agent_disable, $alert_edit, $alert_management, $user_management, $db_management, $event_view, $event_edit, $event_management, $report_view, $report_edit, $report_management, $map_view, $map_edit, $map_management, $vconsole_view, $vconsole_edit, $vconsole_management, $pandora_management); From 172afc907093b555041af5f42bcf65882128b75c Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" <alejandro.campos@artica.es> Date: Thu, 13 May 2021 13:40:09 +0200 Subject: [PATCH 36/50] minor change --- .../incidents/dashboard_detail_integriaims_incident.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php b/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php index 03f96c4a51..9229ffdd90 100644 --- a/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php +++ b/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php @@ -149,7 +149,7 @@ if ($upload_file && ($_FILES['userfile']['name'] != '')) { $filecontent = base64_encode(file_get_contents($_FILES['userfile']['tmp_name'])); - $result_api_call = integria_api_call(null, null, null, null, 'attach_file', [$incident_id, $filename, $filesize, $filedescription, $filecontent], false, '', ';'); + $result_api_call = integria_api_call(null, null, null, null, 'attach_file', [$incident_id, $filename, $filesize, $filedescription, $filecontent], false, '', '|;|'); // API method returns '0' string if success. $file_added = ($result_api_call === '0') ? true : false; From b52f971262921e7b6315c47388a82a9dbc56764a Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" <alejandro.campos@artica.es> Date: Thu, 13 May 2021 14:06:54 +0200 Subject: [PATCH 37/50] minor change --- pandora_console/pandoradb_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 6fe259d898..ab44483301 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -364,7 +364,7 @@ INSERT INTO `tusuario_perfil` (`id_up`, `id_usuario`, `id_perfil`, `id_grupo`, ` -- Dumping data for table `tperfil` -- -INSERT INTO `tperfil` VALUES (1,'Operator (Read)',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0),(2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0),(3,'Chief Operator',1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1),(4,'Group coordinator',1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1),(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +INSERT INTO `tperfil` VALUES (1,'Operator (Read)',1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0),(2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0),(3,'Chief Operator',1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1),(4,'Group coordinator',1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1),(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); -- -- Dumping data for table `tnews` From 1a194e16445b1c39c43fc7b008b0b052f7b87e74 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" <alejandro.campos@artica.es> Date: Thu, 13 May 2021 14:10:42 +0200 Subject: [PATCH 38/50] minor change --- pandora_console/pandoradb_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index ab44483301..b1d5f860c7 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -364,7 +364,7 @@ INSERT INTO `tusuario_perfil` (`id_up`, `id_usuario`, `id_perfil`, `id_grupo`, ` -- Dumping data for table `tperfil` -- -INSERT INTO `tperfil` VALUES (1,'Operator (Read)',1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0),(2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0),(3,'Chief Operator',1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1),(4,'Group coordinator',1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1),(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +INSERT INTO `tperfil` VALUES (1,'Operator (Read)',1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0),(2,'Operator (Write)',1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0),(3,'Chief Operator',1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1),(4,'Group coordinator',1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1),(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); -- -- Dumping data for table `tnews` From 9b6ad55910f8b3ae718d4260adfde7a85017452c Mon Sep 17 00:00:00 2001 From: artica <artica.devel@gmail.com> Date: Fri, 14 May 2021 01:00:47 +0200 Subject: [PATCH 39/50] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 36e53ecea4..01fafa553e 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.754-210513 +Version: 7.0NG.754-210514 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 cf86004742..7fb8d51adc 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.754-210513" +pandora_version="7.0NG.754-210514" 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 248f0fd4a1..441e9b0496 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.754'; -use constant AGENT_BUILD => '210513'; +use constant AGENT_BUILD => '210514'; # 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 2e51763325..99c3b449e5 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.754 -%define release 210513 +%define release 210514 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 7e85bcba76..e3ea9593d0 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.754 -%define release 210513 +%define release 210514 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 99f7f5d086..276b308087 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210513" +PI_BUILD="210514" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index d1cb263733..14ef458a10 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210513} +{210514} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 57c368a773..03abdb96a4 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.754 Build 210513") +#define PANDORA_VERSION ("7.0NG.754 Build 210514") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 895e32ceb8..3ecc3bff66 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.754(Build 210513))" + VALUE "ProductVersion", "(7.0NG.754(Build 210514))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index f0bb243dba..b1cdcf4850 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.754-210513 +Version: 7.0NG.754-210514 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 0c82e3b4f4..492d4cfec2 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.754-210513" +pandora_version="7.0NG.754-210514" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ac57a8e236..0ec89a7e8f 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 = 'PC210513'; +$build_version = 'PC210514'; $pandora_version = 'v7.0NG.754'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 579f810b12..c96c65c78f 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@ <div style='height: 10px'> <?php $version = '7.0NG.754'; - $build = '210513'; + $build = '210514'; $banner = "v$version Build $build"; error_reporting(0); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index b5e1e63fcf..ae6176b379 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.754 -%define release 210513 +%define release 210514 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index bc1637ef98..09debf1a96 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210513 +%define release 210514 # 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 49e0304ef8..41ad228608 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.754 -%define release 210513 +%define release 210514 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index ea23fcb54b..d792b4067b 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.754-210513 +Version: 7.0NG.754-210514 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 1d3514d6c0..96f88059d8 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.754-210513" +pandora_version="7.0NG.754-210514" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index cf8e4bc2e7..6a48f15bcd 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.754"; -my $pandora_build = "210513"; +my $pandora_build = "210514"; 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 4e20c5e69f..81c19aaa84 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.754"; -my $pandora_build = "210513"; +my $pandora_build = "210514"; 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 8a8cfd64fa..4c54bfacd2 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.754 -%define release 210513 +%define release 210514 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 36504c200e..a6e31ca539 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.754 -%define release 210513 +%define release 210514 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 34be4a360a..f711a776d2 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210513" +PI_BUILD="210514" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 83a9dfdec9..7015a1e57f 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.754 Build 210513"; +my $version = "7.0NG.754 Build 210514"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 0d8a97ae19..a9fcbc9b2e 100755 --- 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.754 Build 210513"; +my $version = "7.0NG.754 Build 210514"; # save program name for logging my $progname = basename($0); From 86447e2a0ba58a92c0e2d66f83507d9dfefe0841 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" <alejandro.campos@artica.es> Date: Fri, 14 May 2021 10:10:42 +0200 Subject: [PATCH 40/50] visual fix --- .../agentes/interface_view.functions.php | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/pandora_console/operation/agentes/interface_view.functions.php b/pandora_console/operation/agentes/interface_view.functions.php index df0371c8fe..03070dd4d6 100644 --- a/pandora_console/operation/agentes/interface_view.functions.php +++ b/pandora_console/operation/agentes/interface_view.functions.php @@ -106,14 +106,6 @@ function print_filters($sec) 'min-width: 180px; max-width: 200px;' ); - $table->data[2][4] = html_print_submit_button( - __('Show'), - 'uptbutton', - false, - 'class="sub search mgn_tp_0"', - true - ); - $filters = '<form method="post" action="'.ui_get_url_refresh( [ 'selected_agents' => $selected_agents, @@ -123,6 +115,15 @@ function print_filters($sec) ).'">'; $filters .= html_print_table($table, true); + + $filters .= "<div class='height_100p right'>".html_print_submit_button( + __('Show'), + 'uptbutton', + false, + 'class="sub search mgn_tp_0"', + true + ).'</div>'; + $filters .= '</form>'; } else { $table->style[0] = 'font-weight: bold;'; @@ -143,14 +144,6 @@ function print_filters($sec) 'min-width: 180px; max-width: 200px;' ); - $table->data[1][1] = html_print_submit_button( - __('Show'), - 'uptbutton', - false, - 'class="sub search mgn_tp_0"', - true - ); - $filters = '<form method="post" action="'.ui_get_url_refresh( [ 'selected_agents' => $selected_agents, @@ -169,6 +162,7 @@ function print_filters($sec) __('Interface filter'), 'ui_toggle_if_filter' ); + unset($table); } From 2c065d6f383d77343da8dc266233e53834ffb6e4 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" <alejandro.campos@artica.es> Date: Fri, 14 May 2021 10:14:53 +0200 Subject: [PATCH 41/50] visual fix --- .../operation/agentes/interface_view.functions.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandora_console/operation/agentes/interface_view.functions.php b/pandora_console/operation/agentes/interface_view.functions.php index 03070dd4d6..d94c56bd22 100644 --- a/pandora_console/operation/agentes/interface_view.functions.php +++ b/pandora_console/operation/agentes/interface_view.functions.php @@ -153,6 +153,15 @@ function print_filters($sec) ).'">'; $filters .= html_print_table($table, true); + + $filters .= "<div class='height_100p right'>".html_print_submit_button( + __('Show'), + 'uptbutton', + false, + 'class="sub search mgn_tp_0"', + true + ).'</div>'; + $filters .= '</form>'; } From 998fb4b0dcbb1d326dabdb52848b5ce5ca4622b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Gonz=C3=A1lez?= <jose.gonzalez@pandorafms.com> Date: Fri, 14 May 2021 11:22:32 +0200 Subject: [PATCH 42/50] Fixed issue with undesired deactivate dynamic threshold max field --- .../agentes/module_manager_editor_common.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 1a4577c4ee..bda1aaa2b5 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -1574,10 +1574,6 @@ $(document).ready (function () { }); disabled_two_tailed(disabledBecauseInPolicy); - $('#checkbox-dynamic_two_tailed').change (function() { - disabled_two_tailed(disabledBecauseInPolicy); - }); - //Dynamic_options_advance; $('.hide_dinamic').hide(); @@ -1646,15 +1642,10 @@ function disabled_status (disabledBecauseInPolicy) { } function disabled_two_tailed (disabledBecauseInPolicy) { - if($('#checkbox-dynamic_two_tailed').prop('checked')){ - $('#text-dynamic_max').prop('readonly', false); - $('#text-dynamic_max').removeClass('readonly'); - } - else{ - if (disabledBecauseInPolicy == 0){ - $('#text-dynamic_max').prop('readonly', true); - $('#text-dynamic_max').addClass('readonly'); - } + if (disabledBecauseInPolicy == 1){ + $('#text-dynamic_max') + .prop('readonly', true) + .addClass('readonly'); } } From 9cde3092227a6f0b2d1cfae628eb3ae3f311a400 Mon Sep 17 00:00:00 2001 From: marcos <marcos.alconada@artica.es> Date: Fri, 14 May 2021 11:58:08 +0200 Subject: [PATCH 43/50] new bell orange --- pandora_console/images/bell_green.png | Bin 392 -> 548 bytes pandora_console/images/bell_orange.png | Bin 432 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/pandora_console/images/bell_green.png b/pandora_console/images/bell_green.png index b8069e77542afba3d5de31cd978f9988dac5b095..44fb033d010bac80a62e4516f597a977532e78c1 100644 GIT binary patch delta 531 zcmeBRUcxd#rk+vNChrde0|QICqpu?a!^VE@KZ&eBzC~(;XPU1sgBFm@!NAy_$-n|+ zF#@p^5Hm0^EntF+2rOWRvxPvCxv>l@fQqMkx;Tbd2u=;M^=5VysI3-M?5%eY$x&J+ z9DPvFgNs{Ql(k-(o7M5PikHF>ubiBmtpOrIoj=T36w4?1c?WX{Dtn&!nKs!rfAVDI z%V%br&$r&ppc;R)S@{6_CaDg=j#HsWg@sft5=86fG_^lfIN+{yfNjO1?vT^Ry9LxU zHJ1D4?pf4+n`3tIN1Z5_?V=OP3*Y{}A)sS4&t;QEbH1&$vESi(Kh6x(iz2!FdOjY< z8hQ?2`mK1bNw&4i^~58crnbDoZ*3`i8}%QnR7U$H$L83k{1xVXEOPemI?-$o?su^Y zNu6)``2I7o@N%qP(o)oyHADWxS08zArbXp<&j;{rlkxj=ar@#cOI%NdbI5zmsp1b4 z>22!1s<+|n_jNB6TC0~9)Q8S;ZN2p?HH>lI(>d;cznkomC^)G4e&(`+{?96`3r|iu z@@@B@6YS2c7N?pNAD3J|zNnK^E#c`J#m6SIQ{Vl%ew}s4O=&gX<Em2j^Q}HUc^H^; zRR7nhcfrRjCxunWYuahuuu8U2c%L{~TfguQOMZRKyu+zC@;~S&eJEbhmR?oK1BxzB LS3j3^P6<r_x2VoA delta 373 zcmV-*0gC>l1c(EW9De{(J6>u4000DMK}|sb0I`n?{9y$E00BQqL_t(I5sgzpPQx$| z+}%`2RHEt+pl3kj3Ay$}`9XOJ<^_lsG(YGG^;mcTNL;v)CsaLvR3tB6g>^S6ZWGD! z?99$Ow$}iAKDW3iWb8=+N{Mc9IVGZ{48f^9YzuCFHl*W|2Y*0pnwU$^Klg6@QCUx; zfS9pA_zdLGCMjls6@RTq?xtEP*VsZ>d7d(hK{Uxx^B-4-?&&<IUiNCm6!v~I(yhcl zpe!p=hBi-lG*K=V@W7`^9-5iAXA}zrkRLLtj>uPvV*w>P&heIF0cL#ZXa<`b3xuA$ z?pk1H3(~6Lj&3`jLFm$nwl~&2kF&0;+dS|2HY~jR$qPiF!YT}0x$%2xIl;X)Au%E4 zp>OZ3h78XkE-fc`dx%Ey-|I3woHs*(M|iZc;(xawV*RWKQ|UT}O{u-FMxB2FNEui! Tr3I$V00000NkvXXu0mjf9c80H diff --git a/pandora_console/images/bell_orange.png b/pandora_console/images/bell_orange.png index e54f00a367d855eb5c6e1d2ec80e02ba4653f018..b166c3b54d5802239d865c185e8720957a6eead4 100644 GIT binary patch literal 566 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRp!N$PAsA`k<2gqSbcl32+VA$Bt{U?zX$hSz1 z@J#ddWzYh$IT#q*GZ|QbEJh%f0%8URrUguJ5rGBFaJCRgGB=iC1yJ!yPZ!4!3&FX; zw%*K+0(WnoR$X$zK4FVbqWZR`*a;$HO)E5RL}+kul?&#&2;}(W<m7A(5NT@d*njZW zDZe8Q2i!P*l-}zzu6~!Q-#N$P=(|1U`RQfp<*f?Ab<d(UHEW!@l_((H633Q&gzrN_ z1k=JJUU^NPW|yocruQ~P?_BhY=l#s$tat@Oj_*2+FZ2!vKHXjJw)C_Shwb+%ug=VD zc%%I!@%h8p_qJ<xgj%0ax>{BB*m7f`TF&IY;7KobuQtp4z2eZW-qOcHER3;C{9Kh+ zGxlw3E_ipPDe_q0a_O^S)+gl7EtoEwrZ4m*V-ZtKKkJ(ksjGTM>V=nOU-B5a9Vwhw z{e6~l%B6|ilY;iTY&hPLrEu_5@CN;^=3V@pqKsCLM7Xwk_@@MQJH#-a5)S;kg4yBG zR8^stebpYj|9{OYQRH+#SGOUl>zKZz_Pd~0NpVXHW^T!j<(wk0xXoww%A?6{!tWdW z!pu@$^(<-;zx<2)B}>US<5N~sc71Snh<$VX_G#(11vcLWS^55zZd}VOaNg|S^!Yp7 steNvto(DeEE9Co{E}eC7qpbNqbJpC6!D+{f)j*Nw>FVdQ&MBb@09a<+Z2$lO literal 432 zcmV;h0Z;ykP)<h;3K|Lk000e1NJLTq000*N000*V1^@s7mo4Nr0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUzQb|NXRCwBAU_b(lAmZmH<NqL<30Vdp zfG`nE86%MK9!LuSaUwtfA<G)TRG=Gn9$7n9GeH0#fCwXyY9PLkVh55D3P5%PE}zsB z;YEmX?}7L{j1Le%_!Kr^6K6zI<N&1hqbp+fJIjbIq!_R%hB*tD23$Y@tCNsS+>hiO zM+Qm&KmbvWfX*oZVg+<@CLHeW2jctaallAK+L{3LY$1xt*sO(u0&LDmAmkS&Qap~V zn4gehSbjBt<tkhNl)xCV1RW^Y44~YFKt&5+ax7R3nFtDFC_9ksm<0$hnj%IL(ibS+ z=0mv`fPOcm$Z#|Rae)g!><F~%1JQ;<6SxBjp`Zw~-~quD2z9Xoi9tM{*yOE1M*KNY zly^u4*a{O+DVa}ZiIsq_@F_qpf++wCK#|Kxq>JX`D4z;}hD@MFCQ^U~7pM@~2zA{D ae0l&BD0uNljDjTq0000<MNUMnLSTX_DxEk0 From bfc805d6a7ab004ad5a6f9072359ca1ad9fa6c49 Mon Sep 17 00:00:00 2001 From: artica <artica.devel@gmail.com> Date: Sat, 15 May 2021 01:00:46 +0200 Subject: [PATCH 44/50] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 01fafa553e..4c3f3086ae 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.754-210514 +Version: 7.0NG.754-210515 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 7fb8d51adc..a7e945bb61 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.754-210514" +pandora_version="7.0NG.754-210515" 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 441e9b0496..5966c66855 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.754'; -use constant AGENT_BUILD => '210514'; +use constant AGENT_BUILD => '210515'; # 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 99c3b449e5..65aca49c84 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.754 -%define release 210514 +%define release 210515 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 e3ea9593d0..c18fa4399f 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.754 -%define release 210514 +%define release 210515 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 276b308087..f80e3c9067 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210514" +PI_BUILD="210515" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 14ef458a10..fb5113043e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210514} +{210515} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 03abdb96a4..1419402db4 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.754 Build 210514") +#define PANDORA_VERSION ("7.0NG.754 Build 210515") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 3ecc3bff66..5c0033c34a 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.754(Build 210514))" + VALUE "ProductVersion", "(7.0NG.754(Build 210515))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index b1cdcf4850..d77a5581f7 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.754-210514 +Version: 7.0NG.754-210515 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 492d4cfec2..c81c266455 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.754-210514" +pandora_version="7.0NG.754-210515" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 0ec89a7e8f..594bc788fe 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 = 'PC210514'; +$build_version = 'PC210515'; $pandora_version = 'v7.0NG.754'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index c96c65c78f..34c6fa723a 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@ <div style='height: 10px'> <?php $version = '7.0NG.754'; - $build = '210514'; + $build = '210515'; $banner = "v$version Build $build"; error_reporting(0); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index ae6176b379..19f32d65ec 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.754 -%define release 210514 +%define release 210515 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index 09debf1a96..97b524e30a 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210514 +%define release 210515 # 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 41ad228608..5ed4681858 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.754 -%define release 210514 +%define release 210515 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index d792b4067b..085e63b280 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.754-210514 +Version: 7.0NG.754-210515 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 96f88059d8..43fe8552aa 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.754-210514" +pandora_version="7.0NG.754-210515" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 6a48f15bcd..095bf4b85c 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.754"; -my $pandora_build = "210514"; +my $pandora_build = "210515"; 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 81c19aaa84..48fb311e57 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.754"; -my $pandora_build = "210514"; +my $pandora_build = "210515"; 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 4c54bfacd2..db4b5f7997 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.754 -%define release 210514 +%define release 210515 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a6e31ca539..8627610800 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.754 -%define release 210514 +%define release 210515 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index f711a776d2..43d537772b 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210514" +PI_BUILD="210515" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 7015a1e57f..fc6f794cb5 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.754 Build 210514"; +my $version = "7.0NG.754 Build 210515"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index a9fcbc9b2e..329ed17771 100755 --- 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.754 Build 210514"; +my $version = "7.0NG.754 Build 210515"; # save program name for logging my $progname = basename($0); From 8c0461e2bff19af990da4072626d0e4e549a976b Mon Sep 17 00:00:00 2001 From: artica <artica.devel@gmail.com> Date: Sun, 16 May 2021 01:00:26 +0200 Subject: [PATCH 45/50] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 4c3f3086ae..7bb67c841b 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.754-210515 +Version: 7.0NG.754-210516 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 a7e945bb61..3bc5643e9d 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.754-210515" +pandora_version="7.0NG.754-210516" 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 5966c66855..84814fca7e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.754'; -use constant AGENT_BUILD => '210515'; +use constant AGENT_BUILD => '210516'; # 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 65aca49c84..19bcb31363 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.754 -%define release 210515 +%define release 210516 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 c18fa4399f..a06164cb6d 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.754 -%define release 210515 +%define release 210516 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 f80e3c9067..892dc125bd 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210515" +PI_BUILD="210516" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index fb5113043e..e2ff439c3b 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210515} +{210516} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 1419402db4..53e59b24d9 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.754 Build 210515") +#define PANDORA_VERSION ("7.0NG.754 Build 210516") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 5c0033c34a..c00928c3ba 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.754(Build 210515))" + VALUE "ProductVersion", "(7.0NG.754(Build 210516))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d77a5581f7..c01ed23ee9 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.754-210515 +Version: 7.0NG.754-210516 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 c81c266455..e74527610d 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.754-210515" +pandora_version="7.0NG.754-210516" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 594bc788fe..d807791fbe 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 = 'PC210515'; +$build_version = 'PC210516'; $pandora_version = 'v7.0NG.754'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 34c6fa723a..3b491307d2 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@ <div style='height: 10px'> <?php $version = '7.0NG.754'; - $build = '210515'; + $build = '210516'; $banner = "v$version Build $build"; error_reporting(0); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 19f32d65ec..3af4fb4389 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.754 -%define release 210515 +%define release 210516 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index 97b524e30a..a6911309f9 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210515 +%define release 210516 # 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 5ed4681858..5e8c89346d 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.754 -%define release 210515 +%define release 210516 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 085e63b280..f639cbae78 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.754-210515 +Version: 7.0NG.754-210516 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 43fe8552aa..f68654c43b 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.754-210515" +pandora_version="7.0NG.754-210516" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 095bf4b85c..d0218b9c91 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.754"; -my $pandora_build = "210515"; +my $pandora_build = "210516"; 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 48fb311e57..c5953f7906 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.754"; -my $pandora_build = "210515"; +my $pandora_build = "210516"; 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 db4b5f7997..b6606a8f67 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.754 -%define release 210515 +%define release 210516 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 8627610800..81bf328181 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.754 -%define release 210515 +%define release 210516 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 43d537772b..c6f5bbc54b 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210515" +PI_BUILD="210516" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index fc6f794cb5..27c734c99c 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.754 Build 210515"; +my $version = "7.0NG.754 Build 210516"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 329ed17771..471c85f282 100755 --- 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.754 Build 210515"; +my $version = "7.0NG.754 Build 210516"; # save program name for logging my $progname = basename($0); From d2fd310ea2881590db8e706bb381db1eabd7e9fb Mon Sep 17 00:00:00 2001 From: artica <artica.devel@gmail.com> Date: Mon, 17 May 2021 01:00:38 +0200 Subject: [PATCH 46/50] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 7bb67c841b..8526580f7d 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.754-210516 +Version: 7.0NG.754-210517 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 3bc5643e9d..2ae95a0f02 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.754-210516" +pandora_version="7.0NG.754-210517" 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 84814fca7e..d74f7c37e9 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.754'; -use constant AGENT_BUILD => '210516'; +use constant AGENT_BUILD => '210517'; # 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 19bcb31363..14b1d09bf0 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.754 -%define release 210516 +%define release 210517 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 a06164cb6d..957c253e0f 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.754 -%define release 210516 +%define release 210517 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 892dc125bd..cca2a47bd1 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210516" +PI_BUILD="210517" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index e2ff439c3b..a6fcc0802a 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210516} +{210517} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 53e59b24d9..1d367ca6a6 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.754 Build 210516") +#define PANDORA_VERSION ("7.0NG.754 Build 210517") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index c00928c3ba..a0dc952613 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.754(Build 210516))" + VALUE "ProductVersion", "(7.0NG.754(Build 210517))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c01ed23ee9..4afac2847f 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.754-210516 +Version: 7.0NG.754-210517 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 e74527610d..3f1b5cfa31 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.754-210516" +pandora_version="7.0NG.754-210517" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d807791fbe..3fd4d471b9 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 = 'PC210516'; +$build_version = 'PC210517'; $pandora_version = 'v7.0NG.754'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 3b491307d2..73d132a3f7 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@ <div style='height: 10px'> <?php $version = '7.0NG.754'; - $build = '210516'; + $build = '210517'; $banner = "v$version Build $build"; error_reporting(0); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 3af4fb4389..d2c596106c 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.754 -%define release 210516 +%define release 210517 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index a6911309f9..f0a62efb0d 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210516 +%define release 210517 # 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 5e8c89346d..64fc3e3794 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.754 -%define release 210516 +%define release 210517 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index f639cbae78..e53d5f98c6 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.754-210516 +Version: 7.0NG.754-210517 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 f68654c43b..7bb9925819 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.754-210516" +pandora_version="7.0NG.754-210517" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index d0218b9c91..80bd480d8f 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.754"; -my $pandora_build = "210516"; +my $pandora_build = "210517"; 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 c5953f7906..f392deca89 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.754"; -my $pandora_build = "210516"; +my $pandora_build = "210517"; 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 b6606a8f67..b3d8e73508 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.754 -%define release 210516 +%define release 210517 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 81bf328181..689812cb20 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.754 -%define release 210516 +%define release 210517 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index c6f5bbc54b..14339f5490 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210516" +PI_BUILD="210517" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 27c734c99c..1c70abef74 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.754 Build 210516"; +my $version = "7.0NG.754 Build 210517"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 471c85f282..1f5c6c9c04 100755 --- 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.754 Build 210516"; +my $version = "7.0NG.754 Build 210517"; # save program name for logging my $progname = basename($0); From 663d1dcf75e70f96bbc465d9151bf0265a2bdadb Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" <alejandro.campos@artica.es> Date: Mon, 17 May 2021 13:43:20 +0200 Subject: [PATCH 47/50] minor fix --- pandora_console/operation/incidents/incident_statistics.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pandora_console/operation/incidents/incident_statistics.php b/pandora_console/operation/incidents/incident_statistics.php index 2aa97ad46c..b4966c1b96 100755 --- a/pandora_console/operation/incidents/incident_statistics.php +++ b/pandora_console/operation/incidents/incident_statistics.php @@ -18,10 +18,6 @@ require_once $config['homedir'].'/include/functions_graph.php'; check_login(); -db_pandora_audit('ACL Violation', 'Trying to access Incident section'); -require 'general/noaccess.php'; -exit; - ui_print_page_header(__('Incidents').' » '.__('Statistics'), 'images/book_edit.png', false, '', false, ''); if (!$config['integria_enabled']) { From fd372d53d1282bae53fb93bb81178b096b331ed1 Mon Sep 17 00:00:00 2001 From: Daniel Maya <daniel.maya@artica.es> Date: Mon, 17 May 2021 13:00:59 +0000 Subject: [PATCH 48/50] Ent 6978 umbrales inversos fallan --- pandora_server/lib/PandoraFMS/Core.pm | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index a384d3701e..bbce7913e9 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4652,11 +4652,17 @@ sub get_module_status ($$$) { } # (-inf, critical_min), [critical_max, +inf) else { - return 1 if ($data < $critical_min || $data >= $critical_max); - return 1 if ($data <= $critical_max && $critical_max < $critical_min); + if ($critical_min == 0) { + return 1 if ($data > $critical_max); + }elsif ($critical_max == 0) { + return 1 if ($data <= $critical_min); + } else { + return 1 if ($data < $critical_min || $data >= $critical_max); + return 1 if ($data <= $critical_max && $critical_max < $critical_min); + } } } - + # Warning if ($warning_min ne $warning_max) { # [warning_min, warning_max) @@ -4666,8 +4672,14 @@ sub get_module_status ($$$) { } # (-inf, warning_min), [warning_max, +inf) else { - return 2 if ($data < $warning_min || $data >= $warning_max); - return 2 if ($data <= $warning_max && $warning_max < $warning_min); + if ($warning_min == 0) { + return 1 if ($data > $warning_max); + }elsif ($warning_max == 0) { + return 1 if ($data <= $warning_min); + } else { + return 2 if ($data < $warning_min || $data >= $warning_max); + return 2 if ($data <= $warning_max && $warning_max < $warning_min); + } } } } From 739bc7ebd91cfd034f45aa6632ddebfeda4258ed Mon Sep 17 00:00:00 2001 From: artica <artica.devel@gmail.com> Date: Tue, 18 May 2021 01:00:45 +0200 Subject: [PATCH 49/50] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8526580f7d..fc93b3de67 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.754-210517 +Version: 7.0NG.754-210518 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 2ae95a0f02..c037fa86d9 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.754-210517" +pandora_version="7.0NG.754-210518" 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 930dc04624..150ef4a51f 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.754'; -use constant AGENT_BUILD => '210517'; +use constant AGENT_BUILD => '210518'; # 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 14b1d09bf0..f64a53debe 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.754 -%define release 210517 +%define release 210518 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 957c253e0f..f631031700 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.754 -%define release 210517 +%define release 210518 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 cca2a47bd1..5775fff708 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210517" +PI_BUILD="210518" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index a6fcc0802a..06927012e5 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210517} +{210518} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 1d367ca6a6..bfad64aa62 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.754 Build 210517") +#define PANDORA_VERSION ("7.0NG.754 Build 210518") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index a0dc952613..b73e932f3e 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.754(Build 210517))" + VALUE "ProductVersion", "(7.0NG.754(Build 210518))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 4afac2847f..a785b2713e 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.754-210517 +Version: 7.0NG.754-210518 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 3f1b5cfa31..c613edcc02 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.754-210517" +pandora_version="7.0NG.754-210518" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 3fd4d471b9..9d034e0fef 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 = 'PC210517'; +$build_version = 'PC210518'; $pandora_version = 'v7.0NG.754'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 73d132a3f7..9856e01ec7 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@ <div style='height: 10px'> <?php $version = '7.0NG.754'; - $build = '210517'; + $build = '210518'; $banner = "v$version Build $build"; error_reporting(0); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index d2c596106c..c4c9c18c8f 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.754 -%define release 210517 +%define release 210518 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index f0a62efb0d..6a1c092c40 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210517 +%define release 210518 # 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 64fc3e3794..e2b600d731 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.754 -%define release 210517 +%define release 210518 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index e53d5f98c6..7001a14efc 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.754-210517 +Version: 7.0NG.754-210518 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 7bb9925819..adbecff666 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.754-210517" +pandora_version="7.0NG.754-210518" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 80bd480d8f..05b6259223 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.754"; -my $pandora_build = "210517"; +my $pandora_build = "210518"; 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 f392deca89..44e598dd0e 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.754"; -my $pandora_build = "210517"; +my $pandora_build = "210518"; 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 b3d8e73508..9c2c788f07 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.754 -%define release 210517 +%define release 210518 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 689812cb20..1c57ed3718 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.754 -%define release 210517 +%define release 210518 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 14339f5490..6ffab8d15b 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210517" +PI_BUILD="210518" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 1c70abef74..f0d90fa665 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.754 Build 210517"; +my $version = "7.0NG.754 Build 210518"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ae53f07dbf..f55de28ad3 100755 --- 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.754 Build 210517"; +my $version = "7.0NG.754 Build 210518"; # save program name for logging my $progname = basename($0); From b0fbe192a0058bec8eafeae1059d3fb2fabc4033 Mon Sep 17 00:00:00 2001 From: "rafael.ameijeiras" <rafael.ameijeiras@artica.es> Date: Tue, 18 May 2021 11:43:43 +0200 Subject: [PATCH 50/50] adding expect to be used with ssh modules --- extras/deploy-scripts/pandora_deploy_community.sh | 2 ++ extras/docker/centos8/base/Dockerfile | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index 5e580ef1a3..29502b8ef2 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -254,6 +254,8 @@ server_dependencies=" \ perl(Geo::IP) \ perl(IO::Socket::INET6) \ perl(XML::Twig) \ + expect \ + openssh-clients \ http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm" execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies" diff --git a/extras/docker/centos8/base/Dockerfile b/extras/docker/centos8/base/Dockerfile index a35aea2937..2e66972229 100644 --- a/extras/docker/centos8/base/Dockerfile +++ b/extras/docker/centos8/base/Dockerfile @@ -11,7 +11,7 @@ RUN dnf install -y --setopt=tsflags=nodocs \ RUN dnf module reset -y php && dnf module install -y php:remi-7.3 RUN dnf config-manager --set-enabled powertools -# Install console +# Install console dependencies RUN dnf install -y --setopt=tsflags=nodocs \ php \ php-mcrypt \php-cli \ @@ -91,9 +91,9 @@ RUN dnf install -y --setopt=tsflags=nodocs \ php-yaml RUN mkdir -p /run/php-fpm/ ; chown -R root:apache /run/php-fpm/ -# not installed perl-Net-Telnet gtk-update-icon-cach ghostscript-fonts +# Not installed perl-Net-Telnet gtk-update-icon-cach ghostscript-fonts -# Install server +# Install server dependencies RUN dnf install -y --setopt=tsflags=nodocs \ GeoIP \ @@ -256,16 +256,18 @@ RUN dnf install -y --setopt=tsflags=nodocs \ nmap \ net-snmp-utils \ sudo \ + expect \ + openssh-clients \ http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ - http://firefly.artica.es/centos8/wmi-1.3.14-4.el7.art.x86_64.rpm + http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm -# install utils +# Install utils RUN dnf install -y supervisor crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs # SDK VMware perl dependencies RUN dnf install -y http://firefly.artica.es/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm http://firefly.artica.es/centos8/perl-Crypt-SSLeay-0.73_07-1.gf.el8.x86_64.rpm perl-Net-HTTP perl-libwww-perl openssl-devel perl-Crypt-CBC perl-Bytes-Random-Secure perl-Crypt-Random-Seed perl-Math-Random-ISAAC perl-JSON http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm # Instant client Oracle RUN dnf install -y https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm - +# Install Phantom RUN dnf install -y supervisor crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs