![]() |
![]() |
|
|
|||||||
| Netzwerke Rat & Tat zu Netzwerkfragen und -problemen |
|
|
Themen-Optionen | Ansicht |
|
|
#9 |
|
Inventar
![]() Registriert seit: 24.09.2001
Beiträge: 7.335
|
Perl installieren und das benutzen:
Code:
#!/usr/bin/perl -w
# pong.pl
use strict;
use Net::Ping;
use Time::HiRes;
my $host = 'www.wcm.at';
my $p = Net::Ping->new();
$p->hires();
my ($ret, $duration, $ip) = $p->ping($host, 5.5);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
printf("%4.4d%2.2d%2.2d %2.2d:%2.2d:%2.2d\t$host\t", (1900+$year), $mon+1, $mday, $hour, $min, $sec);
print (($ret) ? "up" : "down");
printf( "\tpacket return time: %.2f ms\n", 1000 * $duration);
$p->close();
20020912 16:43:15 www.wcm.at up packet return time: 342.89 ms
____________________________________
Weiterhin zu finden auf http://martin.leyrer.priv.at , http://twitter.com/leyrer , http://www.debattierclub.net/ , http://www.tratschen.at/ und via Instant Messaging auf Jabber: m3 <ät> cargal.org . |
|
|
|
| Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1) | |
|
|