hxbsy has asked for the wisdom of the Perl Monks concerning the following question:
ping 192.168.63.121
PING 192.168.63.121: 56 data bytes, press CTRL_C to break
Reply from 192.168.63.121: bytes=56 Sequence=1 ttl=60 time=4 ms
Reply from 192.168.63.121: bytes=56 Sequence=2 ttl=60 time=14 ms
Reply from 192.168.63.121: bytes=56 Sequence=3 ttl=60 time=1 ms
Reply from 192.168.63.121: bytes=56 Sequence=4 ttl=60 time=2 ms
Reply from 192.168.63.121: bytes=56 Sequence=5 ttl=60 time=1 ms
--- 192.168.63.121 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/4/14 ms
<h3c>
Can I get the "0.00% packet loss"? I want to know peer ip is alive or not.
now my code as following:
$consoleprompt = 'yes\/no|assword|[\$#>\]]$|[\$#>\]] $|>.$|].$'; $ssh->send("ping $ip"); $ssh->waitfor($consoleprompt,5); $prematch=$ssh->before(); $ssh->waitfor($consoleprompt,5);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to use "$ssh->before()"
by vinoth.ree (Monsignor) on Apr 15, 2015 at 11:10 UTC | |
by ww (Archbishop) on Apr 15, 2015 at 11:59 UTC | |
|
Re: How to use "$ssh->before()"
by ww (Archbishop) on Apr 15, 2015 at 10:42 UTC | |
by vinoth.ree (Monsignor) on Apr 15, 2015 at 10:53 UTC | |
by hxbsy (Novice) on Apr 15, 2015 at 12:53 UTC |