Sometimes a script is failing or timing out when run from the MaxFocus dashboard and you need to duplicate dashboard behavior manually from a command prompt. Here’s how:
1. In C:\Program Files (x86)\Advanced Monitoring Agent\scripts, find the script that is not working, e.g. 92068.cmd.
2. Open C:\Program Files (x86)\Advanced Monitoring Agent\debug.log. Search for the last instance of “92068”. You will see something like this:
18-12-2015 15:47:30: winagent(4124): CTest_Script::DoTest starting task: cscript
"C:\PROGRA~2\ADVANC~1\task_start.js" 146 "92068.cmd %IT_Scripts%Helpers": 146
3. Open an administrative command prompt. Change to the C:\Program Files (x86)\Advanced Monitoring Agent\scripts folder. Test running the script: copy the command starting with “cscript” up to but not including the colon. Change the three-digit number to a larger random number. For example:
cscript "C:\PROGRA~2\ADVANC~1\task_start.js" 946 "92068.cmd %IT_Scripts%Helpers"
4. In C:\Program Files (x86)\Advanced Monitoring Agent, review the output file that includes that three-digit number, for example task_output_946.dat.
5. If you really want to dig in, you can start adding statements to task_start.js to show progress and variables the script. For example, this command will display the value of the sCommandExec variable in the console window:
WScript.Echo ("sCommandExec = " + sCommandExec);