sub run_command {
my $user = 'gmon';
my $system = shift;
my $protocol = 'ssh';
my $ssh_flags = "-l $user";
my $command = "statvv -ni";
my $space = " ";
my $do_command = $protocol . $space . $ssh_flags . $space . $system . $space . $command;
print "Running [$do_command]\n";
my $cmd = IO::Pipe->new;
$cmd->reader($do_command);
return $cmd;
}
####
sub run_command {
my $user = 'gmon';
my $system = shift;
my $protocol = 'ssh';
my $ssh_flags = "-l $user";
my $command = "statvv -ni";
my $do_command = "$protocol $ssh_flags $system $command";
print "Running [$do_command]\n";
open my $fh, "$do_command |";
return $fh;
}
####
sub run_command {
my $user = 'gmon';
my $system = shift;
my $protocol = 'ssh';
my $ssh_flags = "-l $user";
my $command = "statvv -ni";
my $do_command = "$protocol $ssh_flags $system $command";
print "Running [$do_command]\n";
my @results = `$do_command`;
return @results
}