RT# 75817 - updated UI to be more intuitive
[freeside.git] / httemplate / misc / xmlhttp-ping.html
1 <% encode_json($return) %>\
2 <%init>
3
4 my $conf = new FS::Conf;
5
6 my $sub = $cgi->param('sub');
7
8 die "$sub not supported" unless $sub eq 'ping';
9
10 my $ip = $cgi->param('arg');
11
12 my $ping = new Net::Ping('external', 5);
13 $ping->hires(1);
14 #my $a=time; warn "pinging\n";
15 my ($ret, $duration, $ip2) = $ping->ping($ip);
16 #warn "done pinging (". int(time-$a). "s)\n";
17
18 my $return = [ $ret, $duration ];
19
20 </%init>