JSERVER.LOG Warning: Schedule job Pn_JobForEvery15Minutes is not working fine. Job execution failed is seen repeatedly. What could be causing this issue? |
\\Program Files\BMC Software\TrueSight\pw\pronto\bin\hourly_job.bat Attempts to manually run the Pn_JobForEvery15Minutes job reported the same result. "INSTALDIR\\pw\\pronto\\bin\\runjava.bat\" Pn_JobForEvery15Minutes Testing the script manually, set exitCode=%errorlevel%<space here> echo %exitCode%1 returns 0 + space + 1 on the system. It behaves normal and returns "01" correctly. Something specific to the user environment's command tool behavior and same behavior when the hourly_job.bat file is run via the scheduled task is not handling the spaces in the hourly_job.bat properly and returning the warning. Checking the default hourly_job.bat file the spaces are there by default and do work on our test systems. Therefore, we concluded that there are some environments which may not be able to handle spaces in command line commands. Here's the contents of the file which has spaced at the end of the command lines: set exitCode=%errorlevel% setlocal EnableDelayedExpansion "C:\Program Files\BMC Software\TrueSight\pw\perl\bin\perl.exe" "C:\Program Files\BMC Software\TrueSight\pw\pronto\bin\runjava.pl" apps.cmd.ha.CmdHA getstatusasstring >output_hj for /f %%i in ("output_hj") do set size=%%~zi if %size% gtr 0 ( FOR /F "Usebackq Tokens=*" %%@ IN ("output_hj") DO ( <NUL Set /P "=%%@" ) >> tmp move /y "tmp" "output_hj" ) SET /p MYVAR_hj=<output_hj SET "RES=HA enabled and status is Dormant or Unknown" IF "%MYVAR_hj%" == "%RES%" ( exit) call "C:\Program Files\BMC Software\TrueSight\pw\pronto\bin\hourlyjobs.exe" "C:\Program Files\BMC Software\TrueSight" IF NOT "%exitCode%"=="0" goto informFailed else goto informOk :informOk call "C:\Program Files\BMC Software\TrueSight\serverstatus.bat" /C "C:\Program Files\BMC Software\TrueSight\pw\perl\bin\perl.exe" "C:\Program Files\BMC Software\TrueSight\pw\pronto\bin\runjava.pl" com.proactivenet.scripts.schTaskMon.ScheduleTaskStatusMonitor "PRUNER_JOB" "Pn_JobForEvery15Minutes" "success" goto end :informFailed call "C:\Program Files\BMC Software\TrueSight\serverstatus.bat" /C "C:\Program Files\BMC Software\TrueSight\pw\perl\bin\perl.exe" "C:\Program Files\BMC Software\TrueSight\pw\pronto\bin\runjava.pl" com.proactivenet.scripts.schTaskMon.ScheduleTaskStatusMonitor "PRUNER_JOB" "Pn_JobForEvery15Minutes" "failed" :end exit %exitCode% Removing the spaces, saving the file and re-running the job cleared up the issue. So note: this may not happen in all environments but it may happen in some. |