/[pxelator]/lib/PXElator/ping.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/ping.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 330 by dpavlin, Fri Aug 28 22:29:08 2009 UTC revision 332 by dpavlin, Fri Aug 28 22:51:45 2009 UTC
# Line 6  use strict; Line 6  use strict;
6  use Net::Ping;  use Net::Ping;
7  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
8  use Time::HiRes;  use Time::HiRes;
9    use client;
10    
11  sub host {  sub host {
12          Net::Ping->new->ping( shift, 0.7 );          Net::Ping->new->ping( shift, 0.7 );
# Line 31  sub fping { Line 32  sub fping {
32    
33          while (my ($host,$rtt,$ip) = $p->ack) {          while (my ($host,$rtt,$ip) = $p->ack) {
34                  $status->{$ip}->{rtt} = $rtt * 1000; # ms                  $status->{$ip}->{rtt} = $rtt * 1000; # ms
35                    warn "# $host $rtt $ip\n";
36                    client::conf( $ip => 'hostname', default => $host ) if $host ne $ip;
37          }          }
38    
39          warn dump($status);          warn dump($status);

Legend:
Removed from v.330  
changed lines
  Added in v.332

  ViewVC Help
Powered by ViewVC 1.1.26