I have a basic .bat file to restart a service when a logfile match is found. It appears to run based on the logmon probe log file, but it is not executing any of the commands.
C:\Program Files (x86)\Nimsoft\probes\system\logmon\SVC_RESTART.bat
@ECHO ONecho "begin SVC_RESTART script" >> scr.lognet stop "ServiceName"net start "ServiceName"TIMEOUT /T 5echo "exiting SVC_RESTART script" >> scr.log
According to the release notes logmon versions before 3.55 had a defect with spaces.
logmon (Log Monitoring) Release Notes - CA Unified Infrastructure Management Probes - CA Technologies Documentation
have you tried 8.3 format for the command?
recarter. Having just attempted something similar and got an error try putting quotes around the file path e.g. "C:\Program Files (x86)\Nimsoft\probes\system\logmon\SVC_RESTART.bat". In my attempt the space was not liked and it threw an exit code 1 at log level 3.
NOTE: I am running a command to check the output while you are running a command action after you find something in a log but it is worth giving it a go.
Thanks - that works! I'll also request clarification on this in the documentation.
The default timeout for command execution is 1 sec.
It means that the command will be killed after 1 sec.
If your script need more time, increase timeout value.
I tried the single and double quotes, but that generated an error script "failed to start". I moved the script to a folder with no spaces and it ran successfully. So, there seems to be an issue with spaces in the command field on the logmon probe.