How to execute files located on a Linux server that does not have Agent from Scheduled Script.

KS18
Giga Guru

There is a linux server that does not have the Agent.
It is not a MID server, so I don't think I can use ECCqueue.
I want to run a python file that is located on that server from Scheduled Script.
Is there any documentation on how to execute?

6 REPLIES 6

Hitoshi Ozawa
Giga Sage
Giga Sage

Why not just execute the python script using cron on the linux server?

I'm actually using Jenkins to control all jobs outside of ServiceNow and only using ServiceNow's Scheduled Script to execute scripts inside ServiceNow.

Thank you for your comment.

I want to pass the result of getting the data from ServiceNow to that python script.
So I was thinking of using the Scheduled Script in ServiceNow to get the data and pass it to the python script to run.

If I use cron on the linux server to execute the python script, I think I need to create a Scripted API to get the data from ServiceNow.

I'm actually not sure if I should use a linux server or a MID server.

In that case, a shell script on the mid server to execute the linux server running python will be necessary.

Following page helped me when I've set it up in my instance.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0754843

http://www.john-james-andersen.com/blog/service-now/command-line-execution-with-servicenow-mid-serve...

I apologize for the lack of explanation.
Actually, I am in a situation where I can choose to use either the MID server or the Linux server.
However, the only thing that remains the same is that both servers use python files.
What I want to do is to get the data from ServiceNow and process it in a python file.
If I will using a MID server, you would use Scheduled Script to register with ECCqueue and then execute the python file.
If I will using a Linux server, you will use ServiceNow's Scripted API to execute from a python file.
I am not sure which of these two methods is better.

By the way, regarding the following article you taught me.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0754843
Is it possible to pass arguments to the batch file?