Tool on license use

Started by Gilles, October 30, 2019, 10:12:52 AM

Previous topic - Next topic

Gilles

From time to time, on any server, we have the error message "Number of plugin / javax users exceeded (Package 20013)" and some users can not connect anymore.
The last time this happened, 11 workstations were connected to the server and despite a license of 12 x 20013, the twelfth station could not connect.
We did some investigation on the Linux server with ps, netstat, and in the /proc directory and found that all the pxplus processes were those of the 11 workstations, without understanding why we get this error message.
Only a reboot of the server corrected the problem, sometimes this can be very annoying.

In this kind of case, it would be interesting to have a tool giving precise information on the use of the license with a list of ip addresses, process numbers ...

Mike King

#1
Have you tried the USERS command?

It should show you all the PxPlus tasks running on the system with the user name, workstation they are on, the process id, and the command line used to launch the process.

You can add additional information to the display in your application by calling CALL "*it.dbg/process;Set_State", description$.
See "Application Interface" at the bopttom of: https://manual.pvxplus.com/page/toolkit1/sect1.1/b.htm
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Gilles

Set_State is very interesting to track processes.
Thank you Mike.

Mike King

It has been around for a while in PxPlus and does make it easier to know what is running on the system

Generally we suggest that you add calls to Set_state whenever the end user starts a process such as a new order, posting, or printing reports so that an administrator has some ideas as to what is running should they need to shut down the system.

Both the USERS command and the built-in debug facilities  show the current state of processes on the system.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Thomas Bock

That's great! Now we have a way to add application indormation to the process data.
I would like to retrieve that information for our own process list. I looked at TCB() and I tried GET_STATE but no luck.
Is there a way?

Stéphane Devouard

Thomas

This information is stored in a pxplus file keyed on the pid
IIRC it is *it.dbg/control.dat
It is automatically retrieved by the system when you use one of the TSK() un-documented functions — TSK(*PROCESS LIST) if I am not mistaken.
Would be easier if the PxPlus folks provided a Get_State routine indeed

Regards
Stéphane Devouard
Portfolio | Work

Mike King

Thomas

The information is stored in *it.dbg/control.dat using the process ID masked into a 8 digit number.

If you want your processes state try:

Print rcd("*it.dbg/control.dat",key=str(tcb(506):"00000000"))

If using *plus/cs/host your should also be able to find your user name (WHO) and workstation name (NID) values by using:

k$=str(tcb(506):"00000000")
k$=tbl(k$,"123456789","ABCDEFGHI")
Print rcd("*it.dbg/control.dat",key=k$)

Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Stéphane Devouard

Mike

If I am not mistaken, the PID of the current interpreter process is also stored in tcb(89).
Just wondering if it is just duplicate information, or if there are uses cases where tcb(506) is better than tcb(89) ?

Stéphane Devouard
Portfolio | Work

Mike King

Generally both are fine, but when running on WindX TCB(506) gives you the servers PID whereas TCB(89) yields the PID of the WindX process.

Since the logic I posted likely would run only on the server, either would be correct.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com