Unix-Script to count named-users


Has anybody of You a Unix-script (shell doesn’t matter) which enables you to count the “named or concurrent user”, using Natural or Adabas?

To count Natural-user it should be possible to use something like “ps -ef | grep natural” to get the running natural-tasks and then using “awk” to get the user-ids out of the task-list.
To count Adabas-user it should be possible to get the user out of the user-queue running the according Adabas-utility and then pipe it ro “awk”.

Therefore I’m not willing to build the scripts on my own :lol: I hope, that somebody has already these scripts and can pass it to me:(Michael.Quitsch@Softwareag.com).

Thx and Greetings from Hambourg


Hello Michael,
You may achieve the same when calling Natbpmon. You may even call natbpmon within Natural. Please refer to the code below, which has been written for Windows, but shall work with Unix after some modifications. 8)
Sorry for my bad programming style :?

Hi Michael

First of all: Thanks for Your help !!!
Very interesting Natural-Prog. I tried it in my environment and it worked very well. But there is one problem left:

How can I count named Users? Or ist it possible to count them?

The bufferpool always shows me the number of concurrent users. But to show the number of concurrent user it is easier to run:

ps - ef | grep natural | wc -l

From the result you have to subtract -1 because the grep is also counted.
So, is it possible to get the number of named users (based on the used UserIDs) from the natbpmon?

When calling

“natbpmon who”

I’m getting the following result :

Bufferpool version 1.3(435) of 27-NOV-1997 12:24:59
index | tid
1 | sag 27336
2 | mq /dev/pts/0 4251

So, I have to use awk, to get the user out of the list :?
Or I can pipe it in a file for further analyses.

At the end I must say, that my question was a little bit “stupid” :oops:
Therefore telnet does not route the tcp/ip-address of a PC a user is using for emulation and several users may use the same userid it would be only possible to document used userids but it is not possible to count “named user”.
:frowning: :?

Mhhh?!?!? But This is also an answer. :shock:



Please note that it looks that the “natbpmon who” command(process) itself is included in the listing.