I wonder if anyone can help me web enhance a python script which runs a status command for various apps:
/app/app1/bin/status.sh
/app/app2/bin/status.sh
A check() function in the script creates a hash:
results = check_function()
results['app1']['status'] = 'running'
results['app2']['status'] = 'stopped'
My current solution is terminal only and a display_results() function prints the status of the environment to the terminal with appropriate escape sequences to colorize it:
display_results(results)
I'd like to "web enable" the command so that it can have report the results dictionary over the web.
I'm thinking I can just have it listen on a socket and write HTML through a string template or would it be better to have BaseHTTPServer do the listening but how to get it to serve the output of a command rather than the index.html file on a filesystem?
This is not a production application it's used as a tool for developers to do a mass check on the status of an app.
The terminal version works with python 2.4 (Centos 5.8) but there's nothing to stop me from using python 2.7
Any suggestions?