DX Infrastructure Manager

Expand all | Collapse all

Tips for Executing command in logmon probe

Jump to Best Answer
  • 1.  Tips for Executing command in logmon probe

    Posted 10-17-2017 05:24 PM

    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.

     

    Command

    C:\Program Files (x86)\Nimsoft\probes\system\logmon\SVC_RESTART.bat

     

    .bat file

    @ECHO ON
    echo "begin SVC_RESTART script" >> scr.log
    net stop "ServiceName"
    net start "ServiceName"
    TIMEOUT /T 5
    echo "exiting SVC_RESTART script" >> scr.log



  • 2.  Re: Tips for Executing command in logmon probe

    Posted 10-17-2017 05:29 PM

    Hi,

     

    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.



  • 3.  Re: Tips for Executing command in logmon probe

    Broadcom Employee
    Posted 10-17-2017 09:06 PM

    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.

     

    Regards,

    Yu Ishitani



  • 4.  Re: Tips for Executing command in logmon probe

    Posted 10-18-2017 10:59 AM

    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.



  • 5.  Re: Tips for Executing command in logmon probe

    Posted 10-18-2017 11:09 AM

    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 



  • 6.  Re: Tips for Executing command in logmon probe
    Best Answer

    Broadcom Employee
    Posted 10-18-2017 11:15 AM

    have you tried 8.3 format for the command?



  • 7.  Re: Tips for Executing command in logmon probe

    Posted 10-18-2017 04:29 PM

    Thanks - that works!  I'll also request clarification on this in the documentation.