Add support for critical_on_error.

The critical_on_error option adds improved error detection capabilities
to the Pandora FMS Enterprise ICMP Server (and maybe other servers in
the future).
This commit is contained in:
Ramon Novoa 2023-09-26 16:46:39 +02:00
parent fbeb616eb8
commit 5b52fc2385
3 changed files with 8 additions and 0 deletions

View File

@ -220,6 +220,9 @@ icmp_checks 1
# Number of ICMP packets to send per request.
icmp_packets 2
# If set to 1 (the default), when the executions of certain checks fail (not the checks themselves) the modules go to critical. If set to 0, they will end up going to unknown.
critical_on_error 1
# tcp specific options :
# tcp_checks: number of tcp retries if first attempt fails.
# tcp_timeout: specific timeout for tcp connections

View File

@ -265,6 +265,7 @@ sub pandora_load_config {
$pa_config->{"keepalive_orig"} = $pa_config->{"keepalive"};
$pa_config->{"icmp_checks"} = 1; # Introduced on 1.3.1
$pa_config->{"icmp_packets"} = 1; # > 5.1SP2
$pa_config->{"critical_on_error"} = 1; # > 7.0.774
$pa_config->{"alert_recovery"} = 0; # Introduced on 1.3.1
$pa_config->{"snmp_checks"} = 1; # Introduced on 1.3.1
$pa_config->{"snmp_timeout"} = 8; # Introduced on 1.3.1
@ -830,6 +831,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^icmp_packets\s+([0-9]*)/i) {
$pa_config->{"icmp_packets"} = clean_blank($1);
}
elsif ($parametro =~ m/^critical_on_error\s+([0-1])/i) {
$pa_config->{"critical_on_error"} = clean_blank($1);
}
elsif ($parametro =~ m/^snmpconsole\s+([0-9]*)/i) {
$pa_config->{"snmpconsole"} = clean_blank($1);
}

View File

@ -272,6 +272,7 @@ sub data_consumer ($$) {
$module_data = `$command`;
if ($? < 0) {
logger($pa_config, "Error executing command from module # $module_id. Probably out of memory.", 10);
pandora_timed_event(300, $pa_config, "Cannot process monitoring data. plug-in module \#$module_id failed to execute on server " . $pa_config->{'servername'}, 0, 0, 6, 0, 0, 'system', 0, $dbh);
}
};