Add MID and EID substitutions

This commit is contained in:
Isaac Connor
2023-05-29 16:23:15 -04:00
parent d728385bd1
commit e8cd673569

View File

@@ -700,6 +700,7 @@ sub substituteTags {
my $url = $Config{ZM_URL};
$text =~ s/%ZP%/$url/g;
$text =~ s/%MID%/$Monitor->{Id}/g if $Monitor;
$text =~ s/%MN%/$Monitor->{Name}/g if $Monitor;
if ($Summary) {
$text =~ s/%MET%/$Summary->{TotalEvents}/g;
@@ -718,6 +719,7 @@ sub substituteTags {
$text =~ s/%EPI%/$url?view=event&mode=still&mid=$Event->{MonitorId}&eid=$Event->{Id}/g;
$text =~ s/%EPATH%/$Event->Path()/g;
$text =~ s/%EI%/$Event->{Id}/g;
$text =~ s/%EID%/$Event->{Id}/g;
$text =~ s/%EN%/$Event->{Name}/g;
$text =~ s/%EC%/$Event->{Cause}/g;
$text =~ s/%ED%/$Event->{Notes}/g;
@@ -849,7 +851,7 @@ sub substituteTags {
$text =~ s/%FP%/$url?view=filter&filter_name=$filter_name/g;
return $text;
} # end subsitituteTags
} # end substituteTags
sub sendSummaryEmail {
my $filter = shift;
@@ -1185,7 +1187,7 @@ sub executeCommand {
my $Event = shift;
my $command = $filter->{AutoExecuteCmd};
if ($command =~ /%\w+.%/) {
if ($command =~ /%\w+%/) {
$command = substituteTags($command, $filter, $Event);
} else {
$command .= ' '.$Event->Path();