The perl script fails when trying to build an agent from the script editor
The following message appears in the logs:
2011-05-19 17:08:09.488 ECHO <newscript/1.0.0/GATETRADELCM/newscript> INFO [JCollector] com.quest.glue.core.services.AgentStatusServiceImpl - Agent failure reported
2011-05-19 17:08:11.847 ECHO <newscript/1.0.0/GATETRADELCM/newscript-agent> ERROR [JCollector] com.quest.glue.core.jcollector.ScriptContext - JCollector encountered an exception while trying to run the agent script.
java.io.IOException: Cannot run program "C:\Quest_Software\Foglight_Agent_Manager\state\default\agents\ newscript \1.0.0\script\ newscript.pl" (in directory "C:\Quest_Software\Foglight_Agent_Manager\state\default\agents\newscript\1.0.0\script"): CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at com.quest.glue.core.jcollector.ScriptContext.run(ScriptContext.java:88)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 3 more
The script builder editor doesn’t process the .pl (pearl extension), a zip file will be used in the build script editor as a workaround
In the same folder where the script reside perform the following steps:
[1] create a file called newscript.bat
[2] In the file created add a line that points to the perl script created
C:\ecc\exec\utils\perl\Win32\bin\perl.exe newscript_mainscript.pl
[3] Zip the 2 files and name the zip file ******* newscript.zip
Point the Build script agent to the zip file - newscript.zip
[4] Apply the changes and activate the agent.