Progress Application Server - pasman sessions - Forum - OpenEdge Development - Progress Community

Progress Application Server - pasman sessions

 Forum

Progress Application Server - pasman sessions

This question is not answered

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

All Replies
  • The /manager application is Tomcat's manager application.  It has functionality specifically for Tomcat.

    tomcat.apache.org/.../manager-howto.html

    The /oemanager web application is from OpenEdge.  It provides data on ABL applications, including agent and ABL sessions.

    documentation.progress.com/.../index.html

    Both of these have REST interfaces, although Tomcat's mostly returns raw text, while /oemanager always sends and receives JSON.

  • Darek,

    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.

    Regards,

    Irfan

  • 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?

    Thanks,

    Derek

  • 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.

  • Darek,

    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.

    Regards,

    Irfan

  • Derek,

    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.

    Thanks, David

  • Hi David,

    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,

    Derek