How to check the status of a process controlled by Supervisor in Python

I have configured Supervisor and am tracking some applications. Now I would like to use python to check the status of the monitored application and display it in my interface.

I would rather not do something like

import subprocess p = subprocess.Popen(['supervisorctl', 'status app'], stdout=subprocess.PIPE) status = p.communicate()[0].split()[1] print status 

Is there any way to do this using any python admin API?

+5
source share

Source: https://habr.com/ru/post/1233103/


All Articles