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 » identyfing users in mqm group

Post new topic  Reply to topic
 identyfing users in mqm group « View previous topic :: View next topic » 
Author Message
tkane
PostPosted: Fri Apr 02, 2004 8:41 am    Post subject: identyfing users in mqm group Reply with quote

Voyager

Joined: 23 Dec 2002
Posts: 82
Location: Kansas City

Hello,
My quest today is to figure out who all is in the mqm group on several (hundred) AIX, Solaris and HP machines.

I thought I had a good script for this in which I greped /etc/group to get the group number for mqm and then greped /etc/passwd for that number.

But today, I found several IDs that are in multiple groups and mqm is the 2nd group.

I want to move these users out, and / or move them to the MQ Wrapper but in oder to do that I'm going to need to figure out who and once I'm done make sure that they don't get the SA to put them back in.

TIA
Tom
Back to top
View user's profile Send private message
tkane
PostPosted: Tue Apr 06, 2004 7:23 am    Post subject: one solution Reply with quote

Voyager

Joined: 23 Dec 2002
Posts: 82
Location: Kansas City

Where are all the Unix scripters?

I came up with one solution on my own.
Anybody have anything that will shoot it down?

Code:

SCRIPT="mqmgroup"
group="mqm"
DATE=`/usr/bin/date +%Y%m%d.%R`
tmpfile="/tmp/gid.list.mqm.$DATE"
users=`wc -l /etc/passwd | awk '{print $1}'`
for i in $(cat /etc/passwd | cut -f 1,1 -d:)
do
  id $i >> $tmpfile
done
grep "($group)" $tmpfile
mqm_users=`grep -c "($group)" $tmpfile`
echo $SCRIPT: there are `grep -c "($group)" $tmpfile` users in the $group group on `uname -n`
echo "$SCRIPT: mqm_users= $mqm_users"
echo "$SCRIPT: users= $users"
let "mqm_users = $mqm_users * 100"
let "percent = $mqm_users / $users"
rm $tmpfile
echo "$SCRIPT: mqm users are approx $percent percent of total users on `uname -n`"


The odd thing is that it's reporting everybody in one or two boxes being in the mqm group as a secondary group.

TIA
Tom
Back to top
View user's profile Send private message
bbburson
PostPosted: Thu Apr 08, 2004 7:29 am    Post subject: comments on your script Reply with quote

Partisan

Joined: 06 Jan 2004
Posts: 378
Location: Nowhere near a queue manager

Tom,

I ran your script on a Sun server and had to add the "-a" flag to the id command to get it to show secondary group memberships.

On the server where you see everyone in the mqm group, what does the mqm line in /etc/group look like? It should have all the secondary memberships on it.

Bruce Burson
Back to top
View user's profile Send private message
tkane
PostPosted: Fri Apr 09, 2004 11:40 am    Post subject: Reply with quote

Voyager

Joined: 23 Dec 2002
Posts: 82
Location: Kansas City

Bruce,

Thanks for the catch of '-a' I missed that.

I can't see anything about the mqm group line in /etc/group that indicates more than 20 users. Although there are about 200 on that one box.

Good news is most boxes aren't configured that way.

Bad news is I don't know how many are right now.
I'm going to try and push the updated script to all my test boxes this weekend and see what it says.

Thanks
Tom
Back to top
View user's profile Send private message
Philip Morten
PostPosted: Thu Apr 15, 2004 2:03 am    Post subject: identyfing users in mqm group Reply with quote

Master

Joined: 07 Mar 2002
Posts: 230
Location: Hursley Park

You might want to see if the command logins -g mqm will give you what you want, it's available on all your OS ( except for AIX earlier than 5.2 where lsgroup might help )
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 » identyfing users in mqm group
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.