Problem mit Net::Ping (Perl)

Perluser

Perluser

Aktives Mitglied
Thread Starter
Dabei seit
08.10.2008
Beiträge
168
Reaktionspunkte
1
Moin,

ich sitze gerade hier und möchte einfach mal ein kleines Script schreiben, das eine Seite anpingt und das Ergebnis zurück gibt, nur iwie kann er den Host nicht erreichen, obwohls im Browser geht. Weiß vielleicht jemand das Problem?

Hier das Script (Ja, ich weiß, dass ich kein "use strict" benutze, aber bei so einem kleinen Script ist das denke ich nich nötig):

Code:
#!/usr/bin/env perl

use Net::Ping;

$p = Net::Ping->new();
$host = 'ccc.de';
$success_flag = $p->ping($host, 2);
print "$success_flag\n";

if ($success_flag) {
	print "Ping succesful\n";
}
else {
	print "Internet is fucked up\n";
}

$p->close()

Vielen Dank,

Perluser
 
Anstatt
Code:
$p = Net::Ping->new();
das:
Code:
$p = Net::Ping->new("icmp");

"You may choose one of six different protocols to use for the ping. The "tcp" protocol is the default."


nur iwie kann er den Host nicht erreichen, obwohls im Browser geht.
"Note that a live remote host may still fail to be pingable by one or more of these protocols. For example, www.microsoft.com is generally alive but not "icmp" pingable."
Net-Ping-2.36
 
Zurück
Oben Unten