Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

Reserving licenses

You can customize out-of-the-box licensing to make sure that certain people always have access to a user license, or that a particular server always has access to a build license. You can reserve licenses, both fixed and individual, to set up a combination that best suits your needs.

A "fixed" license is one that has a long linger time, generally two weeks (1,209,600 seconds). A individual license has a shorter linger time, generally a 7 day (604,800 second) linger. "Linger" is the amount of time after the last use of a license before it is free for another user to check out. Note that these linger times start at the end of the inactivity time-outs that some Klocwork components have. For information about inactivity timeouts, see How licensing works.

In the rest of this article, build and user licenses are used in examples, but if you are licensed for Klocwork Code Review, you may also want to reserve the code review feature.

What are your needs?

The following are some licensing scenarios to help you think about what kind of licensing combination you need. The scenarios assume a deployment large enough that there is a separation between the roles of the Klocwork administrator and the Klocwork user.

Scenario 1: Fixed build license, individual user licenses

Your circumstances

You know how many Klocwork build engineers (or build servers) need to have fixed build licenses and you know who (or which ones) they are. You probably have a large number of Klocwork users who will use Klocwork at various times.

The setup

The setup is a combination of fixed build licenses, reserving build licenses for the Klocwork build tools, and individual user licenses for users. You can reserve either fixed or individual licenses for:
  • people
  • machines (by host name or IP address)
  • groups of people
  • groups of machines

Results

  • Build engineers (or build servers) will always have a build license.
  • You can supply as many build engineers as required with cost-effective fixed licenses.
  • individual licenses for users allow flexibility for large groups.

Scenario 2: Fixed for everybody

Your circumstances

You know how many build engineers (or build servers) need to have reserved build licenses, and you know who they are. You know how many users need to have reserved user licenses, and you know who they are. It is a relatively small, stable group.

The setup

Your options file will reserve fixed licenses for each user or machine. You may set them up, particularly the build engineers, as groups in your options file.

Results

  • Build engineers (or build servers) always have a build license.
  • You can enable as many Klocwork build engineers as required with cost-effective fixed licenses.

What you need to do

To reserve licenses to suit your needs, you need to:
  1. Create an options file that works with your Klocwork license
  2. Add the path to the options file to your license file
  3. Start or re-start the Klocwork Servers
  4. Verify that the licenses were reserved
Note: You can find more information about options files and FlexNet Publisher in general in the FlexNet Publisher documentation.

Sample license file

The format for parts of the INCREMENT section relevant to the options file is:
INCREMENT <feature name> klocwork <version> <expiration> <number of licenses VENDOR_STRING=<vendor string value>
where
  • <feature name> is:
    • The keyword fixserver2017, or server in your license file represents a build license.
    • The keyword fixclient2017, or client in your license file represents a user license.
  • <version> is the license version of this feature (unrelated to the Klocwork version number).
  • <expiration> is the date when the license will expire or 'permanent'
  • <count> is the numbers of licenses issued in this INCREMENT.
  • <vendor string value> is the vendor string that contains the linger setting.

The following are three sample INCREMENT sections from a Klocwork license file:

five fixed build licenses:
INCREMENT fixserver2017 klocwork 18.1 permanent 5 \
	VENDOR_STRING=KW-1151-004;-1;1209600;opt;ha BORROW SUPERSEDE \
	DUP_GROUP=H SUITE_DUP_GROUP=H ISSUER=sjasmann \
	ISSUED=14-Jan-2017 START=14-Jan-2017 SIGN="1035 87AB 3150 5376 \
	A945 26BA FEAA B215 CD2F 1966 A008 72CA FAAC F516 2F1B 16AD \
	AA3E 9AA8 9462 D2A4 B6D4 8E77 75D9 3A77 3470 A7FD 5B38 A58B \
	A92E EB0E"
100 individual user licenses:
INCREMENT client klocwork 18.1 permanent 100 \
	VENDOR_STRING=KW-1151-004;-1;600;opt;ha BORROW SUPERSEDE \
	DUP_GROUP=U SUITE_DUP_GROUP=U ISSUER=sjasmann \
	ISSUED=14-Jan-2017 START=14-Jan-2017 SIGN="12D1 EA99 37CA ED93 \
	CF05 26DE B2E7 95E5 8BD7 680B CB55 1099 4CA0 DB8F 107E 0975 \
	2741 E186 13EB 6A09 9970 C771 C429 E474 60FA DE62 97AC B544 \
	4C2F 9376"
Klocwork Static Code Analysis license:
INCREMENT review10 klocwork 18.1 22-Jan-2017 100 \               
        VENDOR_STRING=klocwork;-1;604800;opt;ha BORROW DUP_GROUP=U \ 
        ISSUER=tadebayo ISSUED=22-Jan-2017 START=22-Jan-2017 \ 
        SIGN="0972 9ACC A759 D36D C8E3 1EE4 5510 A3F5 07A5 E384 0921 \ 
        65AE B418 F4EB CE58 1484 D369 4FF5 89E7 CEC0 2438 A436 5016 \ 
        F029 7D54 21B0 2537 03E3 6A20 D2C7"

