In a rule, a user created a Command Line Action which is calls a .vbs script.
When the Rule Fires, no results come from the .vbs script.
In the FMS FGLHOME\logs\ManagementServer log file for the "script_name.vbs" received the following error:
c:\test.vbs.....is not a valid Win32 application.
The Foglight documentation says that a user can call a script from a Command Line Action.
.vbs scripts must be called from the context of the Windows .vbs engine, called cscript.exe
RESOLUTION 1: Call the .vbs in the Command Line Action as follows:
cscript.exe "c:\test.vbs"
How to setup the Command Line Action:
1) Admin Console | Administration | Rules & Notifications | Manage Rules | select Rule to open it in the Rule Editor
2) Conditions, Alarms & Actions tab | expand Severity (Fatal, Critical or Warning) | select Action tab | Action type is "CommandAction", select Add
3) Next, click on the "CommandAction" | click on value (may read 'Default') - this opens the Action Parameter Editor (may need to drag the Action Parameter Editor window over to see fully | in Action Parameter window,
4) select User Defined tab | type in the User Defined window the following:
cscript.exe "c:\test.vbs"
5) Save
RESOLUTION 2: If creating a custom script agent with a .vbs file:
ie. Custom Script named "ExchangeFreeSpace.vbs"
1) You will need to call the VBS script with cscript or wscript in a batch file named "ExchangeFreeSpace.bat".
Create a zip file with the VBS and Batch script in it. And it will need to be the same name as the script agent
IE: ExchangeFreeSpace.zip which contains:
ExchangeFreeSpace.vbs
ExchangeFreeSpace.bat
2) Rebuild the Custom Agent cartridge referencing the zip file updating the version number.
3) Deploy the cartridge to the client in the Agent Status dashboard
4) Start your agent.
Foglight may default to looking in %FGLHOME% for associated files such as .dll's that are associated with the .vbs script.
Also, if creating a custom agent via Script Builder which references a .vbs script, you may see the error displayed as:
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\{agent_name}\1.0.1\script\script_name.vbs" (in directory "C:\Quest_Software\Foglight_Agent_Manager\state\default\agents\{agent_name}\1.0.1\script"): CreateProcess error=193, %1 is not a valid Win32 application
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center