Add a basic implementation of the Sync Server.

This commit is contained in:
Ramon Novoa 2017-02-22 12:59:29 +01:00
parent 699942eef5
commit 3cada51373
3 changed files with 23 additions and 1 deletions

View File

@ -271,6 +271,11 @@ sub pandora_load_config {
$pa_config->{"snmpconsole_threads"} = 1; # 5.1
$pa_config->{"translate_variable_bindings"} = 0; # 5.1
$pa_config->{"translate_enterprise_strings"} = 1; # 5.1
$pa_config->{"syncserver"} = 0; # 7.0
$pa_config->{"sync_address"} = ''; # 7.0
$pa_config->{"sync_port"} = '41121'; # 7.0
$pa_config->{"sync_timeout"} = 5; # 7.0
$pa_config->{"sync_retries"} = 2; # 7.0
# Internal MTA for alerts, each server need its own config.
$pa_config->{"mta_address"} = '127.0.0.1'; # Introduced on 2.0
@ -968,6 +973,21 @@ sub pandora_load_config {
elsif ($parametro =~ m/^unknown_events\s+([0-1])/i) {
$pa_config->{'unknown_events'} = clean_blank($1);
}
elsif ($parametro =~ m/^syncserver\s+([0-9]*)/i) {
$pa_config->{'syncserver'}= clean_blank($1);
}
elsif ($parametro =~ m/^sync_address\s+(.*)/i) {
$pa_config->{'sync_address'}= clean_blank($1);
}
elsif ($parametro =~ m/^sync_port\s+([0-9]*)/i) {
$pa_config->{'sync_port'}= clean_blank($1);
}
elsif ($parametro =~ m/^sync_retries\s+([0-9]*)/i) {
$pa_config->{'sync_retries'}= clean_blank($1);
}
elsif ($parametro =~ m/^sync_timeout\s+([0-9]*)/i) {
$pa_config->{'sync_timeout'}= clean_blank($1);
}
} # end of loop for parameter #
# Set to RDBMS' standard port

View File

@ -243,7 +243,7 @@ our @EXPORT = qw(
# Some global variables
our @DayNames = qw(sunday monday tuesday wednesday thursday friday saturday);
our @ServerTypes = qw (dataserver networkserver snmpconsole reconserver pluginserver predictionserver wmiserver exportserver inventoryserver webserver eventserver icmpserver snmpserver satelliteserver);
our @ServerTypes = qw (dataserver networkserver snmpconsole reconserver pluginserver predictionserver wmiserver exportserver inventoryserver webserver eventserver icmpserver snmpserver satelliteserver transactionalserver mfserver syncserver);
our @AlertStatus = ('Execute the alert', 'Do not execute the alert', 'Do not execute the alert, but increment its internal counter', 'Cease the alert', 'Recover the alert', 'Reset internal counter');
# Event storm protection (no alerts or events)

View File

@ -59,6 +59,7 @@ our @EXPORT = qw(
SATELLITESERVER
MFSERVER
TRANSACTIONALSERVER
SYNCSERVER
METACONSOLE_LICENSE
$DEVNULL
$OS
@ -119,6 +120,7 @@ use constant SNMPSERVER => 12;
use constant SATELLITESERVER => 13;
use constant TRANSACTIONALSERVER => 14;
use constant MFSERVER => 15;
use constant SYNCSERVER => 16;
# Value for a metaconsole license type
use constant METACONSOLE_LICENSE => 0x01;