Web2py - How would I monitor an existing running script?

24 views
Skip to first unread message

Simon Dreyer

unread,
Jan 21, 2020, 1:55:28 AM1/21/20
to web2py-users
Hi Folks, I have an existing python application that reads data from industrial controllers and publishes it to a message queue. The application is currently headless and logs errors and events to a log file. I would like to add a web interface to the application so that I can log into the app at any time and check the status while it is running. All the web2py examples that I have seen seem to load/run a python script when the user invokes a view, how would I invoke a connection to a script that is already running please?

Dave S

unread,
Jan 21, 2020, 3:57:56 AM1/21/20
to web2py-users


On Monday, January 20, 2020 at 10:55:28 PM UTC-8, Simon Dreyer wrote:
Hi Folks, I have an existing python application that reads data from industrial controllers and publishes it to a message queue. The application is currently headless and logs errors and events to a log file. I would like to add a web interface to the application so that I can log into the app at any time and check the status while it is running. All the web2py examples that I have seen seem to load/run a python script when the user invokes a view, how would I invoke a connection to a script that is already running please?

The first idea I have is just to return the latest entries from the log file. 

If your control application is polling the controllers, you can set up something else for it to poll, and put something there with the web app, and issue a response to it.

If you control application is being pinged by the controllers, perhaps you can use a socket to ping it from the web app.

Much beyond that handwaving response would require knowing more about the existing architecture.

/dps

Reply all
Reply to author
Forward
0 new messages