Added an option to configure the interval before a module becomes

unknown.
This commit is contained in:
Ramon Novoa 2015-03-09 16:11:05 +01:00
parent 18fd20c078
commit 862c25a85b
6 changed files with 36 additions and 3 deletions

View File

@ -476,3 +476,10 @@ claim_back_snmp_modules 1
# If set to 1 asynchronous modules that do not receive data for twice their
# interval will become normal. Set to 0 to disable.
async_recovery 1
# Passphrase used to generate the key for password encryption (PANDORA FMS ENTERPRISE ONLY).
#encryption_passphrase passphrase
# Time interval (as a multiple of the module interval) before a module becomes unknown. Twice the module's interval by default.
#unknown_interval 2

View File

@ -479,3 +479,10 @@ claim_back_snmp_modules 1
# If set to 1 asynchronous modules that do not receive data for twice their
# interval will become normal. Set to 0 to disable.
async_recovery 1
# Passphrase used to generate the key for password encryption (PANDORA FMS ENTERPRISE ONLY).
#encryption_passphrase passphrase
# Time interval (as a multiple of the module interval) before a module becomes unknown. Twice the module's interval by default.
#unknown_interval 2

View File

@ -500,3 +500,6 @@ console_pass pandora
# Passphrase used to generate the key for password encryption (PANDORA FMS ENTERPRISE ONLY).
#encryption_passphrase passphrase
# Time interval (as a multiple of the module interval) before a module becomes unknown. Twice the module's interval by default.
#unknown_interval 2

View File

@ -303,3 +303,10 @@ console_user admin
# console_pass: Console password (pandora by default)
console_pass pandora
# Passphrase used to generate the key for password encryption (PANDORA FMS ENTERPRISE ONLY).
#encryption_passphrase passphrase
# Time interval (as a multiple of the module interval) before a module becomes unknown. Twice the module's interval by default.
#unknown_interval 2

View File

@ -349,6 +349,12 @@ sub pandora_load_config {
$pa_config->{"console_user"} = 'admin'; # 6.0
$pa_config->{"console_pass"} = 'pandora'; # 6.0
# Database password encryption passphrase
$pa_config->{"encryption_passphrase"} = ''; # 6.0
# Unknown interval (as a multiple of the module's interval)
$pa_config->{"unknown_interval"} = 2; # > 5.1SP2
# -------------------------------------------------------------------------
# This values are not stored in .conf files.
# This values should be stored in database, not in .conf files!
@ -832,9 +838,12 @@ sub pandora_load_config {
elsif ($parametro =~ m/^console_pass\s(.*)/i) {
$pa_config->{'console_pass'}= safe_input($1);
}
elsif ($parametro =~ m/^encryption_passphrase\s(.*)/i) {
elsif ($parametro =~ m/^encryption_passphrase\s(.*)/i) { # 6.0
$pa_config->{'encryption_passphrase'}= safe_input($1);
}
elsif ($parametro =~ m/^unknown_interval\s([0-9]*)/i) { # > 5.1SP2
$pa_config->{'unknown_interval'}= safe_input($1);
}
} # end of loop for parameter #
# Set to RDBMS' standard port

View File

@ -3008,7 +3008,7 @@ sub pandora_module_keep_alive_nd {
AND tagente_modulo.disabled = 0
AND (tagente_modulo.flag = 1 OR ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP()))
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
AND ( tagente_estado.utimestamp + (tagente.intervalo * 2) < UNIX_TIMESTAMP())');
AND ( tagente_estado.utimestamp + (tagente.intervalo * ?) < UNIX_TIMESTAMP())', $pa_config->{'unknown_interval'});
my %data = ('data' => 0);
foreach my $module (@modules) {
@ -4406,7 +4406,7 @@ sub pandora_module_unknown ($$) {
AND ((tagente_estado.estado <> 3 AND tagente_modulo.id_tipo_modulo NOT IN (21, 22, 23, 100))
OR (tagente_estado.estado <> 0 AND tagente_modulo.id_tipo_modulo IN (21, 22, 23)))
AND tagente_estado.utimestamp != 0
AND (tagente_estado.current_interval * 2) + tagente_estado.utimestamp < UNIX_TIMESTAMP()');
AND (tagente_estado.current_interval * ?) + tagente_estado.utimestamp < UNIX_TIMESTAMP()', $pa_config->{'unknown_interval'});
foreach my $module (@modules) {