Note 1: Custom Script Agent is available to use it but not currently developed any more. It's better to use either fglam-devkit or PythonAgentSDK to create custom agents.
For the set up, please go to Administration │ Cartridges │ Components for Download
Look for these two packages:
fglam-devkit-5_x_x-windows-x86_64.zip
PythonAgentSDK-1_0_x.zip
Download both files and extract it, within those files you will find documentation about how to use it.
Note 2: The Python-dev-kit is available starting from FMS(Foglight Management Server) 5.7.5.6 which allows java coding in custom agents as well.
Python Set up Example
A. Prerequisites:
Download and Install:
Windows x86-64 MSI installer
2. Java SE Development Kit 8 Downloads
Download and Install:
3. Download from Foglight webconsole | Administration | Cartridges | Components for Download
PythonAgentSDK-1_0_x
4. Right click on "My Computer" and choose "Properties", then click on "Advanced System Settings"
Click on Advanced | Environment Variables
Click New under System variables and give the name of PHYTONPATH and add following paths:
C:\Python27\Lib
C:\PythonAgentSDK-1_0_x\lib
Note: The video has different paths for Python because it's for storage.
D:\sdk\StorageSDK\phyton-sdk\lib
Reference:
B. How to create PythonAgent, Example:
1. Open downloaded file, and access PythonAgentSDK-1_0_x\docs\example_agent.html
Copy the code and paste it on a txt file, then save it as my-agent-script.py
2. Access under Administration ¦ Tooling ¦ Phyton Agent Builder
Note: You need to have "Cartridge Developer" role in order to see: PythonAgentSDK
Import my-agent-script.py
3. Fill out the rest of the information then click Submit.
4. Download the cartridge that was created from Administration | Cartridges | Components for Download
5. Import the cartridge from Administration | Cartridges | Cartridge Inventory | Install Cartridge
6. Go to Administration | Agents | Agent Status
A. Click on "Create Agent"
B. Choose the Host Name and click Next.
C. Choose the Python component created and click Finish.
7. Activate the Agent that was created.
Phyton Agent Examples:
Custom Script Agent
If still you want to use Script Agent, this is the information about it:
Note: Script agents do not provide proper logging as it is a legacy agent.
The "Script Agent Builder" does not gives enough information to troubleshoot it, Use the following solution as a current workaround to disable the Script agent cartridge and re-enable.(Below information is what you can try to use to make it work)
Tables associated with custom agents were deleted
SOL181456
If that didn't make it work, we may need to add additional logging to the script.
Examples:
The output of the script indicates do not have any type of logging.
The script example sets variables and uses the variables in the logfile generation.
set TODAY=%year%-%month%-%day
set logFile=%_%\%agentName%-%TODAY%.log
ECHO LOG [%batchName%]
Note:
To access old "Script Agent Builder" which is based on 5.6.x structure you can go to:
Administration │ Development │ Development tools