Traceroute & Ping 
Author Message
 Traceroute & Ping

Working with a new program for the above topic. Here is the link
http://www.*-*-*.com/
When you are there place a domain name or ip in the field and select do it. There will be information that will come up on the bottom ot the screen. The last 2 I am having problems with whcih are:
 Ping Results: Ping failed. Host may not be active.

Traceroute Results: Traceroute failed. Host may not be active.

Here is the code for those 2 items, you will see the path included in the code. This path is correct based on the fact that I can run the traceroute and ing from shell on the server. So there is something wrong on missing from my coding. Hopefully someone can help me figure this out.

function p($target){
message("<p><b>Ping Results:</b><blockquote>");
if (! $msg .= trim(nl2br(`ping -c5 '$target'`))) #bugfix
  $msg .= "Ping failed. Host may not be active.";
$msg .= "</blockquote></p>";
message($msg);

Quote:
}

function tr($target){
message("<p><b>Traceroute Results:</b><blockquote>");
if (! $msg .= trim(nl2br(`/usr/sbin/traceroute '$target'`))) #bugfix
  $msg .= "Traceroute failed. Host may not be active.";
$msg .= "</blockquote></p>";
message($msg);

Quote:
}

#If the form has been posted, process the query, otherwise there's
#nothing to do yet

if(!$queryType)
  exit;

#Make sure the target appears valid

if( (!$target) ||
(!preg_match("/^[\w\d\.\-]+\.[\w\d]{1,3}$/i",$target)) ){ #bugfix
  message("Error: You did not specify a valid target host or IP.");
  exit;
  }

#Figure out which tasks to perform, and do them

if( ($queryType=="all") || ($queryType=="lookup") )
  lookup($target);
if( ($queryType=="all") || ($queryType=="dig") )
  dig($target);
if( ($queryType=="all") || ($queryType=="wwwhois") )
  wwwhois($target);
if( ($queryType=="all") || ($queryType=="arin") )
  arin($target);
if( ($queryType=="all") || ($queryType=="checkp") )
  checkp($target,$portNum);
if( ($queryType=="all") || ($queryType=="p") )
  p($target);
if( ($queryType=="all") || ($queryType=="tr") )
  tr($target);
?>

Thanks



Wed, 22 Sep 2004 00:09:51 GMT  
 Traceroute & Ping

fixed

  Working with a new program for the above topic. Here is the link
  http://www.realwebhost.net/trace.php
  When you are there place a domain name or ip in the field and select do it. There will be information that will come up on the bottom ot the screen. The last 2 I am having problems with whcih are:
   Ping Results: Ping failed. Host may not be active.

  Traceroute Results: Traceroute failed. Host may not be active.

  Here is the code for those 2 items, you will see the path included in the code. This path is correct based on the fact that I can run the traceroute and ing from shell on the server. So there is something wrong on missing from my coding. Hopefully someone can help me figure this out.

  function p($target){
  message("<p><b>Ping Results:</b><blockquote>");
  if (! $msg .= trim(nl2br(`ping -c5 '$target'`))) #bugfix
    $msg .= "Ping failed. Host may not be active.";
  $msg .= "</blockquote></p>";
  message($msg);
  }

  function tr($target){
  message("<p><b>Traceroute Results:</b><blockquote>");
  if (! $msg .= trim(nl2br(`/usr/sbin/traceroute '$target'`))) #bugfix
    $msg .= "Traceroute failed. Host may not be active.";
  $msg .= "</blockquote></p>";
  message($msg);
  }

  #If the form has been posted, process the query, otherwise there's
  #nothing to do yet

  if(!$queryType)
    exit;

  #Make sure the target appears valid

  if( (!$target) ||
  (!preg_match("/^[\w\d\.\-]+\.[\w\d]{1,3}$/i",$target)) ){ #bugfix
    message("Error: You did not specify a valid target host or IP.");
    exit;
    }

  #Figure out which tasks to perform, and do them

  if( ($queryType=="all") || ($queryType=="lookup") )
    lookup($target);
  if( ($queryType=="all") || ($queryType=="dig") )
    dig($target);
  if( ($queryType=="all") || ($queryType=="wwwhois") )
    wwwhois($target);
  if( ($queryType=="all") || ($queryType=="arin") )
    arin($target);
  if( ($queryType=="all") || ($queryType=="checkp") )
    checkp($target,$portNum);
  if( ($queryType=="all") || ($queryType=="p") )
    p($target);
  if( ($queryType=="all") || ($queryType=="tr") )
    tr($target);
  ?>

  Thanks



Wed, 22 Sep 2004 02:58:06 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Traceroute & Ping

2. PING / Traceroute Perl Script

3. Req: Traceroute module/script which doesn NOT use Unix traceroute

4. Req: Traceroute module/script which doesn NOT use Unix traceroute

5. Net::Ping & NT

6. Net::Telnet & Net::Ping

7. Net::Ping causing a die when trying to ping

8. Net::Ping - ping Linux host problem

9. Net::Ping won't ICMP ping under W32

10. ANNOUNCE: Net::Traceroute 0.9

11. color coded traceroute

12. Problem with Net::Traceroute

 

 
Powered by phpBB® Forum Software