reen
reen

Reputation: 2502

Run Commands on remote Servers from a Webapplication

I have the following problem: I have to run commands on remote servers from within a web application (play), but from the web server I have no ssh access to the remote servers. The only thing I have is, that the remote servers have access to the web server via http(s).

My idea was to create a python daemon, that polls a URL which returns the requested commands via JSON.

Is that a good idea? Is there a framework that could help here on the clients?

BR Rene

Upvotes: 2

Views: 1240

Answers (2)

Burhan Khalid
Burhan Khalid

Reputation: 174662

My idea was to create a python daemon, that polls a URL which returns the requested commands via JSON.

This is essentially a message broker. So instead of writing one yourself, use any of the available message brokers such as rabbitmq that have bindings for Java and whatever language you are going to run on the target server.

From your web server, dispatch a message to the broker. This would trigger a worker on the target server to "wake up" and do some task. You can then optionally fetch the result across the message broker as well, or write it to some common store (like update some k/v store, or write to a common database).

Upvotes: 3

Andrew_1510
Andrew_1510

Reputation: 13546

It seems you can do remote calls with pyro, you can call remote python object. Python Remote Objects is a distributed object system written entirely in Python, and for use in Python only. It is small, simple and free. Check it here: pyro

Upvotes: 0

Related Questions