License Server Help

User Reporting through the License Server

User Reporting through the License Server

The data contains:

  • License usage

    asset usage table
    asset usage graph

  • Count of the requested licenses by each product of a particular version:

    ticket requests

  • Usage of a particular product and version by a particular user:

    users and ips to products

  • Users with related IP addresses:

    ips to users

Emailed statistics

  • An .xls table with usage data in a human-readable format;

  • A JSON file with the usage data in a machine-readable format, containing the same data.

To obtain detailed statistics by email please, configure your SMTP connection accordingly.

Configuration for ZIP distribution

  1. Stop the license server.

  2. Configure mail server host and port:
    • On Linux/Mac OS X run: sh <license_server_home>/bin/license-server.sh configure --smtp.server mail.company.org --smtp.server.port 25

    • On Windows run: <license_server_home>\apps\license-server\bin\license-server.bat configure --smtp.server mail.company.org --smtp.server.port 25

    where mail.company.org is the host of mail server and 25 is the port number you want to use. Please make sure that ports are listened by email services\daemons and configured correctly in a firewall.
  3. Configure the reports recipients:
    • On Linux/Mac OS X run: sh <license_server_home>/bin/license-server.sh configure --stats.recipients recipients@company.org

    • On Windows run: <license_server_home>\apps\license-server\bin\license-server.bat configure --stats.recipients recipients@company.org

    where recipients@company.org are the recipients of the report. Please use a comma to separate records if there are several recipients (recipient1@company.org,recipient2@company.org).
  4. Configure the address of the email sender:
    • On Linux/Mac OS X run: sh <license_server_home>/bin/license-server.sh configure --stats.from report-sender@company.org

    • On Windows run: <license_server_home>\apps\license-server\bin\license-server.bat configure --stats.from report-sender@company.org

    where stats.from is the address to be used as sender of email report.
  5. If the mail server requires authorisation, configure the username and password:
    • On Linux/Mac OS X run: sh <license_server_home>/bin/license-server.sh configure --smtp.server.username mail-server-user@company.org --smtp.server.password mail-server-password

    • On Windows run: <license_server_home>\apps\license-server\bin\license-server.bat configure --smtp.server.username mail-server-user@company.org --smtp.server.password mail-server-password

    where smtp.server.username is the username of mail server user and smtp.server.password is the password of the user.
  6. Start the license server.

Please, pay attention of the fact that email statistics will be sent when it's requested from the webinterface of the license server. It's not a periodic task.

Since Build 14451 the license server's administrator can set "Lack of available licenses" email notifications. By default it's disabled, requires a configured SMTP, reports once an hour (non-configurable).

To enable it, use the following command after the step #4 before server will be started:

  • On Linux/Mac OS X run: sh <license_server_home>/bin/license-server.sh configure --reporting.out.of.license.threshold 90

  • On Windows run: <license_server_home>\apps\license-server\bin\license-server.bat configure -reporting.out.of.license.threshold 90

where 90 = % of all licenses, occupied by users, a trigger threshold, which initializes emails sending.

Configuration for MSI distribution

  1. Stop JetBrains License Service.

  2. Configure mail server host and port:

    <license_server_home>\apps\license-server\bin\license-server.bat configure --smtp.server mail.company.org --smtp.server.port 25
    where mail.company.org is the host of mail server and 25 is the port number you want to use.

  3. Configure the reports recipients:

    <license_server_home>\apps\license-server\bin\license-server.bat configure --stats.recipients recipients@company.org
    where recipients@company.org are the recipients of the report. Please use a comma to separate records if there are several recipients (recipient1@company.org,recipient2@company.org).

  4. Configure the address of the email sender:

    <license_server_home>\apps\license-server\bin\license-server.bat configure --stats.from report-sender@company.org
    where stats.from is the address to be used as sender of the email report.

  5. (Optional) If the mail server requires authorisation, configure the username and password:

    <license_server_home>\apps\license-server\bin\ configure --smtp.server.username mail-server-user@company.org --smtp.server.password mail-server-password
    where smtp.server.username is the username of mail server user and smtp.server.password is the password of the user.

  6. Start JetBrains License Service.

Please, pay attention on the fact that email statistics will be sent when it's requested from the webinterface of the license server. It's not a periodic task.

Since *Build 14451* the license server's administrator can set "Lack of available licenses" email notifications. By default it's disabled, requires a configured SMTP, reports once an hour (non-configurable).

To enable it, use the following command after the step #4 before server will be started:

<license_server_home>\apps\license-server\bin\license-server.bat configure -reporting.out.of.license.threshold 90
where 90 = % of all licenses occupied by users, a trigger threshold which initializes emails sending.

Statistics via API

