ping w/perl ????

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • erock34
    New Member
    • Aug 2006
    • 1

    ping w/perl ????

    Trying to ping a list of servers using ping, but I get a return on the unpingable servers. I want to get a list of unsuccessful pings only!!
    here is a sample...

    #!/usr/bin/perl
    use Net::Ping;



    my $p = Net::Ping->new(`tcp`);
    open (TT, "box3");
    while (<TT>) {
    $i=$_;
    chomp $i;
    $host = $i;
    $timeout = 3;
    chomp $host;
    print "$host is alive.\n" if $p->ping($host);
    } ### END OF WHILE STATEMENT

    any input,, greatly appreciated!!
  • vssp
    Contributor
    • Jul 2006
    • 268

    #2
    Hi friend

    i am not femilier with perl
    I hope this link helpfull for u

    Comment

    Working...