Installing the ConnectAgent on Rocky / RedHat

Installing on Linux (RedHat based)

This installation has to be performed with root rights.

Before you can begin your installation check if your SELINUX is disabled. Check if the configuration  of SELINUX is disabled.

  • Open the file /etc/selinux/config
  • Check if the option SELINUX is disabled
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
  • Restart the machine if SELINUX was not disabled

Check your firewall setting on the local machine. If you are not using the ConnectPlaza Reverse Gateway check your main firewall as well. The machine where the ConnectAgent is installed must have a connection with the internet via port 80 and port 443, the normal HTTP ports.

You can perform a test with telnet to check if your machine can access the internet. Start telnet and try to connect to a machine and port number. See example below.

# telnet www.nu.nl 80
Trying 62.69.166.254...
Connected to nu.nl.
Escape character is '^]'.

If you get above result, you can connect to the selected server at the selected port

  • Copy the agent.zip to the installation directory. We use /opt/ to install our agent. If you have more than one agent running on the machine, select a free directory or create one.
  • Unzip the agent.zip file. You will end up with a connectplaza-agent directory
cd /opt
unzip agent.zip
ll

total 312872
-rw-r--r--  1 root root 320374140 Oct 16 09:13 agent.zip
drwxr-xr-x 13 root root      4096 Jul 29 08:06 connectplaza-agent
  • Set the execute rights to .sh files
cd /opt/connectplaza-agent
find . -name *.sh -type f -exec chmod +x {} \;

Installing the ConnectAgent as a Linux service

If you have installed the ConnectAgent and set all the execution rights to the scripts, you are able to install the ConnectAgent as a Linux service. To install the ConnectAgent service run the script below.

[root@agent bin]# ./installAgentAsAService.sh
11:06:30.454255019 set executable rights on scripts
11:06:30.585752630 start convert.sh
11:06:30.617715955 start install_jdk.sh
11:06:30.619650162 Download OpenJDK17U-jre_x64_linux_hotspot_17.0.9_9.tar.gz
11:06:32.729957569 Extract OpenJDK17U-jre_x64_linux_hotspot_17.0.9_9.tar.gz to jdk-17.0.9+9-jre
11:06:33.463590522 Symlink jdk-17.0.9+9-jre to jdk
11:06:33.465756330 Remove OpenJDK17U-jre_x64_linux_hotspot_17.0.9_9.tar.gz
11:06:34.232722213 executing convert script
11:06:34.233630517 OLDAGENTDIR /opt/connectplaza-agent/convert/..
11:06:34.234389120 NEWAGENTDIR /opt/connectplaza-agent/convert/../agent-5.0.0.RC6
11:06:34.235089022 VERSION 5.0.0.RC6
11:06:34.238609036 Agent process not running
mkdir: created directory 'agent-5.0.0.RC6'
11:06:34.240534443 move adapters to agent-5.0.0.RC6
11:06:34.242530151 move bat to agent-5.0.0.RC6
11:06:34.244237158 move bin to agent-5.0.0.RC6
11:06:34.245819364 move jars to agent-5.0.0.RC6
11:06:34.247266770 move agent-5.0.0.RC6/jars/endorsed to /opt/connectplaza-agent/convert/..
11:06:34.248741375 move connectplaza-agent-updater to agent-5.0.0.RC6
11:06:34.250272281 move connectplaza-wrapper to agent-5.0.0.RC6
11:06:34.251739387 move conf to agent-5.0.0.RC6
11:06:34.253267393 move context to agent-5.0.0.RC6
11:06:34.258992215 point jdk to ../jdk-17.0.9+9-jre
11:06:34.261550925 create activemq-data
11:06:34.262880130 create temp
11:06:34.264274536 point agent to agent-5.0.0.RC6
11:06:34.265517241 point activemq-data to ../activemq-data
11:06:34.266794446 point temp to ../temp
11:06:34.268025450 point logs to ../logs
11:06:34.269497456 point .data to ../.data
11:06:34.271188163 point endorsed to ../../endorsed
11:06:34.725886631 remove /opt/connectplaza-agent/convert
CMDOUTPUT: ++++++++++ YAJSW SET ENV ++++++++++
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
wrapper home : /opt/connectplaza-agent/agent/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-agent/agent/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
---------- YAJSW SET ENV ----------
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
wrapper home : /opt/connectplaza-agent/agent/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-agent/agent/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-stable-13.11
OS   : Linux/5.14.0-427.13.1.el9_4.x86_64/amd64
JVM  : Eclipse Adoptium/17.0.9//opt/connectplaza-agent/jdk-17.0.9+9-jre/64
Looking in classpath from org.rzo.yajsw.boot.WrapperClassLoader@6b884d57 for /com/sun/jna/linux-x86-64/libjnidispatch.so
Found library resource at jar:file:/opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/./lib/core/jna/jna-5.12.1.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Extracting library to /opt/connectplaza-agent/agent/connectplaza-wrapper/yajsw/tmp/jna1395718751469316284.tmp
Trying /opt/connectplaza-agent/agent/connectplaza-wrapper/yajsw/tmp/jna1395718751469316284.tmp
Found jnidispatch at /opt/connectplaza-agent/agent/connectplaza-wrapper/yajsw/tmp/jna1395718751469316284.tmp
setCliProperties []
_cliProperties.size() 0
************* INSTALLING connectplaza-agent ***********************

