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:
commit
de24ba7120
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue