Hi all,
I searched a lot on the web, in the forum and in knowledge base but i din't find a working solution for me. So here I am and this is my issue:
Alert ist set to run an executable file, example:
d:\send_alert.bat "<<Transaction Time>>|<<Transaction Error>>"
If <<Transaction Error>> contains any special charachters like &, <> etc. the .bat fails to execute:
Reason=Running executable failed. Error message:
com.mercury.am.platform.processing.alerts.util.AlertEngineException: Running executable failed. Error message:
at com.mercury.am.platform.processing.alerts.notification.ExecutableNotification.execNotification(ExecutableNotification.java:100) ~[alerts-common.jar!/:?]
at com.mercury.am.platform.processing.alerts.notification.NotificationImpl.execute(NotificationImpl.java:163) [alerts-common.jar!/:?]
at com.mercury.am.platform.processing.alerts.notification.NotificationImpl.handle(NotificationImpl.java:146) [alerts-common.jar!/:?]
at com.mercury.am.platform.processing.alerts.listener.NotificationTask.sendNotification(NotificationTask.java:190) [alerts-common.jar!/:?]
at com.mercury.am.platform.processing.alerts.listener.NotificationTask.sendNotifications(NotificationTask.java:135) [alerts-common.jar!/:?]
at com.mercury.am.platform.processing.alerts.listener.NotificationTask.run(NotificationTask.java:73) [alerts-common.jar!/:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_372]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_372]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_372]
2024-12-10 16:52:14,017 [pool-NotificationMDBContext-thread-1] (NotificationTask.java:192) ERROR - MERQ-120633: All attempts to execute a notification failed. It will not be executed
Type=Executable
Alert id=4c37e423ec9f49188fc3b9c061501cd1
Command=d:\send_alert.bat "Tue Dec 10 4:50:39 PM 2024 [Central European Time] [+0100]|1.Action.c[88]: Error -26366: \"Text=>offline<\" not found for web_reg_find, Snapshot Info [MSH 1 10] [MsgId: MERR-26366]"
There is no way for me to escape in the script the two "<>" and those charachters are passed to the batch unescaped.
But the issue exists also for completely random situations for example an alert triggered by a url containing "&", and this URL could be anywhere in the server response flow:
Error -26608: HTTP Status-Code=503 [Service Unavailable] for \"https:///Logon/login_spring_cas_security_check&fallback=true\", Snapshot Info [MSH 1 3] [MsgId: MERR-26608]"
Also in this case, the batch execution will fail and no alert will be sent.
Any suggestion on this?
Thank you!