- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 01:01 PM
Hello Team,
I know, if MID server is on Windows OS, there is a possibility to run a Pyton script via PowerShell Flow Action.
However, I am interesting if we can call a Python in the MID if it's on Linux OS?
Any thoughts/ideas?
Thanks,
Alex.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 08:01 PM
Hi @alexgg57 ,
To execute python on MID Server, you can generate the ECC Queue record to invoke python script using the following code snippet:
var agent = "mid.server.MID_Server";
var eccQueue = new GlideRecord('ecc_queue');
eccQueue.initialize();
eccQueue.agent = agent; // replace with your MID server name
eccQueue.topic = 'Command';
eccQueue.queue = 'output'; // for an output record
eccQueue.state = 'ready'; // state must be 'ready'
// specify parameters in the payload
// skip sensor: skip_sensor
eccQueue.payload = '<parameters><parameter name="name" value="<path_to_your_python.exe> <path_to_your_python_file.py>"/><parameter name="skip_sensor" value="true"/></parameters>';
var sysId = eccQueue.insert();
Please remember to install Python on your Linux server, and specify the correct path in above code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 04:49 PM
You will have to activate the plugin Integrationhub with standard package. That will provide the spoke for powershell and SSH enablement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 08:01 PM
Hi @alexgg57 ,
To execute python on MID Server, you can generate the ECC Queue record to invoke python script using the following code snippet:
var agent = "mid.server.MID_Server";
var eccQueue = new GlideRecord('ecc_queue');
eccQueue.initialize();
eccQueue.agent = agent; // replace with your MID server name
eccQueue.topic = 'Command';
eccQueue.queue = 'output'; // for an output record
eccQueue.state = 'ready'; // state must be 'ready'
// specify parameters in the payload
// skip sensor: skip_sensor
eccQueue.payload = '<parameters><parameter name="name" value="<path_to_your_python.exe> <path_to_your_python_file.py>"/><parameter name="skip_sensor" value="true"/></parameters>';
var sysId = eccQueue.insert();
Please remember to install Python on your Linux server, and specify the correct path in above code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 07:29 AM
Thank you!