GitLab
Introduction
Open iT supports GitLab usage reporting starting Open iT version 10.3.
Open iT supports GitLab usage by polling the license servers at regular intervals to get the current status of its license use and availability.
For this collection, the data source is through an API. The data collector/preprocessor initiates the license status utility every hour using a 5-minute sample interval, triggering the data collection process. The license status utility requests the current license usage data from the license manager portal. After the license manager portal provides the requested data, the license status utility passes this information to the data collector/preprocessor. The data collector/preprocessor processes the data, preparing it for transmission. Finally, the preprocessed data is sent to the Core Server at five minutes past every hour (HH:05), according to the client's timezone, for further storage, completing the license usage data collection and processing.
This will produce the following aggregated data types used for historical reporting:
- (49) Host User License Use
- (93) OLAP Raw Hourly
- (94) OLAP User Concurrency
- (95) Usergroup License Use v3.0
- (102) OLAP Total Use
The following sections will guide you in setting up the necessary configuration to collect and send the required data to the server.
Apply the configurations shown in the Open iT Core Client.
Requirements
- An Open iT Core Client connected to an Open iT Core Server or a coexistent Open iT Core setup
- Activated LicenseAnalyzer collection and license poller
- Base URL of the GitLab instance, which is https://gitlab.com by default
- GitLab account with:
- Owner access to the GitLab group when using
https://gitlab.com - Administrator access to the GitLab server when using a self-managed GitLab instance
- Owner access to the GitLab group when using
- GitLab personal access token with read_api scope
- GitLab group ID or full path (required only when using
https://gitlab.com)
Setting up GitLab Account(s)
These are the required steps to set up data collection from GitLab.
- Windows
- Unix
-
Open a command prompt with Administrator level privileges.
-
Go to the bin directory, which is by default in
C:\Program Files\OpeniT\Core\bin, run the command:Command Syntaxcd <bin_dir>Examplecd C:\Program Files\OpeniT\Core\bin -
Set the GitLab credentials, run the command:
Command Syntaxgenlicutil2 gitlab --confignoteIf you need to collect data from a self-managed GitLab instance, use the
--urlparameter when running this command. This allows you to specify the base URL of the GitLab server you want to use for data collection.Command Syntaxgenlicutil2 gitlab --url <base_url> --configwhere
<base_url>is the base URL of the self-managed GitLab instance.Examplegenlicutil2 gitlab --url http://localhost --configIf
--urlis not specified, the utility useshttps://gitlab.comby default.noteIf you need to collect data from more than one GitLab account, use the
--accountparameter when running this command. This allows you to create separate credentials for each account.Command Syntaxgenlicutil2 gitlab --config --account <account_name>where
<account_name>is the name of the account you want to use for data collection.Example 1genlicutil2 gitlab --config --account acct1Example 2genlicutil2 gitlab --url http://localhost --config --account self-managed -
Type in the GitLab group ID or full path when prompted.
Example 1: Entering Group IDEnter GitLab's Group: 1234567Example 2: Entering Group Full PathEnter GitLab's Group: group-nameThen press Enter.
TipThe full path corresponds to the portion of the GitLab URL after
https://gitlab.com/.Subgroups are also supported when using the full path format.
Examples:
https://gitlab.com/group-name→group-namehttps://gitlab.com/group-name/subgroup-name→group-name/subgroup-name
noteThe Group is only required when using
https://gitlab.com. This prompt will not appear if you specified a self-managed GitLab instance. -
Type in the GitLab personal access token when prompted.
Enter token: **************************************************Then press Enter.
Open iT saves the encrypted GitLab credential file, GitLab, in the OpeniT directory, which is by default in C:\ProgramData\OpeniT. When you use the --account parameter, Open iT appends the account name to the credential file (for example, GitLab_acct1). This allows each GitLab account to maintain its own credentials within the same directory.
-
Go to the bin directory, which is by default in
/opt/openit/bin, run the command:Command Syntaxcd <bin_dir>Examplecd /opt/openit/bin -
Set the GitLab credentials, run the command:
Command Syntax./genlicutil2 gitlab --confignoteIf you need to collect data from a self-managed GitLab instance, use the
--urlparameter when running this command. This allows you to specify the base URL of the GitLab server you want to use for data collection.Command Syntax./genlicutil2 gitlab --url <base_url> --configwhere
<base_url>is the base URL of the self-managed GitLab instance.Example./genlicutil2 gitlab --url http://localhost --configIf
--urlis not specified, the utility useshttps://gitlab.comby default.noteIf you need to collect data from more than one GitLab account, use the
--accountparameter when running this command. This allows you to create separate credentials for each account.Command Syntax./genlicutil2 gitlab --config --account <account_name>where
<account_name>is the name of the account you want to use for data collection.Example 1./genlicutil2 gitlab --config --account acct1Example 2./genlicutil2 gitlab --url http://localhost --config --account self-managed -
Type in the GitLab group ID or full path when prompted.
Example 1: Entering Group IDEnter GitLab's Group: 1234567Example 2: Entering Group Full PathEnter GitLab's Group: group-nameThen press Enter.
TipThe full path corresponds to the portion of the GitLab URL after
https://gitlab.com/.Subgroups are also supported when using the full path format.
Examples:
https://gitlab.com/group-name→group-namehttps://gitlab.com/group-name/subgroup-name→group-name/subgroup-name
noteThe Group is only required when using
https://gitlab.com. This prompt will not appear if you specified a self-managed GitLab instance. -
Type in the GitLab personal access token when prompted.
Enter token: **************************************************Then press Enter.
Open iT saves the encrypted GitLab credential file, GitLab, in the openit directory, which is by default in /var/tmp/OpeniT. When you use the --account parameter, Open iT appends the account name to the credential file (for example, GitLab_acct1). This allows each GitLab account to maintain its own credentials within the same directory.
Optional Parameters
| Parameter | Description |
|---|---|
--url <base_url> | Use this to specify the GitLab base URL for self-managed instances. This is set to https://gitlab.com by default. |
--group <id_or_path> | Use this to specify the GitLab group ID or full path. This is required when using https://gitlab.com. |
--account <account_name> | Use this to specify the account you want to use for data collection. |
--debug | Use this to turn on debug logging. |
-h, --help | Use this to display help text. |
Configuring Data Collection
These are the required steps to activate the collection of usage data.
- Windows
- Unix
-
Go to the Components directory, which is by default in
C:\Program Files\OpeniT\Core\Configuration\Components, and back up thelicpoll.xmlconfiguration file. -
Open a command prompt with Administrator level privileges.
-
Go to the bin directory, which is by default in
C:\Program Files\OpeniT\Core\bin, run the command:Command Syntaxcd <bin_dir>Examplecd C:\Program Files\OpeniT\Core\bin -
Once in the directory, copy the object node
genericlicense-sampleand rename it to your desired name. In this example, we will usegenericlicense-gitlab. Run the command:Command Syntaxopenit_confinit -c "licpoll.license-types.genericlicense-sample=>licpoll.license-types.genericlicense-gitlab"warningElement names cannot contain parentheses
(or)because they are not valid for XML element names. -
Activate the collection of GitLab data, run the command:
Command Syntaxopenit_confinit -c "licpoll.license-types.genericlicense-gitlab.active=true" -
Set the status command, run the command:
Command Syntaxopenit_confinit -c "licpoll.license-types.genericlicense-gitlab.status-command=<bin_dir>\genlicutil2.exe"where
<bin_dir>is the path to the bin directory, which is by default inC:\Program Files\OpeniT\Core\bin.Exampleopenit_confinit -c "licpoll.license-types.genericlicense-gitlab.status-command=C:\Program Files\OpeniT\Core\bin\genlicutil2.exe"Alternatively, you can use the
${OpeniT.directories.bin}variable to reference the bin directory dynamically:Alternative Commandopenit_confinit -c "licpoll.license-types.genericlicense-gitlab.status-command=${OpeniT.directories.bin}/genlicutil2.exe" -
Set the arguments to the status command, run the command:
Command Syntaxopenit_confinit -c "licpoll.license-types.genericlicense-gitlab.status-command.arguments=gitlab"noteIf you have multiple GitLab accounts, repeat the configuration steps to create additional object nodes for each account. Use a unique name for every node (for example,
genericlicense-gitlab1,genericlicense-gitlab2, and so on) and specify the corresponding account in the status-command arguments.Example for acct1openit_confinit -c "licpoll.license-types.genericlicense-gitlab1.status-command.arguments=gitlab --account acct1"This ensures that Open iT collects data separately for each configured GitLab account.
-
Run the following command to update the configuration files:
Exampleopenit_confbuilder --clientMake sure no errors are encountered.
Advanced Configuration
Refer to the GitLab Data Collection Configuration table to learn more about GitLab configuration in licpoll.xml.
| Object Name | Accepted Value | Description |
|---|---|---|
| active | Boolean (true or false) | Setting this to true activates GitLab usage data collection. |
| type | String (i.e., GenericLicense) | The license manager type. |
| interval | Timespan (e.g., P30S, P5M, P1H) | The span of time between each polling round (it is recommended to set a value no less than P1M). |
| offset | Timespan (e.g., P30S, P5M, P1H) | The span of time the aligned poll time decided by interval is shifted. |
| product-name | String (e.g., %host%;gitlab) | This object is defined if a vendor license name other than the default %host%;gitlab will be used. |
| license-server | String (e.g., WIN-HOST01) | The license server name. |
| status-command | FileName (i.e., ${OpeniT.directories.bin}/genlicutil2.exe) | The binary used to obtain status from the license manager. |
| status-command.arguments | String (e.g., gitlab) | The arguments used for the status command. |
-
Go to the Components directory, which is by default in
/var/opt/openit/etc/Components, and back up thelicpoll.xmlconfiguration file. -
Go to the bin directory, which is by default in
/opt/openit/bin, run the command:Command Syntaxcd <bin_dir>Examplecd /opt/openit/bin -
Once in the directory, copy the object node
genericlicense-sampleand rename it to your desired name. In this example, we will usegenericlicense-gitlab. Run the command:Command Syntax./openit_confinit -r /var/opt/openit/ -d /var/opt/openit/etc/ -c "licpoll.license-types.genericlicense-sample=>licpoll.license-types.genericlicense-gitlab"warningElement names cannot contain parentheses
(or)because they are not valid for XML element names. -
Activate the collection of GitLab data, run the command:
Command Syntax./openit_confinit -r /var/opt/openit/ -d /var/opt/openit/etc/ -c "licpoll.license-types.genericlicense-gitlab.active=true" -
Set the status command, run the command:
Command Syntax./openit_confinit -r /var/opt/openit/ -d /var/opt/openit/etc/ -c "licpoll.license-types.genericlicense-gitlab.status-command=<bin_dir>/genlicutil2"where
<bin_dir>is the path to the bin directory, which is by default in/opt/openit/bin.Example./openit_confinit -r /var/opt/openit/ -d /var/opt/openit/etc/ -c "licpoll.license-types.genericlicense-gitlab.status-command=/opt/openit/bin/genlicutil2" -
Set the arguments to the status command, run the command:
Command Syntax./openit_confinit -r /var/opt/openit/ -d /var/opt/openit/etc/ -c "licpoll.license-types.genericlicense-gitlab.status-command.arguments=gitlab"noteIf you have multiple GitLab accounts, repeat the configuration steps to create additional object nodes for each account. Use a unique name for every node (for example,
genericlicense-gitlab1,genericlicense-gitlab2, and so on) and specify the corresponding account in the status-command arguments.Example for acct1./openit_confinit -r /var/opt/openit/ -d /var/opt/openit/etc/ -c "licpoll.license-types.genericlicense-gitlab1.status-command.arguments=gitlab --account acct1"This ensures that Open iT collects data separately for each configured GitLab account.
-
Run the following command to update the configuration files:
Example./openit_confbuilder --clientMake sure no errors are encountered.
Advanced Configuration
Refer to the GitLab Data Collection Configuration table to learn more about GitLab configuration in licpoll.xml.
| Object Name | Accepted Value | Description |
|---|---|---|
| active | Boolean (true or false) | Setting this to true activates GitLab usage data collection. |
| type | String (i.e., GenericLicense) | The license manager type. |
| interval | Timespan (e.g., P30S, P5M, P1H) | The span of time between each polling round (it is recommended to set a value no less than P1M). |
| offset | Timespan (e.g., P30S, P5M, P1H) | The span of time the aligned poll time decided by interval is shifted. |
| product-name | String (e.g., %host%;gitlab) | This object is defined if a vendor license name other than the default %host%;gitlab will be used. |
| license-server | String (e.g., host01) | The license server name. |
| status-command | FileName (i.e., ${OpeniT.directories.bin}/genlicutil2) | The binary used to obtain status from the license manager. |
| status-command.arguments | String (e.g., gitlab) | The arguments used for the status command. |
Verifying Data Collection
After configuration, you can verify that the data is collected by following these steps:
- Windows
- Unix
-
Open a command prompt with Administrator level privileges.
-
Go to the bin directory, which is by default in
C:\Program Files\OpeniT\Core\bin, run the command:Command Syntaxcd <bin_dir>Examplecd C:\Program Files\OpeniT\Core\bin -
Run the command:
Command Syntaxopenit_licpoll -# 1 -
Verify that the temp directory, which is by default in
C:\ProgramData\OpeniT\Data\temp, contains a LicPoll directory containing.dataandstatus-*.logfiles.
-
Go to the bin directory, which is by default in
/opt/openit/bin, run the command:Command Syntaxcd <bin_dir>Examplecd /opt/openit/bin -
Run the command:
Command Syntax./openit_licpoll -# 1 -
Verify that the temp directory, which is by default in
/var/opt/openit/temp/, contains a LicPoll directory containing.dataandstatus-*.logfiles.
Sample Report
Real-time Report
This sample report shows a drilled-down feature view of the online licenses in use and the licenses available.