$ for i in `cat hosts_list`; do RES=`ssh myusername@${i} "ps -ef " |awk '/[p]rocessname/ {print $2}'`; test "x${RES}" = "x" && echo $i; doneGiven a hosts list, ssh one by one and echo its name only if 'processname' is found running.
by David Winterbottom (codeinthehole.com)
from All commands http://ift.tt/1rEKEkw
No comments:
Post a Comment