Merge remote-tracking branch 'origin/develop' into ent-2806-Administracion_base_de_datos_de_historico

Conflicts:
pandora_console/install.php

Former-commit-id: 0176b7cddb80b80e9a56571f89559a17e525cb79
This commit is contained in:
daniel 2019-02-08 14:35:58 +01:00
commit 801d67e690
28 changed files with 130 additions and 42 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190206}
{190208}
ViewReadme
{Yes}

View File

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

View File

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

View File

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

View File

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

View File

@ -538,6 +538,7 @@ if ($tab == 'tree') {
$url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'];
$table->data[$key][0] = $group['id_grupo'];
$table->data[$key][1] = "<a href='$url'>".$group['nombre'].'</a>';
if ($group['icon'] != '') {
$table->data[$key][2] = html_print_image(
'images/groups_small/'.$group['icon'].'.png',
true,
@ -549,6 +550,10 @@ if ($tab == 'tree') {
false, false, false, true
]
);
} else {
$table->data[$key][2] = '';
}
// reporting_get_group_stats
$table->data[$key][3] = $group['disabled'] ? __('Disabled') : __('Enabled');

View File

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

View File

@ -1754,7 +1754,8 @@ function get_snmpwalk(
$quick_print=0,
$base_oid='',
$snmp_port='',
$server_to_exec=0
$server_to_exec=0,
$extra_arguments=''
) {
global $config;
@ -1805,15 +1806,15 @@ function get_snmpwalk(
case '3':
switch ($snmp3_security_level) {
case 'authNoPriv':
$command_str = $snmpwalk_bin.' -m ALL -Oa -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' -m ALL -Oa '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
case 'noAuthNoPriv':
$command_str = $snmpwalk_bin.' -m ALL -Oa -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' -m ALL -Oa '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
default:
$command_str = $snmpwalk_bin.' -m ALL -Oa -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' -m ALL -Oa '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
}
break;
@ -1822,7 +1823,7 @@ function get_snmpwalk(
case '2c':
case '1':
default:
$command_str = $snmpwalk_bin.' -m ALL -Oa -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' -m ALL '.$extra_arguments.' -Oa -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
}

View File

@ -14609,3 +14609,67 @@ function api_get_users($thrash1, $thrash2, $other, $returnType)
}
}
/**
* Resets module counts and alert counts in the agents
*
* @param $id id of the agent you want to synchronize. Add "All" to synchronize all agents
* @param $trash1
* @param $trash2
* @param $trash3
*
* Example:
* api.php?op=set&op2=reset_agent_counts&apipass=1234&user=admin&pass=pandora&id=All
*/
function api_set_reset_agent_counts($id, $thrash1, $thrash2, $thrash3)
{
global $config;
if (!check_acl($config['id_user'], 0, 'AW')) {
returnError('forbidden', 'string');
return;
}
if ($id == '' || !$id) {
returnError('error_parameter', __('Error. Agent cannot be left blank.'));
return;
}
if ($id != 'All') {
$agent = db_get_row_filter('tagente', ['id_agente' => $id]);
if (empty($agent)) {
returnError('error_agent', __('This agent does not exist.'));
return;
} else {
$return = db_process_sql_update(
'tagente',
[
'update_module_count' => 1,
'update_alert_count' => 1,
],
['id_agente' => $id]
);
}
} else {
$return = db_process_sql_update(
'tagente',
[
'update_module_count' => 1,
'update_alert_count' => 1,
]
);
}
$data = __('Successfully updated module/alert count in id agent %d.', $id);
if ($id == 'All') {
$data = __('Successfully updated module/alert count in all agents');
}
if ($return === false) {
returnError('error_reset_agent_counts', 'Could not be updated module/alert counts in id agent %d.', $id);
} else {
returnData('string', ['type' => 'string', 'data' => $data]);
}
}

View File

@ -3772,7 +3772,7 @@ function reporting_get_event_histogram($events, $text_header_event=false)
$graph_data,
$max_value,
100,
35,
25,
$full_legend,
$colors,
$config['fontpath'],

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.731 PS190206";
my $version = "7.0NG.731 PS190208";
# save program name for logging
my $progname = basename($0);
@ -137,6 +137,7 @@ sub help_screen{
help_screen_line('--delete_cluster_item', '<id_item>', 'Deleting cluster item');
help_screen_line('--get_cluster_status', '<id_cluster>', 'Getting cluster status');
help_screen_line('--set_disabled_and_standby', '<id_agent> <id_node> <value>', 'Overwrite and disable and standby status');
help_screen_line('--reset_agent_counts', '<id_agent>', 'Resets module counts and alert counts in the agents');
print "\nMODULES:\n\n" unless $param ne '';
help_screen_line('--create_data_module', "<module_name> <module_type> <agent_name> [<description> <module_group> \n\t <min> <max> <post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> \n\t <history_data> <definition_file> <warning_str> <critical_str>\n\t <unknown_events> <ff_threshold> <each_ff> <ff_threshold_normal>\n\t <ff_threshold_warning> <ff_threshold_critical> <ff_timeout> <warning_inverse> <critical_inverse>\n\t <critical_instructions> <warning_instructions> <unknown_instructions>]", 'Add data server module to agent');
help_screen_line('--create_web_module', "<module_name> <module_type> <agent_name> [<description> <module_group> \n\t <min> <max> <post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> \n\t <history_data> <retries> <requests> <agent_browser_id> <auth_server> <auth_realm> <definition_file>\n\t <proxy_url> <proxy_auth_login> <proxy_auth_password> <warning_str> <critical_str>\n\t <unknown_events> <ff_threshold> <each_ff> <ff_threshold_normal>\n\t <ff_threshold_warning> <ff_threshold_critical> <ff_timeout> <warning_inverse> <critical_inverse>\n\t <critical_instructions> <warning_instructions> <unknown_instructions>].\n\t The valid data types are web_data, web_proc, web_content_data or web_content_string", 'Add web server module to agent');
@ -6375,6 +6376,10 @@ sub pandora_manage_main ($$$) {
param_check($ltotal, 3, 1);
cli_set_disabled_and_standby();
}
elsif ($param eq '--reset_agent_counts') {
param_check($ltotal, 1, 0);
cli_reset_agent_counts();
}
else {
print_log "[ERROR] Invalid option '$param'.\n\n";
$param = '';
@ -6979,3 +6984,16 @@ sub cli_set_disabled_and_standby() {
my $exit_code = (defined($result) && "$result" eq "1") ? "1" : "0";
print "\n$exit_code\n";
}
##############################################################################
# Resets module counts and alert counts in the agents.
# Related option: --reset_agent_counts
##############################################################################
sub cli_reset_agent_counts() {
my $agent_id = @ARGV[2];
my $result = api_call(\%conf,'set', 'reset_agent_counts', $agent_id);
print "$result \n\n ";
}