Back up your license file

It is easy to accidentally corrupt the Klocwork license file. Before you begin, make a copy of your license file as a backup and put it in a safe place. If the copy of the license file you are working on becomes corrupt, restore the backup license file and restart the license server.

Create an options file

Create a blank text file called klocwork.opt in the following directory:
<projects_root>/licenses
This file must be in the same directory as your Klocwork license.

Copy, paste, and replace

To reserve licenses, you can copy a template line of text into your options file and change it to suit your situation. The Template table below gives you lines to choose from. You can either enter text into the options file or you can copy and paste text into it. If you want to cut and paste the vendor string from your Klocwork license, use the working copy you made.

Important:
  • Do not change the text of FEATURE or INCREMENT lines in the original Klocwork license. It is signed and if you change it, the license will not work.
  • The options file is case-sensitive
  • The "\" character is a continuation character in options file lines.

The following examples show you how to choose a line and make the changes.

Note: The label used for the license type may differ in your license file. The examples here use "fixserver2017", "server", "fixclient2017" and "client". Your license file may use other labels. It is important that your options file uses the same license type label as your license file.

Reserving one license

To reserve one build license:
  1. Copy and paste the following line into the options file:
    RESERVE 1 <feature name>:<VENDOR_STRING> USER <user_name>
  2. Replace <feature name> with the name of the license label. The build license in the Sample license file is fixserver2017.
  3. Replace <VENDOR_STRING> with the vendor string for your server license from the working copy of your Klocwork license. The VENDOR_STRING for the fixedserver license in the Sample license file is VENDOR_STRING=KW-1151-004;-1;1209600;opt;ha
  4. Replace <user_name> with a user name you choose. For example, jlee.
  5. One build license is now reserved for the user you specified. Since you used a vendor string with a large number (1209600), the license is a fixed license.
Note:
  • To reserve a user rather than a build license, replace fixservers with fixclient in the RESERVE line.
  • To reserve for a host rather than a user, replace the keyword USER with the keyword HOST, and specify the machine's IP address or unqualified domain name. For example:
    RESERVE 1 fixserver2017:VENDOR_STRING=KW-005-001;-1;1209600;opt;ha HOST buildmachine01
  • FlexNet does not recognize fully qualified host names (such as buildmachine01.companyname.com).

Reserving multiple licenses

You can reserve more than one license for the user, machine or group specified in the RESERVE line. To reserve more than one license:
  1. Check the last number before the vendor string of your working copy of the Klocwork license. The number is the maximum number of license you can assign for that vendor string.
  2. In the options file, change the first number in the RESERVE line. For example, change RESERVE 1 fixserver2017 to RESERVE 2 fixserver2017.
You are now reserving two licenses.

Setting up a group of users or machines

If you don't want to add all users line-by-line, define a group and refer to the group instead. You can do this by copying lines of text from the Template table (below) or by entering text as follows:

To define a group of people, add the following line to your options file:
GROUP <group_name> <user_list>
where
  • <group_name> is a name for the group
  • <user_list> is a list of group member names, separated by spaces
For example:
GROUP BuildTeam amichaels fyassin jlee jsmith mwashington
To reserve a number of build licenses for a group:
  1. Add the following line to your options file:
    RESERVE <number_of_licenses> fixserver2017:<your_server_vendor_string> GROUP <group_name>
  2. Replace the variable in the line with the proper values. For example, to reserve five fixed build licenses for the group BuildTeam:
    • Replace <number_of_licenses> with 5
    • Replace <your_server_vendor_string> with your vendor_string
    • Replace <group_name> with BuildTeam
Example options file:
GROUP BuildTeam amichaels fyassin jlee jsmith mwashington 
RESERVE 5 fixserver2017:VENDOR_STRING=KW-005-001;-1;1209600;opt;ha GROUP BuildTeam

Groups of machines

You can also define a group of machines by using the HOST_GROUP keyword instead of the GROUP keyword, followed by a list of host names separated by spaces. For example:
HOST_GROUP BuildHosts 192.168.0.101 buildmachine06 192.168.0.102 northserver

Multiple groups

You can set up multiple groups, each with its own RESERVE line. For example:
RESERVE 5 fixserver2017:VENDOR_STRING=KW-005-001;-1;1209600;opt;ha GROUP BuildTeam
RESERVE 5 client:VENDOR_STRING=KW-006-001;-1;600;opt;ha GROUP DevGroup
RESERVE 10 client:VENDOR_STRING=KW-006-001;-1;600;opt;ha HOST_GROUP RemoteGroup
In this example:
  • five fixed build licenses are reserved for BuildTeam
  • five individual user licenses are reserved for DevGroup
  • 10 individual user licenses are reserved for RemoteGroup
If this organization has purchased 20 individual user licenses (client), 15 are reserved in this example (five on line 2 and 10 more on line 3), and the remaining five are available to others users on a first-come, first-served basis.

