PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Tool on license use  (Read 2923 times)

Gilles

  • Silver Member
  • ***
  • Posts: 27
    • View Profile
Tool on license use
« on: October 30, 2019, 10:12:52 AM »
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

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Tool on license use
« Reply #1 on: October 30, 2019, 10:33:26 AM »
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
« Last Edit: October 30, 2019, 10:35:29 AM by Mike King »
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Gilles

  • Silver Member
  • ***
  • Posts: 27
    • View Profile
Re: Tool on license use
« Reply #2 on: October 30, 2019, 11:42:14 AM »
Set_State is very interesting to track processes.
Thank you Mike.

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Tool on license use
« Reply #3 on: October 30, 2019, 11:57:34 AM »
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

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: Tool on license use
« Reply #4 on: October 31, 2019, 03:39:34 AM »
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

  • Diamond Member
  • *****
  • Posts: 122
  • PxPlus guru with skills in PHP, JS, C#, Java
    • View Profile
    • Stéphane's Web Resume
Re: Tool on license use
« Reply #5 on: October 31, 2019, 01:25:40 PM »
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

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Tool on license use
« Reply #6 on: October 31, 2019, 01:53:15 PM »
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

  • Diamond Member
  • *****
  • Posts: 122
  • PxPlus guru with skills in PHP, JS, C#, Java
    • View Profile
    • Stéphane's Web Resume
Re: Tool on license use
« Reply #7 on: October 31, 2019, 07:18:23 PM »
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

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Tool on license use
« Reply #8 on: November 01, 2019, 07:28:52 AM »
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