Installing the ConnectAgent on CentOS / RedHat

Installing on Linux CentOS / Red Hat

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.

  • Install the Adopt Java version and check the directory of the java executable. You need this path later in the configuration.
    Preferably, do not use the default OpenJDK version of your platform. You can break your application if the you update the machine via the yum command and the OpenJDK of your machine updates with it.
  • 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

-rw-r--r--   1 root root 121149649 Nov  2 16:19 agent.zip
drwxr-xr-x  11 root root      4096 Nov  1 17:08 connectplaza-agent
drwxr-xr-x.  4 root root      4096 Nov  3 09:32 install
drwxr-xr-x.  2 root root      4096 Mar 26  2015 rh
  • Set the execute rights to .sh files
# cd /opt/connectplaza-agent
# find . -name *.sh -type f -exec chmod +x {} \;
  • Edit the file wrapper.conf in the directory /opt/connectplaza-agent/connectplaza-wrapper/yajsw/conf/. At the end of the file you will find the parameter wrapper.java.command. At the path en filename to the java executable here.
#********************************************************************
# genConfig: further Properties generated by genConfig
#********************************************************************
placeHolderSoGenPropsComeHere=
wrapper.java.command = <path to java executable>/java
wrapper.java.classpath.1 = ./yajsw/wrapper.jar
wrapper.java.classpath.2 = ./yajsw/wrapperApp.jar
wrapper.java.classpath.3 = ./yajsw/lib/core/commons/*
wrapper.java.classpath.4 = ./yajsw/lib/core/jna/*
wrapper.java.classpath.5 = ./yajsw/lib/core/netty/*
wrapper.java.classpath.6 = ./yajsw/lib/core/yajsw/*
wrapper.java.classpath.7 = ./yajsw/lib/extended/abeille/*
wrapper.java.classpath.8 = ./yajsw/lib/extended/commons/*
wrapper.java.classpath.9 = ./yajsw/lib/extended/cron/*
wrapper.java.classpath.10 = ./yajsw/lib/extended/glazedlists/*
wrapper.java.classpath.11 = ./yajsw/lib/extended/groovy/*
wrapper.java.classpath.12 = ./yajsw/lib/extended/jgoodies/*
wrapper.java.classpath.13 = ./yajsw/lib/extended/keystore/*
wrapper.java.classpath.14 = ./yajsw/lib/extended/regex/*
wrapper.java.classpath.15 = ./yajsw/lib/extended/velocity/*
wrapper.java.classpath.16 = ./yajsw/lib/extended/vfs-dbx/*
wrapper.java.classpath.17 = ./yajsw/lib/extended/vfs-webdav/*
wrapper.java.classpath.18 = ./yajsw/lib/extended/yajsw/*
wrapper.java.classpath.19 = ./yajsw/lib/groovy/jasypt/*
wrapper.java.classpath.20 = ./yajsw/lib/groovy/joda/*
wrapper.java.classpath.21 = ./yajsw/lib/groovy/mail/*
wrapper.java.classpath.22 = ./yajsw/lib/groovy/snmp/*
wrapper.java.classpath.23 = ./jars/*.jar
wrapper.java.classpath.24 = ./conf

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.

# cd bin
# ./installAgentAsAService.sh
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
wrapper home : /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
---------- YAJSW SET ENV ----------
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
wrapper home : /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-stable-12.15
OS   : Linux/3.10.0-1160.25.1.el7.x86_64/amd64
JVM  : Red Hat, Inc./1.8.0_292//usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre/64
************* INSTALLING connectplaza-agent ***********************

May 31, 2021 11:04:54 AM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/connectplaza-wrapper/wrapper.connectplaza-agent.pid
May 31, 2021 11:04:54 AM org.rzo.yajsw.os.posix.PosixService install
WARNING: created daemon script: /etc/systemd/system/connectplaza-agent.service
Service connectplaza-agent installed

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.

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

systemctl start|stop|status connectplaza-agent

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 log.

.11:15:47.009 [waitForStartUp] INFO  c.c.a.s.ConnectPlazaAdapterExtender - Agent startup complete.
 Absolute path version.xml : /opt/connectplaza-bundle/connectplaza-agent-4.1.0/version.xml

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.

# systemctl status connectplaza-agent
● connectplaza-agent.service - ConnectPlaza Agent
   Loaded: loaded (/etc/systemd/system/connectplaza-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2021-05-31 11:17:52 CEST; 56s ago
     Docs: http://yajsw.sourceforge.net/
  Process: 14103 ExecStop=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre/bin/java -Dwrapper.pidfile=/opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/connectplaza-wrapper/wrapper.connectplaza-agent.pid -Dwrapper.service=true -Dwrapper.visible=false -Djna_tmpdir=/opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw/../../temp/yajsw-updater -Dwrapper_home=/opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw -Dwrapper.working.dir=/opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw/.. -jar /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/connectplaza-wrapper/yajsw/wrapper.jar -px /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/connectplaza-wrapper/yajsw/conf/wrapper.conf (code=exited, status=0/SUCCESS)
  Process: 14734 ExecStart=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre/bin/java -Dwrapper.pidfile=/opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/connectplaza-wrapper/wrapper.connectplaza-agent.pid -Dwrapper.service=true -Dwrapper.visible=false -Djna_tmpdir=/opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw/../../temp/yajsw-updater -Dwrapper_home=/opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw -Dwrapper.working.dir=/opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw/.. -jar /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/connectplaza-wrapper/yajsw/wrapper.jar -tx /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/connectplaza-wrapper/yajsw/conf/wrapper.conf (code=exited, status=0/SUCCESS)
 Main PID: 14752 (java)
   CGroup: /system.slice/connectplaza-agent.service
           ├─14752 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre/bin/java -Dwrapper.pidfile=/opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSH...
           ├─14771 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre/bin/java -classpath /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/c...
           └─14834 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre/bin/java -cp /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/jars/ecj...

May 31 11:17:49 contest7.connectplaza.com java[14734]: May 31, 2021 11:17:49 AM org.rzo.yajsw.os.posix.PosixService startProcess
May 31 11:17:49 contest7.connectplaza.com java[14734]: INFO: calling /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre/bin/java -Dwrapper.pidfi.../connectp
May 31 11:17:49 contest7.connectplaza.com java[14734]: May 31, 2021 11:17:49 AM org.rzo.yajsw.os.posix.PosixService getPid
May 31 11:17:49 contest7.connectplaza.com java[14734]: INFO: wrapper pid file: /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/connectplaza-wrap...agent.pid
May 31 11:17:51 contest7.connectplaza.com java[14734]: May 31, 2021 11:17:51 AM org.rzo.yajsw.os.posix.PosixService getPid
May 31 11:17:51 contest7.connectplaza.com java[14734]: INFO: wrapper pid file: /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/connectplaza-wrap...agent.pid
May 31 11:17:51 contest7.connectplaza.com java[14734]: May 31, 2021 11:17:51 AM org.rzo.yajsw.os.posix.PosixService getPid
May 31 11:17:51 contest7.connectplaza.com java[14734]: INFO: wrapper pid file: /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/connectplaza-wrap...agent.pid
May 31 11:17:51 contest7.connectplaza.com java[14734]: Service connectplaza-agent started
May 31 11:17:52 contest7.connectplaza.com systemd[1]: Started ConnectPlaza Agent.
Hint: Some lines were ellipsized, use -l to show in full.

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

#  ./queryAgentService.sh
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
wrapper home : /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
---------- YAJSW SET ENV ----------
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
wrapper home : /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-stable-12.15
OS   : Linux/3.10.0-1160.25.1.el7.x86_64/amd64
JVM  : Red Hat, Inc./1.8.0_292//usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre/64
May 31, 2021 11:20:41 AM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/systemd/system/connectplaza-agent.service already exists
May 31, 2021 11:20:41 AM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/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
  • Stop the ConnectAgent with:
    ./stopAgentService.sh​
  • Uninstall the service
# ./uninstallAgentService.sh
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
wrapper home : /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
---------- YAJSW SET ENV ----------
++++++++++ YAJSW SET ENV ++++++++++
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
wrapper home : /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw
configuration: /opt/connectplaza-bundle/connectplaza-agent/connectplaza-wrapper/yajsw/conf/wrapper.conf
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
---------- YAJSW SET ENV ----------
YAJSW: yajsw-stable-12.15
OS   : Linux/3.10.0-1160.25.1.el7.x86_64/amd64
JVM  : Red Hat, Inc./1.8.0_292//usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre/64
May 31, 2021 11:03:47 AM org.rzo.yajsw.os.posix.PosixService init
INFO: /etc/systemd/system/connectplaza-agent.service already exists
************* REMOVING connectplaza-agent ***********************

May 31, 2021 11:03:56 AM org.rzo.yajsw.os.posix.PosixService stop
INFO:
May 31, 2021 11:03:56 AM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/connectplaza-wrapper/wrapper.connectplaza-agent.pid
May 31, 2021 11:03:56 AM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /opt/connectplaza-bundle/connectplaza-agent-4.1.0-SNAPSHOT-58/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/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.

# systemctl start connectplaza-agent-2

Installing the service with init.d on a system with systemd

It is possible to use the old init.d installation for the service on a system with systemd installed. It is not advised, but if you want to do it, you have to change the wrapper.conf configuration file.

Open the file connectplaza-wrapper/yajsw/conf/wrapper.conf and uncomment (remove the #) the following line:

# wrapper.daemon.system = initd