Merge pull request #1779 from vajonam/1778-add-subtituteTags-for-exec

add the ability to add substitued tags to the commandline
This commit is contained in:
Isaac Connor 2017-05-10 09:00:36 -04:00 committed by GitHub
commit de24ba7120
2 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,7 @@ Here is what the filter window looks like
events later and also make sure archived events don't get deleted, for example events later and also make sure archived events don't get deleted, for example
* Email details of all matches: Sends an email to the configured address with details about the event. * Email details of all matches: Sends an email to the configured address with details about the event.
The email can be customized as per TBD The email can be customized as per TBD
* Execute command on all matches: Allows you to execute any arbitrary command on the matched events * Execute command on all matches: Allows you to execute any arbitrary command on the matched events. You can use replacement tokens as subsequent arguents to the command, the last argument will be the absolute path to the event, preceeded by replacement arguents. eg: /usr/bin/script.sh %MN% will excecute as /usr/bin/script.sh MonitorName /path/to/event.
* Delete all matches: Deletes all the matched events * Delete all matches: Deletes all the matched events
* *E*: Use 'Submit' to 'test' your matching conditions. This will just match and show you what filters match. Use 'Execute' to actually execute the action after matching your conditions. Use 'Save' to save the filter for future use and 'Reset' to clear your settings * *E*: Use 'Submit' to 'test' your matching conditions. This will just match and show you what filters match. Use 'Execute' to actually execute the action after matching your conditions. Use 'Save' to save the filter for future use and 'Reset' to clear your settings

View File

@ -982,6 +982,7 @@ sub executeCommand
my $command = $filter->{AutoExecuteCmd}; my $command = $filter->{AutoExecuteCmd};
$command .= " $event_path"; $command .= " $event_path";
$command = substituteTags( $command, $filter, $event );
Info( "Executing '$command'\n" ); Info( "Executing '$command'\n" );
my $output = qx($command); my $output = qx($command);