Software Metering API (classic)
Overview
To integrate program usage data with external systems, Portal provides an API to query the historical details of Software Metering dashboards.
The client of the Software Metering API must trust the certificate in the primary Appliance (Portal).
To authenticate the client, the Software Metering API uses Basic Authentication. Nexthink recommends creating a local account to exclusively authenticate clients of the API.
Finding out available metrics
To interactively look for Software Metering data that is available through the API:
Point a web browser to the following address:
Substitute
<Portal_DNS_FQDN>
for the actual name of Portal.
Log in to the discovery tool of the Software Metering API as a user with the right to see software metering metrics (either because the user can see all metrics or because the associated software metering module is included in the roles of the user).
Type in the user credentials whenever asked by the web browser.
The discovery tool displays only the available metrics in the view domain of the user.
Select a metric from the table.
Select an available hierarchy.
Optional: Select a program to restrict the output to a particular program.
Optional: Select a node (below Path) to restrict the output to a node of the hierarchy. Repeat for each level of the hierarchy.
Get the metric details for the entities where the package is installed or where the program is under usage and format is one of table (for an HTML table), csv, or json:
Installed (format)
Underusage (format)
Once you have reached the desired details of the metric, note down the URL built by the discovery tool to programmatically query the API later with the same request or use it as a base for your own requests.
Querying the API
To query the Software metering API, send a GET request to a URL that includes the following parameters:
metric
UID of the desired metric
(none)
hierarchy
Name of a hierarchy
The name of the first hierarchy in Portal
program
UID of the program to measure (binary object)
(none)
list
Type of to list in the output:
installed
underusage
installed
path
Name of a node in the hierarchy to limit the output. Chain several path elements to limit the output further down in the hierarchy levels.
The highest node in the view domain of the user
format
Output format, one of:
table (for an HTML table)
json
csv
table
Example of a query URL:
The Software Metering API uses Basic Authentication. To test the API from a Nexthink appliance, you can use curl
, for instance:
Output of the Software Metering API
The output of the API is similar to the details of Software Metering metrics that you can explore in Portal. Two data fields are exclusively found on the API, though:
Entity
First date with package
Find below the complete list of outputs of the Software Metering API:
Device
The name of a device that has at least one of the packages installed.
Entity
The name of the entity to which the device belongs.
Average usage per day (seconds)
The average usage per day of significant binaries on the device, expressed in seconds.
Average executions per day
The average number of executions per day of significant binaries on the device.
First date with package
The date of first detection of the earliest detected package on the device.
Last activity
The date of last activity of the latest executed significant binary on the device.
Binaries
Lists the binaries that where used on the device. It is either a collection of the binaries used (output in json format), or a list of the significant binaries followed by yes, if the binary was actually used, and no, if the binary was not used (output in table or csv formats).
RELATED TASKS
RELATED REFERENCES
Last updated