Oct 16, 2024 11:06:35 AM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/wrapper.connectplaza-agent.pid
[main] WARN org.apache.velocity.deprecation - configuration key 'resource.loader' has been deprecated in favor of 'resource.loaders'
[main] WARN org.apache.velocity.deprecation - configuration key 'file.resource.loader.path' has been deprecated in favor of 'resource.loader.file.path'
Oct 16, 2024 11:06:35 AM org.rzo.yajsw.os.posix.PosixService install
WARNING: created daemon script: /etc/systemd/system/connectplaza-agent.service
Service connectplaza-agent installed
modifying service file : /etc/systemd/system/connectplaza-agent.service

As of version 4.1 the init.d scripts are no longer supported. The service to start the ConnectAgent will be moved to the systemd service.

As of version 5.0 the correct JAVA JDK will be automatically downloaded to your system and placed in the ConnectPlaza Agent directory.

You can now start / stop the ConnectAgent with the following commands:

./agent.sh start|stop

Starting / Stopping the ConnectAgent and ConnectAgent Service

You can start the ConnectAgent via a terminal session or via the Linux service. If the service is installed, the command will start/stop the service. Otherwise the command runs the ConnectAgent as a normal command.

Starting / stopping with the start-up script

Starting the ConnectAgent via the start-up script is ideal for testing purposes. Start the ConnectAgent with the following command.

cd /opt/connectplaza-agent/bin
./agent.sh start 

When the service is started you will see the following lines at the end of the connectplaza-agent.log file in the ../logs directory.

20241016 11:09:45.714 [waitForStartUp] INFO  c.c.a.s.ConnectPlazaAdapterExtender - Agent startup complete and took 0:00:54.785

You can stop the ConnectAgent with the following command:

./agent.sh stop 

Getting the status of the ConnectAgent service

There are two ways to get the status of the ConnectAgent service.

You can check the service using the status option of the service command. The service will provide you with extra information about the connectplaza-agent service.

