To check if my servers have any extra process that shouldn’t be running I did a quick script
for i in `seq 1 10`; do ssh my-machine$i.tomtom.com -t "pgrep -f celery -c"; done
Let’s break it down
for i in `seq 1 10`is generating a forloop for us from 1 to 10
ssh my-machine$i.tomtom.com -twill ssh into each machine from 1 to 10, the
-tmeans it will create a terminal to execute the next command
pgrep -f celery -cwill count all the processes that have the word celery in it and output the number.