How do I configure a Python Agent Plug-in?
Local Data Processing
First make sure python is in your user & system path.
We also introduced a requirement that scripts on Windows now need a Unix-style shebang line at the very top, which Local Data Processing then interprets ie..
At the start of your python script it is recommended you set he shebang.
This actually works on Windows and Linux
On Linux, however, it is more usual to see the format of
The path to python in the scheduler's environment should be checked/set as well.
- First make sure python is in your user & system path. If exe is not in your path you have to add it and if your running Windows you must restart your PC for it to take effect.
- At the start of your python script it is recommended you set the shebang.
On Window has the format
Or on Linux that has the format of
An example script on a Windows would look like this and save with the extension .py, ie. test.py
#!python import os import sys if _name_ == "_main_": print("success") sys.exit(0)
Most of the agent plugins run on the integrate node.
AgentPlugin screen would be defined like this for the location MSTGT, a Sqlserver target with the channel name chn1 calling the python script 'test.py' running on target Windows server with the path in my example @ C:Usershvrtestpythonscripts.
You should also run a test if you can run via command line like this on Windows to verify it works, for example
python <script fully pathed> C:usershvtestpython C:usershvrtestpythonscriptstest.py