[root@agent bin]# systemctl status connectplaza-agent
● connectplaza-agent.service - ConnectPlaza Agent
     Loaded: loaded (/etc/systemd/system/connectplaza-agent.service; enabled; preset: disabled)
     Active: active (running) since Wed 2024-10-16 11:10:31 CEST; 38s ago
       Docs: http://yajsw.sourceforge.net/
    Process: 75571 ExecStart=/opt/connectplaza-agent/agent/jdk/bin/java -Dwrapper.pidfile=/opt/connectplaza-agent/agent/connectplaza-wrapper/wrapper.connectplaza-agent.pid -Dwrapper.service=true -Dwrapper.visible=false -Djna_tmpdir=/opt>
   Main PID: 75592 (java)
      Tasks: 184 (limit: 23143)
     Memory: 548.5M
        CPU: 24.400s
     CGroup: /system.slice/connectplaza-agent.service
             ├─75592 /opt/connectplaza-agent/jdk-17.0.9+9-jre/bin/java -Dwrapper.pidfile=/opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/wrapper.connectplaza-agent.pid -Dwrapper.service=true -Dwrapper.visible=false -Djna_tm>
             ├─75614 /opt/connectplaza-agent/jdk-17.0.9+9-jre/bin/java -classpath /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/wrapperApp.jar:/opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/lib/c>
             └─75679 /opt/connectplaza-agent/jdk-17.0.9+9-jre/bin/java -cp ":/opt/connectplaza-agent/agent-5.0.0.RC6/jars/*:/opt/connectplaza-agent/agent-5.0.0.RC6/conf:/opt/connectplaza-agent/agent-5.0.0.RC6/jars/endorsed/*" -Dfile.enc>

Oct 16 11:10:28 agent.connectplaza.com java[75571]: Oct 16, 2024 11:10:28 AM org.rzo.yajsw.os.posix.PosixService startProcess
Oct 16 11:10:28 agent.connectplaza.com java[75571]: INFO: calling /opt/connectplaza-agent/jdk-17.0.9+9-jre/bin/java -Dwrapper.pidfile=/opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/wrapper.connectplaza-agent.pid -Dwrapper.>
Oct 16 11:10:28 agent.connectplaza.com java[75571]: Oct 16, 2024 11:10:28 AM org.rzo.yajsw.os.posix.PosixService getPid
Oct 16 11:10:28 agent.connectplaza.com java[75571]: INFO: wrapper pid file: /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/wrapper.connectplaza-agent.pid
Oct 16 11:10:30 agent.connectplaza.com java[75571]: Oct 16, 2024 11:10:30 AM org.rzo.yajsw.os.posix.PosixService getPid
Oct 16 11:10:30 agent.connectplaza.com java[75571]: INFO: wrapper pid file: /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/wrapper.connectplaza-agent.pid
Oct 16 11:10:30 agent.connectplaza.com java[75571]: Oct 16, 2024 11:10:30 AM org.rzo.yajsw.os.posix.PosixService getPid
Oct 16 11:10:30 agent.connectplaza.com java[75571]: INFO: wrapper pid file: /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/wrapper.connectplaza-agent.pid
Oct 16 11:10:30 agent.connectplaza.com java[75571]: Service connectplaza-agent started
Oct 16 11:10:31 agent.connectplaza.com systemd[1]: Started ConnectPlaza Agent.

If you want some more information about the ConnectAgent, you can run the queryAgentService.sh command in the <ConnectPlaza Install Directory>/bin/ directory

[root@agent bin]# ./queryAgentService.sh
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
wrapper home : /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
---------- YAJSW SET ENV ----------
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
wrapper home : /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-stable-13.11
OS   : Linux/5.14.0-427.13.1.el9_4.x86_64/amd64
JVM  : Eclipse Adoptium/17.0.9//opt/connectplaza-agent/jdk-17.0.9+9-jre/64
Looking in classpath from org.rzo.yajsw.boot.WrapperClassLoader@6b884d57 for /com/sun/jna/linux-x86-64/libjnidispatch.so
Found library resource at jar:file:/opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/./lib/core/jna/jna-5.12.1.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Extracting library to /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/tmp/jna11098920031904705092.tmp
Trying /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/tmp/jna11098920031904705092.tmp
Found jnidispatch at /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/tmp/jna11098920031904705092.tmp
setCliProperties []
Oct 16, 2024 11:11:30 AM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/systemd/system/connectplaza-agent.service already exists
_cliProperties.size() 0
Oct 16, 2024 11:11:30 AM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/wrapper.connectplaza-agent.pid
Name        : connectplaza-agent
Installed   : true
Running     : true
Interactive : false
Automatic   : false
Manual      : false
Disabled    : false
Paused      : false
Unknown      : false

