Help with Ping command for windows Box


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with Ping command for windows Box
# 1  
Old 02-16-2010
Help with Ping command for windows Box

Hi,

I would like to write a script for checking the windows remote server has responding or not from Unix box.

123.34.56.222-- the windows remote server

I wrote like:
Code:
ping 123.34.56.222

PING 123.34.56.222: 64 byte packets
64 bytes from 123.34.56.222: icmp_seq=0. time=8. ms
64 bytes from 123.34.56.222: icmp_seq=1. time=6. ms
64 bytes from 123.34.56.222: icmp_seq=2. time=6. ms
64 bytes from 123.34.56.222: icmp_seq=3. time=6. ms
64 bytes from 123.34.56.222: icmp_seq=4. time=6. ms
64 bytes from 123.34.56.222: icmp_seq=5. time=5. ms
64 bytes from 123.34.56.222: icmp_seq=6. time=6. ms
64 bytes from 123.34.56.222: icmp_seq=7. time=5. ms
........
.....

Can u tell me how can i verify is the window server is responding or not from UNIX.

I am using HP-UX prd02 B.11.11 U 9000/800 box.

Last edited by Franklin52; 02-16-2010 at 08:23 AM.. Reason: Please use code tags!
# 2  
Old 02-16-2010
You could use the return code:
man page
Quote:

RETURN VALUE
ping exits with one of the following values:

0 On success.

1 On failure such as unknown host, illegal packet size, etc.

2 On a unreachable host or network.

AUTHOR
ping was developed in the Public Domain.

FILES
/etc/hosts

SEE ALSO
getaddrinfo(3N), gethostent(3N), inet(3N), inet6(3N).

Hewlett-Packard Company - 4 - HP-UX 11i Version 1: Jul 2002
e.g. :
(xpvbe is my XP-PC, mil1 is a removed box (but still in /etc/hosts by the look of things...) ...)
Code:
ant:/home/vbe $  ping mil1 -n4;echo $?
PING mil1: 64 byte packets

----mil1 PING Statistics----
4 packets transmitted, 0 packets received, 100% packet loss
2
ant:/home/vbe $ ping xpvbe -n4;echo $?      
PING xpvbe: 64 byte packets
64 bytes from XXX.YY.13.85: icmp_seq=0. time=1. ms
64 bytes from XXX.YY.13.85: icmp_seq=1. time=0. ms
64 bytes from XXX.YY.13.85: icmp_seq=2. time=0. ms
64 bytes from XXX.YY.13.85: icmp_seq=3. time=0. ms

----xpvbe PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 0/0/1
0
ant:/home/vbe $ 
ant:/home/vbe $ uname -mlr
B.11.11 9000/800 unlimited-user license

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

How to access redhat Linux box graphically from windows box?

Hi I have a linux box and need to access from windows graphically # uname -a Linux pc-l416116 2.6.18-155.el5 #1 SMP Fri Jun 19 17:06:47 EDT 2009 i686 i686 i386 GNU/Linux What components do I need to install on Linux and windows to do that? TIA (6 Replies)
Discussion started by: magnus29
6 Replies

2. Red Hat

Can't ping my unix box by name

Hi All, I have recently setup a Windows 2003 server as AD / Domain Controller. In it, I have a VMWare for RHEL 4. I have 3 other computers connected to the network all using Windows 7. These computers can ping each other by name. But none of these can ping the Unix OS in the VMWare of the... (5 Replies)
Discussion started by: adshocker
5 Replies

3. Shell Programming and Scripting

ftp file starting with particular name on Windows box to Unix box using shell script

Hello all ! I'm trying to write a shell script (bash) to ftp a file starting with particular name like "Latest_" that is present on a Windows box to UNIX server. Basically I want to set this script in the cron so that daily the new build that is posted on the Windows box can be downloaded to the... (2 Replies)
Discussion started by: vijayb4u83
2 Replies

4. UNIX for Dummies Questions & Answers

I need an scp command from a unix box to a windows box.

scp file="myfile.txt" todir="user@somehost:(M:drive:/somepath/)"/ Not sure I need it to go to a specific drive on the windows box (1 Reply)
Discussion started by: xgringo
1 Replies

5. Shell Programming and Scripting

Moving files from Unix box to a windows box

Hi All, I need a little help .I want to transfer a file from unix box to a windows box,but the problem i'm facing is that in windows box FTP is not enabled and currently it is nearly impssible to change setting on windows box,i can not use the ftp method ,in my shell script to transfer the file.... (2 Replies)
Discussion started by: Preet
2 Replies

6. Shell Programming and Scripting

FTPing from unix box to windows box.

Hi All, I need to know if it is possible ftping files from unix box to windows box . if yes , how ?. Is there any pre-requisits. Please tell me the steps, this is very urgent. Thnx Aru (8 Replies)
Discussion started by: aarora_98
8 Replies

7. Linux

Can't SSH / ping Linux box !!!

I have a linux box build11 which can be pinged from build18 (Windows) box. And we can only login to the box (using SSH) from build18 box. Plz help to characterize the problem, network, DNS, DHCP, etc (or whatever which I am unsure) Any idea what may be the reason ? :confused: Thanks in... (4 Replies)
Discussion started by: csaha
4 Replies

8. Shell Programming and Scripting

Script to Reboot a linux box from a windows box

HI All, I need a script to reboot a linux box from a windows box. The script needs to run automatically whenever a sitescope alerts with an error message. Have searched for this in the forums, but could not get something relative. Pls. let me know the various alternatives we have to do... (2 Replies)
Discussion started by: Crazy_murli
2 Replies

9. Shell Programming and Scripting

executing *.bat file on windows from Unix box via ftp command

I have created get_list.bat file containing following line: dir /B /O-d >file_list.txt I am executing ftp command from Unix box and transferring get_list.bat file to windows server. In my next ftp command I am trying to execute this test.bat file by entering this line: get_list or by... (9 Replies)
Discussion started by: alx
9 Replies

10. UNIX for Advanced & Expert Users

VPN client (windows Box),and Server (Unix Box)

If I want to access unix box via VPN tunnel,from windows box. What sould I configure on the windows client PC, and what should I enable on the Unix Server box ? I am using Solaris V10 intel platform, and I am using windows XP, and 2003 for client (0 Replies)
Discussion started by: zillah
0 Replies
Login or Register to Ask a Question