ConnectPlaza Agent script files
1. Bin and bat files, how to use them
Within the installation of the ConnectPlaza® Agent you will find a bin directory and a bat directory in your installation directory.
The bat directory is used by Windows users, the bin directory is used by Linux users.
The following files are available to you:
| Windows | Linux |
|---|---|
agent.bat |
agent.sh |
connectcmd.bat |
connectcmd.sh |
cpswitchversion.bat |
cpswitchversion.sh |
installAgentAsAService.bat |
installAgentAsAService.sh |
queryAgentService.bat |
queryAgentService.sh |
runAgent.bat |
runAgent.sh |
startAgentService.bat |
startAgentService.sh |
stopAgentService.bat |
stopAgentService.sh |
uninstallAgentService.bat |
uninstallAgentService.sh |
To run them use a CLI (command line interface).
1.1. agent.sh
Command: ./agent.sh start|stop
Used to start of stop the ConnectPlaza® Agent.
If the ConnectPlaza® Agent is installed as a service, it will use the service command to start or stop the service. Otherwise it will use the ./runAgent.sh command to start the ConnectPlaza® Agent.
1.2. connectcmd.sh
This is the ConnectPlaza® Command Line Interface Tool.
Command used to get data from your ConnectPlaza® Agent.
usage: connectcmd [options] <command> [arg1 arg2 ...]
-b,--brief <arg> Exclude additional information and error messages
-h,--host <arg> Connect to host
-p,--port <arg> Connect to jmx port
-u,--url <arg> Connect to url
available commands:
getagentlogtail <number of bytes> Get the Log tail from all interfaces
getavailableupdatereports Get all available update reports
getbundles Get current installed bundles
getconfigurationfile <configuration file> Get a configuration file from the connected agent
getdatetime <interface name> Get the installation date and time of this interface
geterror Get the last error message of an interface
getflows [interface name] Find all flows of the named interfaces or all flows of all interfaces
getinterfaceflows <interface name> Get the flow count from an interface
getinterfaceloglevel <interface name> Get internal log level of specified interface: FULL,NORMAL,MINIMAL,TRACELOG en TRACELOGMSG
getinterfaces Get the names of all available interfaces
getlicense Get license information from Connect Agent
getlocation <interface name> Get the location of this interface
getloggers [filter] Get all common loggers or loggers which starts with the filter
getloglevel [interface name] <logger> Get log level of specified logger in the Agent or inside an interface: INFO, DEBUG, ERROR, WARN, FATAL
getlogtail <interface name> <number of bytes> Get the log tail from an interface
getproperties <interface name> Get the interface properties
getsize <interface name> Get the size of the bundle in Kilobytes
gettotalflows <includesystemflows> Get the total number of flows on the connected agent
getupdatereport <report> Get the update reports
getupdates Get all available updates
getupdatetillversion Get the latest version this connected Agent will upgrade to
install <bundle> [autostart] Install a new interface bundle and instantiate it if autostart != false
monitor [Bean name properties in form key=value,key=*,*] Monitor Agent notifications, stop with [CTRL+C]
restart Restart a connect agent
setinterfaceloglevel <interface name> <level> Set internal log level for interface: FULL,NORMAL,MINIMAL,TRACELOG en TRACELOGMSG
setloglevel [interface name] <logger> <level> Set log level of specified logger in the Agent or inside an interface: INFO, DEBUG, ERROR, WARN, FATAL
setupdatetillversion <version> Set the latest version this connected Agent will upgrade to
shutdownagent Terminate connected agent
start <interface name> Start an interface context if not yet started and return the state
status <interface name> Get interface state: ONLINE, OFFLINE, STARTING, STOPPING
stop <interface name> Stop an interface context if not yet stopped and return the state
uninstall <bundle> Stop and uninstall an interface bundle (provide full name)
updatelicense <file> Update the Agent license with the license from file
version Get the current Agent version and version history in xml format
1.3. cpswitchversion.sh
Command cpswitchverion.sh <agent-version>
Used to revert to another version of a ConnectPlaza® Agent.
The <agent-version> is the version number of any installed ConnectPlaza® Agents on your server.
Example:
Look in your <connectplaza-install-directory>, you will see something like this:
drwxr-xr-x 3 root root 4096 Mar 16 2023 activemq-data
lrwxrwxrwx 1 root root 45 Nov 8 15:30 agent -> /opt/agent-paoomgeving-432-C7/agent-4.4.0.RC2
drwxr-xr-x 11 root root 4096 Jul 26 09:01 agent-4.3.2
drwxr-xr-x 11 root root 4096 Nov 8 15:30 agent-4.3.3
drwxr-xr-x 11 root root 4096 Jul 27 12:14 agent-4.3.3.RC2
drwxr-xr-x 11 root root 4096 Aug 4 12:14 agent-4.3.3.RC3
drwxr-xr-x 11 root root 4096 Nov 8 15:29 agent-4.4.0.RC1
drwxr-xr-x 11 root root 4096 Nov 9 13:29 agent-4.4.0.RC2
drwxr-xr-x 2 root root 4096 Mar 16 2023 endorsed
drwxr-xr-x 9 root root 4096 Nov 8 15:30 logs
drwxr-xr-x 5 root root 4096 Nov 8 11:07 temp
The latest update is to agent-4.4.0.RC2. If we want to switch to another version, for instance 4.3.3, use the command:
./cpswitchversion.sh 4.3.3
1.4. installAgentAsAService.sh
Command: ./installAgentAsAService.sh
Used to install the ConnectPlaza® Agent as a service on the server.
1.5. queryAgentService.sh
Command: ./queryAgentService.sh
Running this command will return the status of the ConnectPlaza® Agent.
1.6. runAgent.sh
Command: ./runAgent.sh
Used to start the ConnectPlaza® Agent as a single proces. You can stop the ConnectPlaza® Agent with the CTRL+C buttons. The logging will be displayed also in your console. So this is a way to debug startup problems if you have any.
1.7. startAgentService.sh
Command: ./startAgentService.sh
Used to start the ConnectPlaza® Agent service.