mr_suleyman
19th January 2006, 08:56
Hi All dear Friends, in baan I can get defined user lists . Now I want to control whether those user is online or not in script. Is there a any useful command to check this state ? In unix I can check these users that loged on
baan server by using (ps -ef |grep bshell6.1 ) May be we can get information from that. But How can check it according to user ?

Thanks for your suggestions ...

norwim
19th January 2006, 09:20
Hi there,

lets assume you have a file called "users", containing your users login names.
---start of file users---
Frank
Zappa
bsp
--- End of file users ---

If you write the following script call chuser.sh
---start of file chuser.sh---
while read name
do
ps -ef | grep bshell | grep $name > /dev/null
echo "$name $?"
done < users
---End of file chuser.sh---

and start it with sh chuser.sh
you will get the follwing output:
Frank 1
Zappa 1
bsp 0
if neither Frank nor Zappa but bsp has a bshell

hth

Norbert

mr_suleyman
19th January 2006, 09:59
How can I use it on baan script and compare users with them ?

mr_suleyman
19th January 2006, 10:13
and I tried your code in my test server. it doesn't works properly or I don't understand your code exactly. For example I created users file. There was only root online.There are no user. When I run your code, I got these
root 0
sozturk 1
test 1
test 1
test 1
xxxx 1

What does it mean ? In my system there is no xxxx user . Only I inserted it into users file to test it !

norwim
19th January 2006, 10:39
what exactly is it that you don't understand?
Only root has a zero (the grep for bshell AND root was successfull and therefor returned 0), all other names didn't.
If you wish to know what users exist on your baan system, have a look at the contents of $BSE/lib/user. Filter away the filenames that have a '-' at the end (these are kind of backup copies) and voila ... you have a list of all usernames that have been converted to runtime.
You only want to see online users? What about combining the script with a 'grep -v 1'?

have fun

Norbert

manojsharma
19th January 2006, 11:25
Hi Suleyman,

You have to create a customised table and a display session on this customised table and in script of display session you have to first create a file which stores currently active users by giving
shell("licmon6.1 -w > /app/user/poldev/filename", RP_WAIT)

which give you following

Process ID
User ID
Server Name
System Name
Date & Time

store this information in your customised table and display the records.

mr_suleyman
19th January 2006, 13:05
Thank you Norwin and Manojshrama . Both suggestions will be very useful for me ! I can find my way !

Thank you , IAM OPEN FOR OTHER SUGGESTIONS