Template table

You can copy one or more lines from the following table and paste them into your options file. Replace the vendor string with your own vendor string, and make any other changes that you need.

To reserve fixed licenses, use your vendor string that has the large number.

To reserve individual licenses, use your vendor string that has the small number.

To reserve more than one license, change the number after the RESERVE keyword (or replace <number of licenses>).

Note: The label used for the license type may differ in your license file. The example here use "fixserver2017", "server", "fixclient2017", and "client". Your license file may use other labels. It is important that your options file uses the same license type label as your license file.
To set up your local options file to... Copy and paste...
reserve one fixed build license for a person RESERVE 1 fixserver2017:VENDOR_STRING=KW-005-001;-1;1209600;opt;ha USER <user_name>
reserve one fixed user license for a person RESERVE 1 fixclient2017:VENDOR_STRING=KW-005-001;-1;1209600;opt;ha USER <user_name>
reserve one fixed build license for a machine RESERVE 1 fixserver2017:VENDOR_STRING=KW-005-001;-1;1209600;opt;ha HOST <unqualified domain name or IP address>
define a group of people and reserve a number of fixed user licenses for the group GROUP <group_name> <user_list>RESERVE <number_of_licenses> fixclient2017:VENDOR_STRING=KW-005-001;-1;1209600;opt;ha GROUP <group_name>
define a group of machines and reserve a number of fixed build licenses for the group HOST_GROUP <group_name> <user_list>RESERVE <number_of_licenses> fixserver2017:VENDOR_STRING=KW-005-001;-1;1209600;opt;ha HOST_GROUP <group_name>

Additional FlexNet Publisher keywords for further customization

To customize your license in other ways, you may want to use some of the following FlexNet Publisher keywords. For more information, see the FlexNet Publisher 2016 (11.14.1) License Administration Guide, available from Klocwork Customer Support or from Flexera Software.

FlexNet Publisher keyword Details
INCLUDE feature[:keyword=value] type {name | group_name} limits the use of a feature to a specific USER, HOST, GROUP or HOST_GROUP. Users or machines that are not in the include list will not be allowed to check out a license for the feature. An INCLUDE line has the same effect as a RESERVE line that reserves the entire license count for the members of the group.
EXCLUDE feature[:keyword=value] type {name | group_name} denies access to a specific USER, HOST, GROUP, or HOST_GROUP. Takes precedence over INCLUDE. That is if a user or machine name appears in both INCLUDE and EXCLUDE lines for the same feature the user or machine will not have access to that feature.
INCLUDEALL type {name | group_name} limit access to all features served by the vendor daemon (klocwork vendor daemon). Users or machines not listed will not be allowed to check out any features served by the vendor daemon.
EXCLUDEALL type {name | group_name} limit access to all features served by the vendor daemon (klocwork vendor daemon). Takes precedence over INCLUDEALL. That is, if a user or machine name appears in both lines, the user or machine will be excluded (not able to check out any features).

Add the path to the options file to your license file

You must add the path to the options file to your license file so that the License Server can find it. You change the original Klocwork license in the projects_root. To enter a path to the options file into your Klocwork license:
  1. Open your Klocwork license in a text editor that preserves the line breaks in the file.
    Note: Notepad is not recommended.
  2. Replace the line: VENDOR klocwork with the line: VENDOR klocwork options=<path_to_your_options_file>. For example:
    VENDOR klocwork options="C:\Klocwork\Server 18.1\projects_root\licenses\klocwork.opt"
  3. Save the file.
Note: The Klocwork license is sensitive to the end-of-line character sequence. If you restart Klocwork and see the message "Invalid license", try a different text editor. If trying a different text editor doesn't solve the problem, contact Klocwork Customer Support.

Start or re-start the Klocwork servers

After you create or modify an options file, you must start or restart the Klocwork servers for the changes to take effect. For instructions, see Managing the Klocwork Servers.

Check the License Manager log file to test your options file

To make sure that the reservation is successful, check <projects_root>/logs/license.log for the RESERVING message. On success, the log file says:
RESERVING 1 <featurename>/<signature> license for <type> <val>
On failure, the log file indicates any errors in the options file.
Important: If the RESERVE line does not match any licenses through the vendor string, the License Server does not report an error and does not reserve a license.

Example output

9:58:22 (klocwork) FlexNet Publisher 2016 version 11.14.1
9:58:22 (klocwork) Using options file: "C:\Program Files\Klocwork_12.x.x.x\projects_root\licenses\options.opt"
9:58:23 (klocwork) Server started on jlee03 for:     server
9:58:23 (klocwork) RESERVING 1 fixserver2017/162E 9578 7E98 1481  license for HOST jlee01
9:58:23 (klocwork) OUT: "fixserver2017" jlee@lee01
9:58:54 (klocwork) OUT: "fixserver2017" jlee@jlee01
9:59:34 (klocwork) IN: "fixserver2017" jlee@jlee01
10:05:34 (klocwork) IN: "fixserver2017" jlee@jlee01