ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » List Client Connections

Post new topic  Reply to topic
 List Client Connections « View previous topic :: View next topic » 
Author Message
brian_r
PostPosted: Tue Jan 06, 2009 8:41 am    Post subject: List Client Connections Reply with quote

Apprentice

Joined: 28 Jan 2008
Posts: 31
Location: Dublin

Hi all,

Ive recently changed our config to use a listener (runmqlsr) instead of the old inetd.conf.

Previously I could list the amount of client connections on the server by listing all the amqcrsta processes(HPUX):

ps -ef|grep amqcrsta

Now, using the listener there is only one process, is there any way I can list all client connections now.

Ive tried to listing all the connections through the port:

netstat -an|grep 1414

but its not as accurate as the previous PS way. Havent found anything in the docs about this or on the net, any advice would be much appreciated, thanks in advance.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jan 06, 2009 8:43 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Moved to correct section
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jan 06, 2009 8:44 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

DIS CONN() should help.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jan 06, 2009 8:44 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

If they're client connections, you could enquire against the SVRCONN
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
brian_r
PostPosted: Thu Jan 08, 2009 2:23 am    Post subject: Reply with quote

Apprentice

Joined: 28 Jan 2008
Posts: 31
Location: Dublin

Thanks for the speedy response.

Ive been looking at DIS CONN(). Ive got a large amount of client connections which are slightly unreadable through this.

I can also see a few amqrmppa processes created for all the client connections, so I can get all my connections by sorting by PID of the amqrmppa processes created. But is there any way of performing a count through DIS CONN(). i.e. dis number of connections

Thanks in advance
Back to top
View user's profile Send private message
KramJ
PostPosted: Fri Jan 09, 2009 10:00 am    Post subject: Reply with quote

Voyager

Joined: 09 Jan 2006
Posts: 80
Location: Atlanta

Here's a perl script that works fairly well:

#!/usr/bin/perl -w
#
# Written by: Mark Johnson 12/19/2006
#
# Description:
# This script is used to view active MQ connection counts, SVRCONN connection counts,
# and SVRCONN connection counts by host.
#
# Usage:
# ./MQConnections.pl

use strict;
if(!$ARGV[0]){
print "usage: MQConnections.pl <QMGR>\n";
exit 1;
}
my $qmgr = $ARGV[0];

my (@svrconn, @chName, $flag, @active, @chan, @IP, @stat);
my $runmqsc = `echo "dis chs(*)"|/usr/bin/runmqsc $qmgr`;
my @cons = split /AMQ8417: Display Channel Status details./, $runmqsc;
print "\n";
for(my $i = 1; $i < @cons; $i++){
if($cons[$i] =~ m/SVRCONN/){
push(@svrconn, $i);
}
}
print "Active channels: " . scalar @cons . "\nActive SVRCONN channels: " . scalar @svrconn . "\n\n";
for(my $i = 0; $i < @svrconn; $i++){
($chan[$i], $IP[$i], $stat[$i]) = (split /\s+/, $cons[$svrconn[$i]])[1,3,7];
$chan[$i] =~ s/CHANNEL\(//;
$chan[$i] =~ s/\)//;
$IP[$i] =~ s/CONNAME\(//;
$IP[$i] =~ s/\).*//;
$flag = 0;
for(my $j = 0; $j < @chName; $j++){
if($chan[$i] eq $chName[$j]){
$flag = 1;
}
}
if(!$flag){
push(@chName, $chan[$i]);
}
}
for(my $k = 0; $k < @chName; $k++){
print "$chName[$k]: ";
my @count;
for(my $l = 0; $l < @chan; $l++){
if(($chName[$k] eq $chan[$l]) && ($stat[$k] =~ m/RUNNING/)){
push(@count, $l);
}
}
my @hostIP;
my $count = 0;
print scalar @count . "\n";
for(my $m = 0; $m < @count; $m++){
$flag = 0;
for(my $n = 0; $n < @hostIP; $n++){
if($hostIP[$n] eq $IP[$count[$m]]){
$flag = 1;
}
}
if(!$flag){
push(@hostIP, $IP[$count[$m]]);
}
}
for(my $n = 0; $n < @hostIP; $n++){
my @count2;
for(my $o = 0; $o < @count; $o++){

if($IP[$count[$o]] eq $hostIP[$n]){
$count2[$n]++;
}
}
my $host = `nslookup $hostIP[$n] 2>/dev/null`;
$host = (split /\n/, $host)[3];
if(!$host){
$host = "";
}
$host = (split /\s+/, $host)[1];
if(!$host){
$host = "";
}
$host = (split /\./, $host)[0];
if(!$host){
$host = "unknown";
}
print "\t$host ($hostIP[$n]): $count2[$n]\n";
}
}
print "\n";
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Jan 09, 2009 10:18 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

The MO71 Support Pack easily shows this along with a count.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » List Client Connections
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.