Web Application for Script Monitoring

Asked

Viewed 304 times

0

What is the best way to monitor the execution of a script? I have a.py script that needs to be running "endlessly", and I would like to know if it is running or not. I would like a web application to do this monitoring, and if it closes, I can run it through this application. Is there a freamework that does something similar?

  • In short, you need a service. This web application to trigger a script that must have its own independent life cycle is a bit of a scam. It seems to me that you are a crack coconuts using cannons

  • exact, I will turn this script into a service. Thank you

1 answer

1


You can use the Django, it is all very simple and easy to make a web application. With Django you create your web interface to monitor and activate the script.

Django already has a built-in authentication system so you can create a secure interface without work.

With your webapp ready, within the loop of your script you can call a method/function that sends a POST to the webapp "saying it’s okay"

If you wanted a 100% automated process together with Django you can use Celery and create periodic tasks that checks if the script is sending the "all right" if it is not you automatically configure to re-run the script.

You can even go further and use the databases to record logs etc.

  • Well, your idea of using a task in Celery to check whether it’s running or not opened my mind, thank you kk. Using Django I think is not feasible I’m thinking of using a microframework same, like Flask

  • For me Dan is natural and practical, I like the flask but that Dan is already ready without pain ahaha. But the flask is good and simple use it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.