Above information will be presented to you.

Uninstalling the ConnectAgent service

Follow the next steps to uninstall the ConnectAgent.

  • Go to the directory <ConnectPlaza installation directory>/bin
  • Uninstall the service with

[root@agent bin]# ./uninstallAgentService.sh
daemondir = /etc/systemd/system
servicename = connectplaza-agent
user =
group=
killmode= control-group
KillMode= set to control-group
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
wrapper home : /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
---------- YAJSW SET ENV ----------
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
wrapper home : /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-stable-13.11
OS   : Linux/5.14.0-427.13.1.el9_4.x86_64/amd64
JVM  : Eclipse Adoptium/17.0.9//opt/connectplaza-agent/jdk-17.0.9+9-jre/64
Looking in classpath from org.rzo.yajsw.boot.WrapperClassLoader@6b884d57 for /com/sun/jna/linux-x86-64/libjnidispatch.so
Found library resource at jar:file:/opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/./lib/core/jna/jna-5.12.1.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Extracting library to /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/tmp/jna6605866529712962636.tmp
Trying /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/tmp/jna6605866529712962636.tmp
Found jnidispatch at /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/yajsw/tmp/jna6605866529712962636.tmp
setCliProperties []
Oct 16, 2024 11:11:53 AM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/systemd/system/connectplaza-agent.service already exists
_cliProperties.size() 0
************* REMOVING connectplaza-agent ***********************

Oct 16, 2024 11:12:01 AM org.rzo.yajsw.os.posix.PosixService stop
INFO:
Oct 16, 2024 11:12:01 AM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/wrapper.connectplaza-agent.pid
Oct 16, 2024 11:12:01 AM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-agent/agent-5.0.0.RC6/connectplaza-wrapper/wrapper.connectplaza-agent.pid
Service connectplaza-agent removed

Installing multiple ConnectAgents on a single server

Installing multiple ConnectAgents on a single server is possible, but requires some configuration changes done by the user before installing the service. Mainly because port numbers will overlap and service names must be different.

Installing the second ConnectAgent

Register a new end-user and download the agent.zip file. Using the generated .zip file, set the correct port numbers for your new agent.

Place the agent.zip file in a predefined directory where you can unzip the agent.zip file.

For instance, we place the file in the predefined directory /opt/install/, and unzip the file.

cd /opt/
mkdir install
cd install
unzip agent.zip
mv connectplaza-agent /opt/connectplaza-agent-2
cd /opt/connectplaza-agent-2
find . -name *.sh -type f -exec chmod +x {} \;

Modifying the configuration files

We have to make two changes within some configuration files.

  • conf/connectplaza-agent.properties

We have to make some changes in the ConnectPlaza configuration file. Mainly because some port numbers will overlap and the ConnectAgent will not start. We will modify the following configuration file.

  • conf/connectplaza-agent.properties

  • connectplaza-wrapper/yajsw/conf/wrapper.conf

connectplaza-agent.properties

 

String Change
connect.mbean.server.connector.url=service:jmx.jmxmp://localhost:9876 Uncomment this line and change the port number

wrapper.conf

String Change
wrapper.ntservice.name connectplaza-agent-2
wrapper.ntservice.displayname ConnectPlaza Agent 2
wrapper.ntservice.description ConnectPlaza Agent 2

Installing the second systemd script

Just install the script with the default install script for the systemd service.

cd /opt/connectplaza-agent-2/bin
./installAgentAsAService.sh

Starting the second agent

Start the second ConnectAgent by starting the service.

# ./agent.sh start