[V5.0.7 or later]

Obtaining health check data of Developer Portal servers by using a REST API call

You can check the status of a Developer Portal cluster by calling a cluster health REST API.

About this task

From IBM® API Connect Version 5.0.7.2, you can use the cluster health REST API to dynamically determine the health and status of a Developer Portal cluster. The cluster health API returns details about each server in the cluster, including system uptime, disk usage, web server hits, and CPU usage.

Procedure

To call the cluster health REST API, complete the following steps:

  1. Enter the following URL into a web browser:
    https://portal_node:2443/node/clusterhealth
    Where portal_node is the host name of the Developer Portal node that you want to check.
  2. Supply the following user credentials:
    • User Name: status
    • Password: !n0r1t5@C
    Note: The status user can access only the cluster health API; this user cannot access any other parts of IBM API Connect. If required, the password of the status user, a portal Linux operating system user, can be changed in the Developer Portal CLI by the admin user.
  3. Click OK.
    The web browser returns the following health and status information for each node in the cluster (or a standalone node) in JSON format.
    • Node details:
      • rc - return code
      • ip - IP address of the server
      • hostname - host name of the node
      • version - Developer Portal system version
      • installDirectory - installation directory
      • os - operating system and version
      • uptime - uptime of the node in seconds since the last reboot
      • cpus - number of CPUs
      • usage - CPU usage as a percentage of total CPU available
      • load1 - average CPU load for the last 1 minute
      • load5 - average CPU load for the last 5 minutes
      • load15 - average CPU load for the last 15 minutes
    • Disk details:
      • free - amount in megabytes of free disk space
      • used - amount in megabytes of used disk space
      • total - amount in megabytes of total disk space
    • RAM details:
      • free - amount in megabytes of free RAM
      • used - amount in megabytes of used RAM
      • total - amount in megabytes of total RAM
    • Swap space details:
      • free - amount in megabytes of free swap space
      • used - amount in megabytes of used swap space
      • total - amount in megabytes of total swap space
    • Web traffic and database details:
      • webHits - number of web traffic hits per minute
      • transactions - number of database transactions per minute

Example

The following example shows a cluster of three nodes:
{
  "servers" : [
    {
      "rc" : 0,
      "ip" : "1.2.3.4",
      "hostname" : "portalnodename",
      "version" : "5.0.7.2-20170629-1751",
      "installDirectory" : "/",
      "os" : "Ubuntu 16.04",
      "uptime" : 175636,
      "cpu" : {
        "cpus" : 4,
        "usage" : 61,
        "load1" : 2.58,
        "load5" : 2.88,
        "load15" : 2.90
      },
      "disk" : {
        "free" : 81952,
        "used" : 18555,
        "total" : 100507
      },
      "ram" : {
        "free" : 7617,
        "used" : 8431,
        "total" : 16048
      },
      "swap" : {
        "free" : 1000,
        "used" : 1047,
        "total" : 2047
      },
      "webHits" : 7,
      "transactions" : 39560
    },
    {
      "rc" : 0,
      "ip" : "1.2.3.5",
      "hostname" : "portalnodename",
      "version" : "5.0.7.2-20170629-1751",
      "installDirectory" : "/",
      "os" : "Ubuntu 16.04",
      "uptime" : 679078,
      "cpu" : {
        "cpus" : 4,
        "usage" : 64,
        "load1" : 3.71,
        "load5" : 3.54,
        "load15" : 3.16
      },
      "disk" : {
        "free" : 82300,
        "used" : 18207,
        "total" : 100507
      },
      "ram" : {
        "free" : 6474,
        "used" : 9574,
        "total" : 16048
      },
      "swap" : {
        "free" : 1563,
        "used" : 484,
        "total" : 2047
      },
      "webHits" : 8,
      "transactions" : 50376
    },
    {
      "rc" : 0,
      "ip" : "1.2.3.6",
      "hostname" : "portalnodename",
      "version" : "5.0.7.2-20170629-1751",
      "installDirectory" : "/",
      "os" : "Ubuntu 16.04",
      "uptime" : 679160,
      "cpu" : {
        "cpus" : 4,
        "usage" : 66,
        "load1" : 3.26,
        "load5" : 3.07,
        "load15" : 2.96
      },
      "disk" : {
        "free" : 82921,
        "used" : 17586,
        "total" : 100507
      },
      "ram" : {
        "free" : 5607,
        "used" : 10441,
        "total" : 16048
      },
      "swap" : {
        "free" : 1470,
        "used" : 577,
        "total" : 2047
      },
      "webHits" : 3,
      "transactions" : 37069
    }
  ]
}
The following example shows the server array entry when a server cannot be contacted:
{
      "rc" : 255,
      "ip" : "1.2.3.4",
      "error" : "Host key verification failed.\r"
    }