[BangPypers] checking return status of 'ping' in windows
nikunjbadjatya at gmail.com
Sat Jan 21 19:57:28 CET 2012
Telnet service is not running and not in my hands to start it. Its a
Virtual Machine basically.
On Sun, Jan 22, 2012 at 12:21 AM, Noufal Ibrahim <noufal at nibrahim.net.in>wrote:
> Nikunj Badjatya <nikunjbadjatya at gmail.com> writes:
> > Now,
> > I was expecting the "status" in above snippet to hold '0' only in case of
> > no. 3)
> > But even when we have case 1), 'status' is holding '0'.
> > i.e. The exit status of ping is 0, even when destination host is
> > unreachable.!
> > How do I make my snippet to work as desired. i.e even if destination host
> > is unreachable, 'status' should hold '1' and hold '0' only when it gets
> > reply from that ip address.??
> You could grep the output of ping to check what happened but this is a
> clumsy way of doing this. Isn't there some service running on the remote
> machine that you can telnet to to ascertain whether it is up or not
> rather than spawning ping an checking its output status?
> All generalisations are dangerous, including this one.
> BangPypers mailing list
> BangPypers at python.org
More information about the BangPypers