I have supervisorctl running with about 50 processes. Now I want to get the status of these processes on my website. My idea is to use on php exec(“sudo supervisorctl status”) and set the output to a array or something like that. I only need the first 2 colons.
process1 RUNNING pid 935, uptime 17386 days, 14:52:25
process2 RUNNING pid 936, uptime 17386 days, 14:52:25
process3 RUNNING pid 31907, uptime 0:00:09
What is the best way to do this.
You can use a regular expression to extract the first two fields in the outpu. Or you could use supervisorctl status | awk '{print $1, $2}'
Credits to @Barmar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With