#!/usr/local/perl -w #set modules to use use Net::Ping; use Net::SSH::Perl; use Net::OpenSSH; use Net::SMTP; use DBI; $ENV{'MYSQL_UNIX_PORT'} = '/tmp/mysql.sock'; $ssh = Net::OpenSSH->new("$hostnames[$testcount]", user => $username, password => $password, master_stderr_discard => 1) || warn("\$!\n"); $out = $ssh -> capture ("show interfaces $interface[$routercom] | include BW"); print LOGONE $out; close (LOGONE);