My employer wants to track the number of concurrent users to see if we have too many licences .
What is the best way to do that?
Any suggestions would help.
Thanks,
Shawn
My employer wants to track the number of concurrent users to see if we have too many licences .
What is the best way to do that?
Any suggestions would help.
Thanks,
Shawn
I know there is a built in dashboard that shows user sessions. May be worth a look at.
There is also User Tracker, iâm more curious as to what tables on the database side could should concurrent users for multi sessions.
ice.sessionstate
Nice, So simple. I was only thinking about the user tables.
Do any of you happen to know if licensing is by user or session?
If I have a user who is active in 5 companies, is that 5 licenses being used or 1?
If it is all from one workstation from one client instance and the session monitor is in use(it is automatically), that would be five technical sessions with one license being consumed.
I looked at sessionstate and couldnât glean much info from it.
What I need to do is see if I can create a list of unique users who currently have an active session going on.
I can then export that info a set intervals and create a report of peak users.
I looked at the dashboard that shows the currently active users. Unfortunately it doesnât show how it got that info.
Any idea on how to create a BAQ to get what I need?
This data wasnât intended to be consumed via BAQ/direct SQL query. The âbestâ solution would be to determine the BO and method that the EAC calls when it calls/retrieves the session information and call that via REST (or some other method) to get the data and do with it at that point what you wish to do.
That being said, the userid, licenseexpirationtime,and expireson columns should be straight forward to know what they represent. I suspect you only have one license in your db, so installationid will always be the same and isnât important then.
So, log into your training database with userABC and check the sessionstate record.
and so on and so forth.
One could piece this together enough so that it could be done via BAQ. If you arenât familiar with REST, this is an excellent example as to why it would be beneficial to learn because it is so much easier to query this data that way then what I laid out above.
Good luck
Where do I learn about REST?
I have no problem learning new things, just need a good resource.
First of all - the Admin Console has all this information.
-I was doing load testing so donât laugh at the 45K licenses
A few things to add - @aidacra is correct on where session is stored - by default -
Session is only accurate in the app server memory - the db table is the default option backup for if an appserver falls over and recycles. You can also plug in other storage mechanisms (not released but discussed in previous beta programs so there is some items floating around the internet on it).
So if you want to do more troubleshooting, you can look at the trace logs.
trace://ice/fw/session is your friend. Enable that flag in your appserver.config and you will see all activity going on around Sessions.
In 10.2.100 we a new trace flag that trims down the noise on sessions to just show when a license is in use or not - not why but just the counts - trace://ice/fw/license
An example is below.
Look at the element names to understand which trace they output comes from - Session or License. License is a heck of a lot less noisy so start there if on a newer version.
The details this gives are the client IP, the user name and what machine they accessed the server from.
It tells you which type of license âDefault Userâ is being consumed.
It tells you how many have been consumed and how many you have installed (1 of 45000)
When you logout, you see the release of the license:
If you want to build your own integration to monitor users, many have done so calling against the AdminSession Object. If you want to go down that path Iâll be happy to answer those questions as well.
I had the same question and found REST to be a great solution. I created a spreadsheet in Google Apps and it has a function executing a REST call every 15 minutes against the Ice.BO.AdminSessionSvc. The spreadsheet created shows licenses consumed at the time the script was run for both shop and office users. The user types were derived from observation and I donât know if they are the same in all installations. We have two companies hence the two different REST accounts.
Take a look at the below and good luck!
Brad
Here is the supporting code:
var ShopUserLic;
var OffUserLic;
function Process()
{
var d = new Date(); // for now
if(d.getHours()>=7 && d.getHours()<=17 && d.getDay()>=1 && d.getDay()<=5)
{
var EDRESTAccount=âUSERIDâ;
var JDRESTAccount=âUSERIDâ;
var EDLic=QueryLicenses(EDRESTAccount);
var JDLic=QueryLicenses(JDRESTAccount);
var sheet=SpreadsheetApp.getActiveSheet();
//var sheet = spreadsheet.getSheets()[0];
sheet.insertRowBefore(2);
var range = sheet.getRange("A2:G2");
var values = [
[ Utilities.formatDate(new Date(), "GMT-5", "MM/dd/yyyy HH:mm:ss"), EDLic[0],EDLic[1],EDLic[2],JDLic[0],JDLic[1],JDLic[2] ]
];
range.setValues(values);
}
}
function QueryLicenses(RESTAccount) {
//Account information for looking up data in Epicor
var RESTPass=âPASSWORDâ;
var ShopUserType=â00000003-b8eb-40c4-8897-248cb30c5d47â;
var OfficeUserType=â00000003-b615-4300-957b-34956697f040â
var Result = new Array(3);
Result[0]=0;
Result[1]=0;
Result[2]=0;
var headers = {
âAuthorizationâ : "Basic " + Utilities.base64Encode(RESTAccount + â:â + RESTPass)
};
var params = {
âmethodâ:âGETâ,
âheadersâ:headers,
âAcceptâ:âapplitom+xmlâ
};
var url=âSERVERURL/api/v1/Ice.BO.AdminSessionSvc/List?$select=LicenseType&$filter=Expired%20eq%20falseâ;
try
{
var response = UrlFetchApp.fetch(url, params);
Logger.log(response.getContentText());
var responsetext=response.getContentText();
obj = JSON.parse(responsetext);
for (i = 0; i < obj.value.length; i++) {
switch(obj.value[i].LicenseType)
{
case ShopUserType:
Result[0]=Result[0]+1;
break;
case OfficeUserType:
Result[1]=Result[1]+1;
break;
case â00000003-c071-4fd8-900d-f58ee96bbcceâ:
Result[1]=Result[1]+1;
break;
default:
Result[2]=Result[2]+1;
break;
}
}
return Result;
}
catch(err)
{
Logger.log(err);
Result[0]=-1;
Result[1]=-1;
Result[2]=-1;
return Result;
}
}
For what its worth. Hereâs a short PowerShell routine I wrote thatâs scheduled to run every 15 minutes.
It uses a REST call to acquire session information.
#Bypass validation of self-signed certificate
[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$uri = âhttps://servername/appservername/api/v1/Ice.BO.AdminSessionSvc/GetListâ
$creds = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(âusername:passwordâ))
$headers = @{ Authorization = "Basic "+$creds }
$body = â{âwhereClauseâ:âExpired = falseâ, âpageSizeâ:0, âabsolutePageâ:0}â;
$resp = Invoke-RestMethod $uri -Headers $headers -Method Post -ContentType âapplication/jsonâ -Body $body
$lic = @{DataCollection=0; DefaultUser=0;}
foreach ($session in $resp.returnObj.AdminSessionList) {
$lic.($session.SessionTypeDescription)++
}
$query = âINSERT INTO license_log (âDataCollectionâ,âDefaultUserâ,interval) VALUES (â+
$lic.DataCollection.toString()+â,â+$lic.DefaultUser.toString()+â,15);â
$conn = New-Object System.Data.Odbc.OdbcConnection(âDSN=PGBIâ)
$conn.open()
$cmd = New-Object System.Data.Odbc.OdbcCommand($query,$conn)
$res = $cmd.ExecuteNonQuery()
$conn.close()
For ânormalâ license use the session type is âDefaultUserâ. When subsequent sessions are created for being active in another company the session type is âEnterpriseProcessingâ, which doesnât count against license use.