I am trying to get the number of users actively connected to a Progress Application Server to control concurrent access to an application. The backend database is SQL Server, using the SQL Dataserver. There are a mix of users using the application from normal windows desktop Prowin sessions (which I can already count and do not use the PAS) and Mobile access via the Progress Application Server.
Given the output:(below) from pasman, is there a way to get the session count (value from <1 minutes) without issuing a pasman command?
proenv>pasman sessions -I Test -u user:pswd WebApp
OK - Session information for application at context path /WebApp
Default maximum session inactive interval 30 minutes
<1 minutes: 2 sessions
12 - <13 minutes: 1 sessions
13 - <14 minutes: 1 sessions
When the mobile app signs into the application I want to get a session count of active sessions.
The call needs to be from a progress procedure to get the number of active sessions on the PAS instance.
We are doing this to ensure the customers comply with the license counts they are licensed for.
Are you interested to run JMX query from command line, write that to a output to a file in JSON and read it from there? All this can be done from ABL(if you like to run the JMX query from OS-COMMAND).
I am wide open to suggestions, it will be the PAS instance that will execute the code.
If you could provide a sample of the JMX query and how to run it from ABL to get the active sessions that would certainly be something I would be interested in.
The one you are looking for is a manager (tomcat) API, so you cannot have access for its REST API. To run it from JMX, you can run the following query
This should be written to file(any name and extension) and then run the following command
oejmx.bat|sh -R -Q <your query file> -O <Absolute PATH of output file>
It should dump the json output in the file you have mentioned.
if you are running 11.7.2 then you have to change the oejmx script to pick the right JDK. You do not have to do anything with 11.7.3.
I am using OE 11.7.1, where do I find oejmx.bat?
Seems to indicate it should be <PASOE Instance>/bin: oejmx.bat
I do not have that bat file in either my dev instance folder, or a test production environment.
We started shipping oejmx from 11.7.2.
Is it available for 11.7.1, can I install it somehow other than going to 11.7.2?
And how would I call that from a Windows desktop prowin session that does not have access to the Instance/bin folder?
If /oemanager web app is installed you can use the ABL HTTP client to fetch the URL. If not, then you need to use JMX which requires a java client.
What would the URL be to get the activeSessions?
This seems to give me what I want from a URL:
OK - Attribute get 'Catalina:type=Manager,host=localhost,context=/LumberTrack' - activeSessions = 1
"LumberTrack".... Looks like we have something in common. Our version of it originates about 20 years ago, and we still run ours on HP-UX!
I think the difference between your "manager" url and the "oemanager" URL (that Matt suggested) is that the first one is a REST interface that is focused on tomcat HTTP sessions and the latter is for OE ABL sessions.
"Session" is a term that is way over-utilized, especially within the context of PASOE. Here is a KB that describes the variety of things that are named "session" in PASOE. https://knowledgebase.progress.com/articles/Article/What-are-the-types-of-OpenEdge-sessions . So it might be helpful if we could start by clarifying which type of session you want to monitor.
More importantly, it sounds like Progress sold you DataServer licenses for concurrent ABL users. Couldn't you ask Progress to sell you the same type of licensing model as you have for PASOE (ie. probably core licensing for both?) It seems a pain to self-audit with home-grown code. I'm eager to hear how things turn out.
The /manager application is Tomcat's manager application. It has functionality specifically for Tomcat.
The /oemanager web application is from OpenEdge. It provides data on ABL applications, including agent and ABL sessions.
Both of these have REST interfaces, although Tomcat's mostly returns raw text, while /oemanager always sends and receives JSON.
If that is what you were looking for then yes, accessing the manager Web Application should give you what you want. I thought you wanted to run it as a batch program within the PASOE Instance.
I don't see 'activeSessions' sessions from /oemanager, is that available? It seems like that is coming from the /manager only.
Irfan, I do not 'need' a batch program. The flow would be to attempt to sign in, check user counts and stop the sign in if the license count does not come within the parameters we set.
I just need to see how many desktop connections (which I know) + Mobile connections.
Active sessions (which have not timed out yet) seems to be the only metric I can get from the PASOE.
Assuming the mobile app keeps sending requests to the WebApp they are active, until their session times out.
Am I wrong in this assumption?
There are a few levels of management cruft you need to drill thru before you get the sessions. (1) instance of pasoe/tomcat, (2) abl application name - often the same as the instance name, (3) multisession agent ID, (4) available sessions hosted within the agent
Assuming you have an instance of tomcat at port 8815, and an abl application named abl_dev_statefree_dev (as an alternative to oepas1 which is the normal application name and instance name) then you can get down to the multisession agent ID(s) with a powershell script like so:
$agent= $null $response = $null $response2 = $null # Store credentials $pass="tomcat" | ConvertTo-SecureString -AsPlainText -Force $cred = New-Object System.Management.Automation.PsCredential('tomcat',$pass) # Retrieve available agents $response = Invoke-RestMethod -Uri hddp://localhost:8815/oemanager/applications/abl_dev_statefree_dev/agents -Credential $cred # Parse out the results into JSON $jsonstring = ConvertTo-Json -InputObject $response -Depth 3 $json = ConvertFrom-Json -InputObject $jsonstring # Retrieve an available agent $agent = $json.result.agents | Where-Object -Property 'state' -EQ 'AVAILABLE' # PRINT AGENTS $agent
Then you should see an agent ID that looks a bit like a nasty guid: "Js89lnhITRaVIivJOewS1w", along with an operating system PID and a state.
At that point you can use the agent ID ("Js89lnhITRaVIivJOewS1w") in a new REST url in order to drill down to the next level which is the abl sessions:
$agent= $null $response = $null $response2 = $null $jsonstring = $null # Store credentials $pass="tomcat" | ConvertTo-SecureString -AsPlainText -Force $cred = New-Object System.Management.Automation.PsCredential('tomcat',$pass) # Retrieve available agent sessions using abl app and agent id $response2 = Invoke-RestMethod -Method Get -Uri ('hddp://localhost:8815/oemanager/applications/abl_dev_statefree_dev/agents/Js89lnhITRaVIivJOewS1w/sessions') -Credential $cred # Parse out the results into JSON $jsonstring = ConvertTo-Json -InputObject $response2 -Depth 4 # PRINT $jsonstring
Note that there can be multiple abl sessions within each agent process. This is why they are called multi session agents. It is less common but there can also be multiple agent processes within each abl application (this would happen under extreme load).
It may take a bit of effort but you should be able to enumerate *all* sessions for *all* agents. Note that the sessions also have a "SessionState" property and are often "IDLE". I wouldn't think that these idle ones would count towards your concurrent user total. Hope this helps.
The metrics you want is only available in "manager" WebApp, it is not part of oemanager. /manager is tomcat WebApp and the metrics it displays is different to that of what "oemanager" displays. You might also want to look at /oemanager/applications/<ABL App>/metrics this will give you metrics information and you can get the active requests count from 'concurrentConnectedClients' value from the REST API output. I am guessing you could run a ABL HTTP Client from your desktop Application.
Could you please let us know how you ended up self-auditing your concurrent user licenses in the context of the PASOE appserver? I think your approach would be of interest to the community.
Ideally there would be a practical example of doing this in the Progress KB as well.
For our needs, looking at the active sessions in the tomcat manager is sufficient.
This shows the active sessions for the webapp that have not yet timed out.
When a session times out, the next call to the api will require signing in again.
The sign in process will look at the active session count to determine whether it falls into the allowable application license counts.
Hope that helps,