forsms
6th May 2002, 18:51
Hi,
Can we get a snapshot of which user is currently executing which session?
Thanks
patvdv
6th May 2002, 19:01
You can use the bshcmd tool for this, e.g.:
root@jumbo [/root] # bshcmd6.1 -s -p -u5 -w5 14916
Received wakeup call
Command 1 (arg '') issued by user root
PID PPID PGRP SESSION TICKS FLAGS S CMP MEM
1 0 1 ottstpstdlib 2718787 00020000 S 000 374920
object: ottstpstdlib
oic:
ottstpstdlib
ottstp_stddll
2 0 2 ottstppollmes 606 00000060 B 235 215400
object: ottstppollmess
oic:
ottstppollmess
ottstp_stddll
3 0 3 ottdskmbrowse 788571 00000060 B 235 269352
object: ottdskmbrowser
oic:
ottdskmbrowser
ottstp_stddll
ottdskmenu
4 0 4 ottdskbrowser 258320 00000060 B 000 414040
object: ottdskbrowser
oic:
ottdskbrowser
ottstp_stddll
ottadvexecperm
73 3 73 tdilc1120m000 3135702 00000060 B 235 655848
object: tdilc1120m000
oic:
otdilc1120
ottstp_stddll
ottstpstandard
otcmcsdll0100
otccomdll0201
otcmcsdll0010
otcmcsdll0004
otfglddll4010
forms:
ftdilc1120m0001*
ftdilc1120m0002
14916 is the PID of the user's bshell process.
forsms
6th May 2002, 19:33
It works !!
Thanks
Pat gave me this idea to make a shell script to get the output in a formatted way... hope everyone finds it useful...
I found that it does take some execution time so have patience!
The code can be found in this thread CODE & Utilities > Show which session a user is running (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1936)
forsms
7th May 2002, 16:02
NP,
The output of the shell script is
"session ttadv2500m000 in use by" (i.e. it is not showing me the user name)???
Hi forsms,
I made the test execution our development box and I got the output...
>chkobj ozmmig1202
Object ozmmig1202 in use by nprao
[DEV]/app/common/home/nprao
>chkobj zmmig1202m000
Object zmmig1202m000 in use by nprao
[DEV]/app/common/home/nprao
>chkobj ottadv2500
Object ottadv2500 in use by cfgreene nprao
Object ottadv2500 in use by nprao
[DEV]/app/common/home/nprao
>chkobj ottadv2530
Object ottadv2530 in use by cfgreene nprao
Object ottadv2530 in use by hppanrut nprao hppanrut
Object ottadv2530 in use by nprao
[DEV]/app/common/home/nprao
>
The tool detects the related, session, dll objects or script objects in use...
so can you please put up detailed steps to reproduce the problem and also some screen shots will help me to research the problem.
Thanks!
forsms
8th May 2002, 02:26
NP,
the program is as follows:
start.of.program
# Shell script to verify if a user is executing a particular session
clear
if test $# -ne 1
then
echo "Command Usage: $0 Session-code"
exit
fi
for i in `ps -ef | grep bshell | grep -v "grep bshell"|awk '{print $2}'`
do
bshcmd6.2 -s -p -u5 -w5 $i | grep $1 > /dev/null
if test $? -eq 0
then
userid=`ps -ef | grep $i | cut -f1 -d" " | uniq`
echo "Session " $1 "in use by " $userid
fi
done
end.of.program
Now, I have run the session tcmcs0455m000(logged in as bsp)
The output on "sh chkobj tcmcs0455m000 is :
"Session tcmcs0455m000 in use by"
the output with "sh chkobj omcs4555 is :
"Session omcs0455 in use by"
Any suggestions as to why the output is not giving the user name?
Thanks
Hi forsms,
The only issue I can think of based on my past experiences, is that some of the unix commands like cut options do not work well in the baan ksh/sh.
Can you please get into the unix terminal, set your baan environment and then try to execute this script and let me know the results.
I got my test execution output from the TNVT terminal and not from the baan sh/ksh.
Also, I am on the HP-Unix, which flavor of Unix are you working in ?
learner
8th January 2004, 09:36
Hi,
I find that people who r running baan on unix box enjoys more benefit as compared to windows users like shells etc.
is there a way through which i can run the shell script in windows environment.
I know i can always create a new sessions which writes the output of bshcmd in some text file , and then utilise it.
any sugesstions ??
Regards
Learner
victor_cleto
8th January 2004, 18:57
yes, you can run shell scripts (sh/bash mostly, but there's also a tricky solution to have ksh installed) thru free cygwin (http://www.cygwin.com) (some limitations may apply of course since it's not pure unix but for most scripts works ok)