3

I have a series of Python producers that are pulling in data from various sources. At the moment, I am starting each one manually via terminal, but I need to figure a more robust system. I'd like to create a local browser based dashboard that I can use to start / stop and monitor each of the Python processes.

So, using Ubuntu, how would I go about starting a python script as a system process as opposed to having to have a terminal window for each one?

Also, in order to monitor the status of each producer, I was planning on using a broker such as rabbitmq or reddis to log any changes / errors that I can monitor via the web dashboard. The problem I have is that if a producer crashes for whatever reason, it will still show as 'running' on the dashboard. Should I create some kind of supervisor that is responsible for spawning and monitoring each individual producer?

I'd appreciate any suggestions as to how I can achieve this.

Hanpan
  • 10,013
  • 25
  • 77
  • 115
  • Looks like you need a Web Application. Take a look at Django, then you could put all your scripts into the Django project and control them via browser. (or not?) – heltonbiker Oct 17 '11 at 11:58

1 Answers1

3

Looks like you want to create Daemons with Python. Please refer to the following answer to understand how to write them in Python: How do you create a daemon in Python?

For the "Monitoring" thing you can implement something that will check if the PID written in the PID File is alive, that you can do by using psutil as 'rpInt' suggested.

Community
  • 1
  • 1
0xd
  • 1,891
  • 12
  • 18