Zitat:
Original geschrieben von _m3
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();
Output:
20020912 16:43:15 www.wcm.at up packet return time: 342.89 ms
|
schneller geht es, wenn du einfach eine bat datei schreibst.
sind 5 zeilen und schon funkt das ganze.
habe ich bei uns im büro auch einmal rennen gehabt, wie ein switch hin war bei uns.
gruss
chris