#!/usr/bin/perl
@HOSTS = ("192.168.14.112", "192.168.14.90", "192.168.160.1", "192.168.160.100");
my $COUNT = 4;
my $date =`date`;
for my $myHost (@HOSTS) {
**$count = `ping -c $COUNT $myHost | grep 'received' |awk -F',' '{ print $2 }' |awk '{ print $1 }'`;**
if ( $count == 0 ){
print "Host : $myHost is down (pint failed) at $date \n";
}
#else {
#print "\n Host : $myHost is up at $date \n";
#}
}
I have set of ip, i want to check the status of given ip but i stuck in execute linux command inside the perl .
$count = ping -c $COUNT $myHost | grep 'received' |awk -F',' '{ print $2 }' |awk '{ print $1 }'
;
i'm not able to get proper output through given command