How do I find the number of user licenses on my system? To find the number of user licenses on a system run "keyadm -g". # keyadm -g 32 USERS 6 PROCESSORS A user license is consumed on each telnet, rlogin or login to the system (login from the console, the remote port, or terminal). To estimate how many user licenses have been used on your system do the following. This shows the number of login shells. $ ps -ef | egrep ' (-ksh|-sh|-csh)' root 378 1 TS 80 Mar 31 console 0:00 -sh kim 602 600 TS 70 Apr 01 pts/1 0:00 -ksh avery 762 760 TS 70 14:45:49 pts/2 0:00 -ksh This shows how many telnet and rlogin sessions there are to this host. $ ps -ef | egrep 'telnetd|rlogind' root 600 309 TS 80 Apr 01 ? 0:01 in.rlogind root 760 309 TS 80 14:45:48 ? 0:03 in.rlogind This shows there are 3 users logged in, 2 from rlogin and 1 on the console. To find out how many user licenses are currently in use on your system do the following procedure which looks at the kernel variable that tracks the number of user licenses in use. Note: If you not familiar with crash or kernel debugging then this may be difficult to follow. 1. Start crash. $ crash crash: processing library /usr/lib/crash/libcrash1.so dumpfile = /dev/mem, namelist = /stand/unix, outfile = stdout Engine: 0 Procslot: 43 Lwpslot: 0 > 2. Disassemble the ctl_curlogusers function and look for the instructions where an integer is being incremented by 1. > dis (ctl_curlogusers+0x130) 30 ctl_curlogusers+0x130: blt- crf7,ctl_curlogusers+0x168 ... ctl_curlogusers+0x15c: addi r1,r1,96 ctl_curlogusers+0x160: mtlr r13 ctl_curlogusers+0x164: blr ctl_curlogusers+0x168: lis r11,46 <------ load (upper word) ctl_curlogusers+0x16c: lwz r11,0x5168(r11) <- load (lower word) ctl_curlogusers+0x170: addi r11,r11,1 <---- increment by 1 ctl_curlogusers+0x174: stw r11,0x5168(r15) <- store ctl_curlogusers+0x178: mfsprg r5,3 ctl_curlogusers+0x17c: lwz r6,0x298(r5) ... > 3. Look at the 2 instructions that appear just before the "increment by 1" instruction. > od -x (ctl_curlogusers+0x168) 2 00188718: 3d60002e 816b5168 =`...kQh ^^^^ ^^^^ 4. The address of the counter is comprised of the the lower two bytes of those instructions. Combine the two words to give the address of the counter. 00188718: 3d60002e 816b5168 =`...kQh ^^^^ ^^^^ 2e 5168 = 0x2e5168 (The first instruction has the high order word of the address. The second instruction has the low order word of the address.) NOTE: If the low word is between 0x8000 and 0xffff subtract 1 from the upper word then combine them. 5. Read the contents of that address. > od -d 0x2e5168 <-- -d flag shows value in decimal 002e5168: 3 <-- number of users from ctl_curlogusers > WARNING: Please do not modify any kernel variable on a running system or the system may panic or hang. If you want to get a larger number of user licenses for your system contact your local sales representative. For more information see keyadm(1), or crash(1).