X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fconnect.pl;h=025c20ea9a29f37c3bdf72a7d6436b059a532e65;hb=d4aacffb5581c9fc338833aebc996c27d3f16ada;hp=708113769fbb74008d17b6c8c493efd4909233ef;hpb=70928ea2832755c4bcd8f4d04fc0acc3861a4496;p=spider.git diff --git a/cmd/show/connect.pl b/cmd/show/connect.pl index 70811376..025c20ea 100644 --- a/cmd/show/connect.pl +++ b/cmd/show/connect.pl @@ -11,22 +11,29 @@ return (1, $self->msg('e5')) if $self->priv < 1; my @out; my $count; -push @out, "Cnum Call Address/Port State Type Dir."; +push @out, "Cnum Call Address/Port State Type Dir. Module"; foreach my $call (sort keys %Msg::conns) { my $r = $Msg::conns{$call}; - my $addr = "$r->{peerhost}/$r->{peerport}"; my $c = $call; - if ($c =~ /^Server\s+(\S+)$/) { + my $addr; + + if ($c =~ /^Server\s+(\S+)/) { $addr = $1; $c = "Server"; + } else { + $addr = "AGW Port ($r->{agwport})" if exists $r->{agwport}; + $addr ||= "$r->{peerhost}/$r->{peerport}"; + $addr ||= "Unknown"; } - push @out, sprintf(" %3d %-9s %-27.27s %3s %7s %8s", + my $csort = $r->{csort} || ''; + my $sort = $r->{sort} || ''; + push @out, sprintf(" %3d %-9s %-27.27s %3s %7s %8s %-8s", $r->{cnum}, $c, $addr, $r->{state}, - $r->{csort}, $r->{sort}); + $csort, $sort, ref $r); $count++; } -push @out, "$count Connections"; +push @out, "$count Connections ($Msg::noconns Allocated)"; return (1, @out);