1 <% objToJson($return) %>
4 my $conf = new FS::Conf;
6 my $sub = $cgi->param('sub');
8 die "$sub not supported" unless $sub eq 'ping';
10 my $ip = $cgi->param('arg');
12 my $ping = new Net::Ping('external', 5);
14 #my $a=time; warn "pinging\n";
15 my ($ret, $duration, $ip2) = $ping->ping($ip);
16 #warn "done pinging (". int(time-$a). "s)\n";
18 my $return = [ $ret, $duration ];