Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
titleDeprecation Announcement

The functionality of the script presented in the article is migrated to JS7 - Unix Shell CLI for JOC Cockpit Status Operations

Users can continue to use the below script, no maintenance is provided.

Table of Contents

Introduction

  • The JS7 offers to perform any operation operations on orders, workflows, jobs and related objects by the JS7 - REST Web Service API.
  • The REST Web Service API can be accessed from Shell utilities such as curl.
  • In addition, a PowerShell module is available for simplified access to the REST Web Service API. This is described in the JS7 - PowerShell Module article.

The Check License Script introduced in this article can be used to check if a JS7 - License is valid or is about to expire.

An implementation of license checks for use with alert workflows is available from the JS7 - JITL CheckLicenseJob.

License Check Script

The License Check Script is provided for download and can be used to automate checks for license expiration.

...

The Check License Script requires the jq utility to be available from the operating system. 

jq is ships with the MIT license, see https://opensource.org/licenses/MIT.

...

Code Block
titleExample for License Check
linenumberstrue
./check-license.sh \
    --url=https://joc-2-0-primary:7446 \
    --cacert=/home/sos/jstest/certs/root-ca.pem \
    --user=root \
    --validity-days=60 \
    -p
 
# checks if a valid license is available that will not expire before the next 60 days
# establishes the connection to JOC Cockpit by HTTPS and the Root CA Certificate is specified from the path to a .pem file
# asks the user for interactive keyboard input of the password used for the account specified

Resources