#!/usr/bin/perl -w $host = "X.X.X.X"; $user = "user"; $foo = 0; open(IN, "ssh $user\@$host ps -xwww |"); while () { print; chomp; if (/^FORK\ Playout\ Server.app$/) { print "Playout server is on\n"; } if (/^Mediaplaye$/) { print "Mediaplayer 02 is on\n"; } if (/^FORK\ Mediaplayer\ 02.app$/) { print "Mediaplayer 02 is on\n"; } if (/^FORK\ Mediaplayer\ 01.app$/) { print "Mediaplayer 01 is on\n"; } $foo++ if (/^FORK Device Server.app$/); # if (/^"FORK\ Device\ Server.app$/) { # print "Device Server is on\n"; # } } close(IN); print $foo;