mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Check CPS for modules and parents to inhabilate alerts
This commit is contained in:
parent
3ac133b1b5
commit
d71ac60711
@ -2302,7 +2302,9 @@ sub pandora_process_module ($$$$$$$$$;$) {
|
||||
}
|
||||
|
||||
# Generate alerts
|
||||
if (pandora_inhibit_alerts ($pa_config, $agent, $dbh, 0) == 0 && pandora_cps_enabled($agent, $module) == 0) {
|
||||
if (pandora_inhibit_alerts ($pa_config, $agent, $dbh, 0) == 0 &&
|
||||
(pandora_cps_enabled($agent, $module) == 0 || enterprise_hook('pandora_inhibit_service_alerts', [$pa_config, $module, $dbh, 0]) == 0))
|
||||
{
|
||||
pandora_generate_alerts ($pa_config, $processed_data, $status, $agent, $module, $utimestamp, $dbh, $timestamp, $extra_macros, $last_data_value);
|
||||
}
|
||||
else {
|
||||
@ -6288,7 +6290,9 @@ sub pandora_module_unknown ($$) {
|
||||
pandora_mark_agent_for_module_update ($dbh, $module->{'id_agente'});
|
||||
|
||||
# Generate alerts
|
||||
if (pandora_inhibit_alerts ($pa_config, $agent, $dbh, 0) == 0 && pandora_cps_enabled($agent, $module) == 0) {
|
||||
if (pandora_inhibit_alerts ($pa_config, $agent, $dbh, 0) == 0 &&
|
||||
(pandora_cps_enabled($agent, $module) == 0 || enterprise_hook('pandora_inhibit_service_alerts', [$pa_config, $module, $dbh, 0]) == 0))
|
||||
{
|
||||
my $extra_macros = { _modulelaststatuschange_ => $module->{'last_status_change'}};
|
||||
pandora_generate_alerts ($pa_config, 0, 3, $agent, $module, time (), $dbh, $timestamp, $extra_macros, 0, 'unknown');
|
||||
}
|
||||
@ -6335,7 +6339,9 @@ sub pandora_module_unknown ($$) {
|
||||
pandora_mark_agent_for_module_update ($dbh, $module->{'id_agente'});
|
||||
|
||||
# Generate alerts
|
||||
if (pandora_inhibit_alerts ($pa_config, $agent, $dbh, 0) == 0 && pandora_cps_enabled($agent, $module) == 0) {
|
||||
if (pandora_inhibit_alerts ($pa_config, $agent, $dbh, 0) == 0 &&
|
||||
(pandora_cps_enabled($agent, $module) == 0 || enterprise_hook('pandora_inhibit_service_alerts', [$pa_config, $module, $dbh, 0]) == 0))
|
||||
{
|
||||
my $extra_macros = { _modulelaststatuschange_ => $module->{'last_status_change'}};
|
||||
pandora_generate_alerts ($pa_config, 0, 3, $agent, $module, time (), $dbh, $timestamp, $extra_macros, 0, 'unknown');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user