Fix action information for SNMP alert events.
This commit is contained in:
parent
356e1f9f2b
commit
cd3e20fefe
|
@ -4239,8 +4239,26 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
|
||||||
|
|
||||||
# Generate an event, ONLY if our alert action is different from generate an event.
|
# Generate an event, ONLY if our alert action is different from generate an event.
|
||||||
if ($action->{'id_alert_command'} != 3 && $alert->{'disable_event'} == 0){
|
if ($action->{'id_alert_command'} != 3 && $alert->{'disable_event'} == 0){
|
||||||
pandora_event ($pa_config, "SNMP alert fired (" . safe_output($alert->{'description'}) . ")",
|
pandora_event (
|
||||||
0, 0, $alert->{'priority'}, 0, 0, 'alert_fired', 0, $dbh);
|
$pa_config,
|
||||||
|
"SNMP alert fired (" . safe_output($alert->{'description'}) . ")",
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
$alert->{'priority'},
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
'alert_fired',
|
||||||
|
0,
|
||||||
|
$dbh,
|
||||||
|
undef,
|
||||||
|
undef,
|
||||||
|
undef,
|
||||||
|
undef,
|
||||||
|
undef,
|
||||||
|
undef,
|
||||||
|
undef,
|
||||||
|
undef,
|
||||||
|
p_encode_json($pa_config, $custom_data));
|
||||||
}
|
}
|
||||||
|
|
||||||
# Update alert status
|
# Update alert status
|
||||||
|
@ -4296,6 +4314,11 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
|
||||||
'disable_event' => $alert->{'disable_event'}
|
'disable_event' => $alert->{'disable_event'}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# Additional execution information for the console.
|
||||||
|
my $custom_data = {
|
||||||
|
'actions' => [],
|
||||||
|
};
|
||||||
|
|
||||||
pandora_execute_action ($pa_config, $trap_rcv_full, \%agent, \%alert_action, 1, $other_action, undef, $dbh, $timestamp, \%macros) if (defined ($other_action));
|
pandora_execute_action ($pa_config, $trap_rcv_full, \%agent, \%alert_action, 1, $other_action, undef, $dbh, $timestamp, \%macros) if (defined ($other_action));
|
||||||
push(@{$custom_data->{'actions'}}, safe_output($other_action->{'action_name'}));
|
push(@{$custom_data->{'actions'}}, safe_output($other_action->{'action_name'}));
|
||||||
|
|
||||||
|
@ -4318,7 +4341,7 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
|
||||||
undef,
|
undef,
|
||||||
undef,
|
undef,
|
||||||
undef,
|
undef,
|
||||||
undef,,
|
undef,
|
||||||
undef,
|
undef,
|
||||||
p_encode_json($pa_config, $custom_data));
|
p_encode_json($pa_config, $custom_data));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue