title: Monitor background process from website
body: <p>I have a website on which people can request certain files to be processed, the processing is done on my server and then the processed files are made available to download. I'd like to enable administrators of my website to see from the website whether or not the processing code is running, has failed, is waiting, etc.</p>
  
  <p>So I imagine I'd like to just have a line on the webpage that says "Waiting", "Active", "Failed", etc. I expect it would use php.</p>
  
  <p>That's the general outline, in particular this is how my system works:</p>
  
  <p>• When a user chooses a processing job it is added to a mysql database using php.</p>
  
  <p>• A python code called monitor_database.py is running in a screen instance, it monitors the database and starts the appropriate processing job when it notices that the database has a new request in it.</p>
  
  <p>• Once the processing has been completed the database is updated.</p>
  
  <p>So I'd like to be able to see from my webpage whether or not the screen session and my monitor_database.py are running, and whether or not monitor_database.py has sent anything to be processed, or is waiting.</p>
  
  <p>Has anyone any suggestions about how best to achieve this?</p>