8.2.3Telnet server system commands

cmsWorks comes with a handful of system commands that can be useful while administering the server, this page lists the most useful of them with a brief description.

Command

Description

.

The dot (".") command shows a list of already entered command lines of one telnet session, it repeats the last / a specific / a specific interval of command(s).

The "." command, when entered into the telnet server console, repeats one or more commands stored in the telnet session history list. Every time a command (valid or invalid) is entered, this command is stored in a list called "history". The command "." can repeat the last command entered or a list of previously entered commands.

The repeater must not be executed in batch files, because the client environment (history list) is missing within batches, an appropriate error message will be returned in this case.

batch

Lists, (re)loads or executes batch files. Batch files are files with command lines stored on the server, they help to repeat commands.

Batches are user-defined command lists, which can be executed using the telnet-server of cmsWorks. They are written using a simple editor and stored in the batch-path of the server's file system with the file extension ".batch".

There are several points to take care of while using batches:

  • The batch-path can be set and reviewed using the "batch" command i.e. to switch to a set of testing batches. Be aware that this could influence the server though other batches, eventually having the same name, will be loaded (automatically).
  • Batches should be (re)loaded before they can be executed. This is done by issuing the command "batch load xyz", which will load the batch "xyz.batch" from the batch-path. To execute a batch, call "batch exec xyz" afterwards.
  • A loaded batch will normally stay in memory until it is reloaded or removed with this command, even if the batch-file will change meanwhile unless the autoloading option for batches is set to "on".

At server startup, the batch "startup.batch" is loaded and executed automatically. The administrator may add additional commands in there, i.e. to automatically start services, execute other batches etc. . Having a cmsWorks enterprise license enables you to even hook self-written telnet commands, jobs and services into the cmsWorks server.

cmscaches

This command show details about the caches the CMS is using and provides some changing of these caches while in runtime.

echo

This command prints a message onto the console or re-prints each command after it was entered, when activated. Echo is turned off by default.

The command mainly is useful on telnet clients that do not support automated echoing or to review the entered commands or simply to print informational messages from batches.

Without any parameter the command returns the current echo-state.

email

Command to administer emails, to send emails or to list emails stored in the server (if they were not sent before).

The command "email" is used to use the cmsWorks server to send emails to the addresses defined in the topas.properties file or the log ("state "OM_INFORM_EXTERN"). With this command, emails may be send manually or switched off for maintenance, so that people are not notified of changes done in that time.

exception

This command prints all (or a specified interval of) exceptions logged in the cmsWorks-server. Exceptions are logged by using the cmsWorks logging while programming cmsWorks.

The command shows one or a list of (all) exceptions occurred since exception logging was enabled. Additionally it can print these exceptions containing a complete stack trace. In cmsWorks-logging, the exception-numbers are printed in brackets so they can easily be printed using the "exception print <number>" command.

It is possible to save (export) the exception log into a file called "exception.log". In case the cmsWorks server is shut down normally, the stored exceptions are written into the file "exceptions.log" in the <cmsworks-install> directory.

It is recommended to clear the exception log from time to time because the exceptions in the exception lists do consume memory.

In some cases, it may even be advisable to disable the logging of exceptions i.e. to safe memory in application servers which are well tested, therefore the option "exception off" was implemented.

gc

Manually triggers a vm-wide garbage collection. The use of this command is not recommended on production-level servers though it interfereces with JVM internal optimizations.

help

Lists all commands or prints help messages of certain commands.

As a start enter "help" to get a list of available commands or even "help help" to get the help of the "help" command while connected to a cmsWorks telnet server.

host

Returns the host name or the IP of the server cmsWorks is running on.

license

Prints the actual cmsWorks license.

log

The log command is a very powerful command while programming or administering a system because it gives complete control over the log services of a cmsWorks-server at runtime (in the telnet console), sending mails and file logging included.

New (so-called) "loggers" can be added at runtime, the level of existing loggers can be changed or removed. The logging-target of newly added loggers can be the current (telnet) console, System.out (i.e. standard output), a user-defined file.

The following log levels may be set in cmsWorks logging:

  • DEBUG
  • TRACE
  • INFO
  • WARN
  • ERROR
  • FATAL
  • INFORM_EXTERN
  • ALL

Each log level can be used in any combination with the others. The INFORM_EXTERN log level sends the log message as email. Another special log level is ALL which is the combination of all log levels.

To see all configured loggers simply enter "log status" into the telnet console. To remove a logger simply enter "log remove <loggerid>" where <loggerid> is the id you get from the list of the "log status" command.

To bind the logging to your running telnet console, the command "log link all" (or "log link debug", "log link debug info" etc.) may be used. The logging will then be printed into your telnet console session. To stop logging into the telnet console simply type the command "log unlink".

To start logging into a file you can use the command "log add file <filename> <loglevel>". As example, logging all "info" and "error" messages into one file requires the command "log add file info-and-error.testlog info error". The position of the file in the file system is printed by using the command "log status".

memory

The memory command prints the amount of free and total memory of the virtual machine of the cmsWorks-server. It has no parameters.

service

The command "service" gives full control over all registered microservices of the cmsWorks server instance (via "service status").

Services can be listed, their status can be retrieved, they can be started, stopped, and their parameters can be listed. The command stops ("service stop <servicename>") or starts ("service start <servicename>") services.

shutdown

This command shuts down the cmsWorks-server immediately. Thus, all services will be terminated and the virtual machine is terminated.

If the normal shutdown command fails due to a service-stop-error, you can shut down the server via the command "shutdown abort".

time

Prints the current time and date of the server.

uptime

The uptime command prints the hostname, time and date the cmsWorks-server was started, alternatively (via "uptime count") the running time in days, hours, minutes and seconds since the last start.

version

Prints the version of the underlying application server and the server property name.

wait

Waits for the given value in milliseconds (i.e. "wait 1500" will wait 1.5 seconds) before the next command will be executed, useful i.e. for batches.

The parameters of every command and how they work can be retrieved with the help command (i.e. type "help email" to get a full parameter list with descriptions from the email-command)