License Server Help

User Reporting through the License Server

User Reporting through the License Server

The data contains:

  1. License usage

    License usage table
    License usage chart

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

    License requests

  3. Usage of a particular product and version by a particular user:

    Usage of products by users

  4. Users with related IP addresses:

    Table of users with related IPs

Emailed statistic

  1. An .xls table with usage data in a human-readable format;
  2. 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:

  • ZIP:

  1. Stop license server:

    <license_server_home>/bin/license-server.sh stop for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat stop for Windows.

  2. Configure mail server host and port:

    <license_server_home>/bin/license-server.sh configure --smtp.server mail.company.org --smtp.server.port 25 for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat configure --smtp.server mail.company.org --smtp.server.port 25 for Windows, 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:

    <license_server_home>/bin/license-server.sh configure --stats.recipients recipients@company.org for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat configure --stats.recipients recipients@company.org for Windows 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>/bin/license-server.sh configure --stats.from report-sender@company.org for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat configure --stats.from report-sender@company.org for Windows, 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:

    <license_server_home>/bin/license-server.sh configure --smtp.server.username mail-server-user@company.org --smtp.server.password mail-server-password for Linux and Mac OS X or <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 for Windows, where smtp.server.username is the username of mail server user and smtp.server.password is the password of the user.

  6. Start license server:

    <license_server_home>/bin/license-server.sh start for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat start for Windows.

NB: 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>/bin/license-server.sh configure --reporting.out.of.license.threshold 90 for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat configure -reporting.out.of.license.threshold 90 for Windows, where 90 = % of all licenses, occupied by users, a trigger threshold, which initializes emails sending.

  • MSI:

  1. Stop JetBrains License Service from Windows Services panel.

  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>/bin/license-server.sh configure --stats.recipients recipients@company.org for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat configure --stats.recipients recipients@company.org for Windows 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>/bin/license-server.sh configure --stats.from report-sender@company.org for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat configure --stats.from report-sender@company.org for Windows; 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>/bin/license-server.sh configure --smtp.server.username mail-server-user@company.org --smtp.server.password mail-server-password for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\ configure --smtp.server.username mail-server-user@company.org --smtp.server.password mail-server-password for Windows, 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 from Windows services panel or:

    <license_server_home>\apps\license-server\bin\license-server.bat start.

NB: 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>/bin/license-server.sh configure --reporting.out.of.license.threshold 90 for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat configure -reporting.out.of.license.threshold 90 for Windows, where 90 = % of all licenses, occupied by users, a trigger threshold, which initializes emails sending.

Statistics via API

ZIP

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:

  1. Stop the license server:

    <license_server_home>/bin/license-server.sh stop for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat stop for Windows

  2. Configure the token that later will be used as the parameter of a POST request to obtain statistics via API:

    <license_server_home>/bin/license-server.sh configure --reporting.token TOKEN for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat configure --reporting.token TOKEN for Windows, 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:

    <license_server_home>/bin/license-server.sh start for Linux and Mac OS X or <license_server_home>\apps\license-server\bin\license-server.bat start for Windows

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

    • 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"]}]}

MSI

  1. Stop the license server:

    <license_server_home>\apps\license-server\bin\license-server.bat stop

  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:

    • 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 from Windows Services panel or:

    <license_server_home>\apps\license-server\bin\license-server.bat start.

  • Real-time statistics in "per-user" format:

  1. Stop the license server as described above;
  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"}]

Last modified: 12 July 2018