D
dbeavon
Guest
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.
Continue reading...
Continue reading...