The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
AIX - Cant ping Netghost AIX 1 10-03-2006 06:38 PM
Ping sam70 UNIX for Dummies Questions & Answers 1 08-03-2005 12:56 AM
ping csaunders AIX 1 04-24-2005 05:54 PM
ping -t jaber87 Shell Programming and Scripting 8 04-17-2004 12:58 PM
About Ping S.Vishwanath IP Networking 4 11-09-2002 10:06 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-12-2002
nemex nemex is offline
Registered User
  
 

Join Date: Sep 2001
Location: Johanessburg
Posts: 27
ping

Hi there hope list can help

I'm looking for a command that does the following

lets say i ping a server 00.00.000.00
and this server is up and running how do i get the ping command to return a UP or a Down

meaning
if the command is true do this
if the command is False do this

Regards
Nemex
  #2 (permalink)  
Old 12-12-2002
BSeanD's Avatar
BSeanD BSeanD is offline
Registered User
  
 

Join Date: Aug 2002
Location: Melbourne, Australia
Posts: 127
I'm not sure its as easy as that. I remember when I was using Linux I was able to block pings being returned giving the impression the machine was down/non-existant. I'm guessing you can do that in almost any OS.

You'd want to scan a system with something like nmap, if your using Unix, but of course that sort of thing is frowned upon if it's not your own machine.
  #3 (permalink)  
Old 12-12-2002
Kevin Pryke Kevin Pryke is offline
Registered User
  
 

Join Date: Feb 2002
Location: Bradford, UK
Posts: 70
To see if a ping has worked, check the return value ($?)

ie. something like
Code:
ping -c1 <server_name>
if [ $? -ne 0 ]
then
    echo "Not Found"
else
    echo "Found
fi
added code tags for readability --oombera

Last edited by oombera; 02-17-2004 at 03:12 PM..
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0