There are 2 formats of the usage statistics reported via API in JSON format: historical data in "from-date-to-date" format and real-time statistics in "per-user" format (available from build 16429):

Historical data in from-date-to-date format from ZIP distribution

  1. Stop the license server.

  2. Configure the token that later will be used as the parameter of a POST request to obtain statistics via API:
    • On Linux/Mac OS X run: sh <license_server_home>/bin/license-server.sh configure --reporting.token TOKEN

    • On Windows run: <license_server_home>\apps\license-server\bin\license-server.bat configure --reporting.token TOKEN

    where TOKEN is a random combination of digits/letters, which you'll use as a secret key to access the statistics.
  3. Start the license server.

  4. Send a POST request to <license_server_URL>/reportApi with the following parameters:

    Parameter

    Description

    granularity

    Granularity of the report, 0 to 4 from hourly to yearly respectively

    start

    Report start date in YYYY-MM-DD format

    end

    Report end date in YYYY-MM-DD format

    token

    TOKEN configured at step 2

Test example:
curl --data "granularity=0&start=2017-09-12&end=2017-09-14&token=TOKEN" http://0.0.0.0:8080/reportApi
Test example output:
{"Overall":[{"License":"IntelliJ IDEA Ultimate 2017.2","Max usage":1,"Peak time":"14/09/2017 10:04","Max available":1}, {"License":"IntelliJ IDEA Ultimate Toolbox","Max usage":0,"Max available":1}, {"License":"ReSharper C++ 2016.2","Max usage":0,"Max available":7},{"License":"dotCover 2016.2","Max usage":0,"Max available":9}, {"License":"dotMemory 2016.2","Max usage":0,"Max available":10},{"License":"dotTrace 2016.2","Max usage":0,"Max available":10}], "License Usage Hourly":[{"time":"14/09/2017 10:00","key":"IntelliJ IDEA Ultimate 2017.2","count":1}], "License Requests Hourly":[{"time":"14/09/2017 10:00","key":"IntelliJ IDEA Ultimate 2017.2","count":1}], "Users":[{"user":"user1","ips":["127.0.0.1"],"requests":["IntelliJ IDEA Ultimate 2017.2"]}]}

Historical data in from-date-to-date format from MSI distribution

  1. Stop the license server.

  2. Configure a token that will later be used as the parameter of a POST request to obtain statistics via API: <license_server_home>\apps\license-server\bin\license-server.bat configure --reporting.token TOKEN where TOKEN is the secret token used to access the license usage data.

  3. Send a POST request to <license_server_URL>/reportApi with the following parameters:

    Parameter

    Description

    granularity

    Granularity of the report, 0 to 4 from hourly to yearly respectively

    start

    Report start date in YYYY-MM-DD format

    end

    Report end date in YYYY-MM-DD format

    token

    TOKEN configured at step 2

  4. Start the license server.

Real-time statistics in per-user format:

  1. Stop the license server;

  2. Configure access token as described above;

  3. Send request to <license_server_URL>tickets-report.json?token=TOKEN where TOKEN is the secret token configured during the previous step.

Test example:
curl http://0.0.0.0:8060/tickets-report.json?token=TOKEN
Test example output:
[{"userId":"testuser@localhost","clientId":"d001a808-1d3f-4a05-8318-7053180059b7","ip":"127.0.0.1", "license":"IntelliJ IDEA Ultimate Toolbox", "product":"II:2017.2","issued":"2018-03-27T18:22:46.689+0300", "last_seen":"2018-03-27T18:42:54.249+0300"}]

Since build 17768 there is an endpoint to get the list of all licenses located currently on the license server. To get it, configure the reporting token as described above and send the POST request to <license_server_URL>/licenses-report.json?token=TOKEN where TOKEN is equal to the token configured above. Granularity parameteres are not used in this report

Test example:
curl http://172.20.4.209:8060/licenses-report.json?token=EjohNoh6
Test example output:
{"licenses":[{"name":"IntelliJ IDEA Ultimate 12.0","available":1,"allocated":0,"allocatedDetails":"/tickets/II?version=12000&trueUp=false"}, {"name":"IntelliJ IDEA Ultimate 2016.2","available":1,"allocated":0,"allocatedDetails":"/tickets/II?version=2016200&trueUp=false"}, {"name":"IntelliJ IDEA Ultimate Toolbox","available":0,"allocated":1,"allocatedDetails":"/tickets/II?version=2017300&trueUp=false"}, {"name":"All Products Pack Fallback","available":1,"allocated":0,"allocatedDetails":"/tickets/ALL?trueUp=false"}, {"name":"All Products Pack Toolbox","available":2,"allocated":0,"allocatedDetails":"/tickets/ALL?trueUp=false"}]}
Last modified: 1 October 2018