Using the Ksplice Uptrack API Commands

The Python bindings include the following commands, which cover common uses of the Ksplice Uptrack API.

The commands use the API user name and key for authentication.

Setting the API Username and Key Variables

If you set the API username and key as variables that can be loaded each time you run any of the API commands, you don't need to supply these variables as command line arguments to the scripts.

See also Working With API Credentials.

The following options to set the variables are available:

  • Set the username and api_key variables in the /etc/uptrack-api.conf file.
    Place the variables under an [uptrack] section heading, for example:
    [uptrack]
    username = jo.admin@example.com
    api_key  = 3af3c2c1ec407feb0fdc9fc1d8c4460c 
  • Set the UPTRACK_API_USERNAME and UPTRACK_API_KEY environment variables.

    For example:

    export UPTRACK_API_USERNAME=jo.admin@example.com
    export UPTRACK_API_KEY=3af3c2c1ec407feb0fdc9fc1d8c4460c

Specifying a Proxy

If you access the internet by using a proxy, specify the connection information in the [uptrack] section of the /etc/uptrack-api.conf file, as shown in the following example:
https_proxy = [protocol://][username:password@]proxy[:port] 

In the previous example, protocol is either specified as http or https, username and password authenticate you with the proxy (if required), and proxy and port are the host name/IP address and port number that you use to connect to the proxy server.

The following example shows how you might specify this connection information:

https_proxy = http://proxy.example.com:3128/

Note that the proxy must support HTTPS connections.

uptrack-api-authorize

The uptrack-api-authorize command uses the authorize API call to change the authorization for a single system, as shown in the following examples.

  • To deny a system:

    uptrack-api-authorize -u api_username -k api_key uuid deny

    Output might appear as follows:

    Successfully denied access for uuid.
  • To allow a system:

    uptrack-api-authorize -u api_username -k api_key uuid allow

    Output might appear as follows:

    Successfully allowed access for uuid .

Note:

To view the API username and API key, sign in to https://status-ksplice.oracle.com and then select the Settings tab. You can also optionally set these so that you don't need to specify them each time you run a command. See Setting the API Username and Key Variables.

The UUID of a registered system is stored in /var/lib/uptrack/uuid on the system. An example of a UUID is e82ba0ae-ad0a-4b92-a776-62b502bfd29d.

uptrack-api-describe

The uptrack-api-describe command uses the describe API call to get detailed information about a single system, which is specified by its UUID, for example:

uptrack-api-describe -u api_username -k api_key uuid

Output might appear as follows:

prod1.example.com (192.168.1.100)
Effective kernel: 6.12.0-0.20.20.el9uek
This machine is no longer active
Last seen on 2025-05-12T11:19:21Z
OS status: Up to date

Or, you can specify the --this-machine option if you're running the script on the system you want to check:

uptrack-api-describe -u api_username -k api_key --this-machine

Output might appear as follows:

qa.example.com (192.168.1.200)
Effective kernel: 5.15.0-304.171.4.el8uek
This machine is active
Last seen on 2025-05-12T11:22:07Z
OS status: Out of date:
   * Install dv4m9d3r Improved update for Denial-of-service when checking if an address is a jump label.
   * Install d6eukcmk Enablement update for live patching.
   * Install bk3v6mgo Denial-of-service when checking if an address is a jump label.
   * Install m96ph72r Enable livepatching of jump labels.
   * Install eu43qhnj Known exploit detection.
   * Install 74a4h3ep Known exploit detection for CVE-2019-9213.
...

Note:

To view the API username and API key, sign in to https://status-ksplice.oracle.com and then select the Settings tab. You can also optionally set these so that you don't need to specify them each time you run a command. See Setting the API Username and Key Variables.

uptrack-api-list

The uptrack-api-list command uses the machines API call to return a list of all systems and their status, for example:

uptrack-api-list -u api_username -k api_key

Output might appear as follows:

- dev1.example.com (192.168.1.102): outofdate
- qa1.example.com (192.168.1.103): outofdate (inactive)
- prod1.example.com (192.168.1.100): uptodate
- prod2.example.com (192.168.1.101): uptodate

Note:

To view the API username and API key, sign in to https://status-ksplice.oracle.com and then select the Settings tab. You can also optionally set these so that you don't need to specify them each time you run a command. See Setting the API Username and Key Variables.