Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is working as expected, i just wanted to check different processes on different servers, i use to login to server by putty via ssh for verifying processes for a single server.in order to verify different processes on different unix servers, please suggest me the way to do this.use strict; my @pslist = ("ps -ef|grep psname=abc","ps -ef|grep psname=def",...,); foreach my $ps(@pslist) { print "Checking for the Process,"; my $ps1 = `$ps`; if($ps1 =~ /psname=abc/) { print "\"abc\" is running Fine\n"; } elsif($ps1 =~ /psnameame=def/) { print "\"def\" is running fine\n"; } elsif($ps1 =~ /psname=xyz/) { print "\xyz\" is running Fine\n"; } else { print "None of the processes are running\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to automate login to different servers via ssh and check is some specific processes are running or not.
by keszler (Priest) on Dec 12, 2014 at 15:37 UTC | |
|
Re: How to automate login to different servers via ssh and check is some specific processes are running or not.
by Anonymous Monk on Dec 12, 2014 at 12:46 UTC | |
by Anonymous Monk on Dec 12, 2014 at 12:56 UTC | |
by Anonymous Monk on Dec 12, 2014 at 13:11 UTC | |
by Anonymous Monk on Dec 12, 2014 at 13:50 UTC | |
by Anonymous Monk on Dec 18, 2014 at 08:55 UTC |