Connecting CMC to a remote deployment

This page outlines approaches to monitoring a remote Caplin Platform deployment with the Caplin Management Console (CMC).

Overview

The Caplin Management Console (CMC) requires direct network access to the DataSource ports of the components it monitors. How can you monitor remote deployments from your local machine, when your local machine does not have network access to components within those deployments?

This page outlines three approaches:

  • Run CMC locally and connect to the remote deployment via a SOCKS proxy

  • Run CMC remotely and display it locally via X11 forwarding

  • Run CMC remotely on a server with remote desktop access

Run CMC locally with SOCKS

The OpenSSH ssh command includes an optional SOCKS proxy, which you can enable with the command-line option: -D [bind_address]:port.

Java includes support for SOCKS proxies, and you can route a Java application’s TCP traffic via a SOCKS proxy using the java command-line option -DsocksProxyHost=<host>.

Follow the steps below:

  1. Open an SSH connection to a machine in the remote deployment and enable OpenSSH’s optional SOCKS proxy server. The conventional port for a SOCKS proxy is 1080.

    ssh -D 1080 <remote_host>
  2. Start CMC locally with TCP traffic routed via your local SOCKS server:

    java -DsocksProyHost=localhost -jar cmc.jar

Run CMC remotely with X11 forwarding

You can run the CMC remotely on a Red Hat Enterprise Linux (RHEL) server by configuring your SSH connection to forward CMC’s graphical display to an X11 server on your local machine.

This does not require a full graphical shell to be installed on the RHEL server.

Preparing the RHEL server

Follow the steps below:

  1. Run the command below to install the minimal set of packages required to support forwarding X11 over SSH:

    sudo yum install xorg-x11-xauth libXrender libXtst
    If the server has a full GUI installed (uncommon in production systems), the above packages will already be installed.
  2. In the file /etc/ssh/sshd_config, check that the configuration option X11Forwarding is set to yes (default for RHEL 7). If it isn’t, change it to yes and run the command sudo systemctl restart sshd to restart the OpenSSH server.

Connecting from Microsoft Windows

Before continuing, install the software below:

  • A local X11 server. For example, Xming.

  • An SSH client. For example, PuTTY.

Follow the steps below:

  1. Launch your local X server. For example, to launch Xming, click Start > XMing > XLaunch.

  2. In PuTTY (or another SSH client), enable X11 forwarding, and open a new connection to the CMC’s host.

    To enable X11 forwarding in Putty, select Connection > SSH > X11 > Enable X11 forwarding.
  3. In the root directory of the Deployment Framework, run the command below to start the CMC:

    ./dfw cmc

    After a short delay, the CMC’s GUI should display on your local machine.

Connecting from macOS

If you are running a version of macOS before 10.5 (Leopard) or after 10.7 (Lion), install XQuartz.

Follow the steps below:

  1. Run the command below to open an SSH connection, with X11 forwarding, to the CMC’s host:

    ssh -X [<user>@][<host>]
  2. In the root directory of the Deployment Framework, run the command below to start the CMC:

    ./dfw cmc

    After a short delay, the CMC’s GUI should display on your local machine.

Connecting from Linux

Follow the steps below:

  1. Run the command below to open an SSH connection, with X11 forwarding, to the CMC’s host:

    ssh -X [<user>@][<host>]
  2. In the root directory of the Deployment Framework, run the command below to start the CMC:

    ./dfw cmc

    After a short delay, the CMC’s GUI should display on your local machine.

Troubleshooting font rendering

If the CMC’s fonts appear jagged when viewed over a remote X session, then try enabling font anti-aliasing and Java’s XRender-based 2D rendering pipeline.

Follow the steps below:

  1. If you are running Microsoft Windows, enable any support your X11 server has for GPU acceleration and start the X11 server.

  2. Connect to the CMC host over SSH with X11 forwarding enabled.

  3. From the root directory of your Deployment Framework, run the command below to start CMC with extra configuration options for Java 2D and anti-aliasing:

    java -Dsun.java2d.xrender=true \
      -Dawt.useSystemAAFontSettings=on \
      -jar tools/CMC/cmc.jar

For more information on the Java system properties in the command line above, see sun.java2d.xrender and awt.useSystemAAFontSettings.

Run CMC remotely with Remote Desktop access

Follow the steps below:

  1. Open a Remote Desktop connection to the CMC’s host.

  2. On the CMC’s host, open the Bash terminal you use to work with the Deployment Framework on this host. For example, Cygwin.

  3. In root directory of the Deployment Framework, run the command below to start the CMC:

    SESSIONNAME=Console ./dfw cmc

Setting the SESSIONNAME environment variable is required because the Remote Desktop connection overwrites it with a value that is incompatible with the CMC. When the value of this variable is anything other than 'Console', the CMC fails to start and throws the errors below:

Error: Cannot start CMC from this terminal
Error: Command <cmc> failed with code <141>