2.5 About the Command Line API Tools

2.5.1 uptrack-api-authorize
2.5.2 uptrack-api-describe
2.5.3 uptrack-api-list
2.5.4 Specifying the User Name and API Key
2.5.5 Specifying a Proxy

The Python bindings include the command line utilities that cover the common uses of the Ksplice Uptrack API. The following sections describe these commands.

2.5.1 uptrack-api-authorize

uptrack-api-authorize uses the authorize API call to change the authorization for a single machine, for example:

$ uptrack-api-authorize -u api_username -k api_key uuid deny
Successfully denied access for uuid.
$ uptrack-api-authorize -u api_username -k api_key uuid allow
Successfully allowed access for uuid .
Note

To view your API user name and API key, log in to https://uptrack.ksplice.com and select the Settings tab.

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

2.5.2 uptrack-api-describe

uptrack-api-describe uses the describe API call to get detailed information on a single machine specified by its UUID, for example:

$ uptrack-api-describe -u api_username -k api_key uuid
    prod1.mydom.com (192.168.1.100)
    Effective kernel: 2.6.18-194.11.1.el5
    This machine is no longer active
    Last seen on 2010-09-12T10:19:35Z
    OS status: Up to date

Alternatively, specify the --this-machine option if you are running the script on the machine that you want to check:

    $ uptrack-api-describe -u api_username -k api_key --this-machine
    qa.mydom.com (192.168.1.200)
    Effective kernel: 2.6.18-194.8.1.el5
    This machine is active
    Last seen on 2010-09-15T12:43:07Z
    OS status: Out of date:
      * Install v8gacfip CVE-2010-2521: Remote buffer overflow in NFSv4 server.
      * Install 3c4sopia CVE-2010-2226: Read access to write-only files in XFS filesystem.
      * Install oiqwvltu CVE-2010-2240: Privilege escalation vulnerability in memory management.

2.5.3 uptrack-api-list

uptrack-api-list uses the machines API call to return a list of all of your machines and their statuses, for example:

$ uptrack-api-list -u api_username -k api_key
    - dev1.mydom.com (192.168.1.102): outofdate
    - qa1.mydom.com (192.168.1.103): outofdate (inactive)
    - prod1.mydom.com (192.168.1.100): uptodate
    - prod2.mydom.com (192.168.1.101): uptodate

2.5.4 Specifying the User Name and API Key

If you set the username and api_key variables in the configuration file /etc/uptrack-api.conf, you do not need to supply these variables as command line arguments to the scripts. Place the variables under an [uptrack] section heading, for example:

[uptrack]
username = jo.admin@mydom.com
api_key  = 3af3c2c1ec407feb0fdc9fc1d8c4460c 

You can also set the user name and api key in the UPTRACK_API_USERNAME and UPTRACK_API_KEY environment variables, for example:

$ export UPTRACK_API_USERNAME=jo.admin@mydom.com
$ export UPTRACK_API_KEY=3af3c2c1ec407feb0fdc9fc1d8c4460c
$ uptrack-api-describe --this-machine

2.5.5 Specifying a Proxy

If you access the Internet via a proxy, specify the connection information in the [uptrack] section of /etc/uptrack-api.conf:

https_proxy = [protocol://][username:password@]proxy[:port] 

where protocol is http or https, username and password authenticate you with the proxy (if required), and proxy and port are the host name or IP address and port number used to connect to the proxy.

For example:

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

The proxy must support HTTPS connections.