How do I go about checking that a certain process is running in another box and return a value? For example, if I wanted to check that process 'FTP' is running in 192.168.1.1 from box 192.168.1.2, how would I return a success flag? I would like to incorporate a script that would check a certain process is running within a cluster of servers.
I tried to come up with something without much success:
for i in 'cat server_list.txt'; do ssh $i "ps -ef | grep ftp = process; if [ $process -eq 1] then echo "ftp process is running" fi"
I would like to have a return letting me know that the 'ftp' process is running. There are a list of servers IP in the server list text file.