Commands
To discover the available commands, type commands for a detailed list, or use tab-completion (press the keyboard TAB key twice) for a brief list of commands and objects.
Commands fall into three main groups:
1.Control API methods
These are of the form Class.method [arguments...], for example:
[email protected] > Pool.getNodes "Web Servers"
[ "92.52.65.222:80", "92.52.65.213:80" ]
2.Helper commands
These summarize the Traffic Manager configuration; the main commands are:
•info: show a brief summary of this Traffic Manager
•catalogs: list all configuration objects in this Traffic Manager
•show: show specific configuration. For example, show Pool
•stats: show Traffic Manager statistics/counters. For example, stats webcache
3.CLI help
•help syntax: explain the syntax for entering commands and data
•help output: explain the output format for commands
•help commands: describe all of the commands
•help classes: describe all of the API classes
•help <class>: show the methods for a particular class. For example, help Pool
•help <cmd>: describe a command. For example, help Pool.addNodes or help show
Control API methods
All of the Control API methods are accessible via the CLI. The corresponding command is constructed from the class name and method name as listed in the Pulse Secure Virtual Traffic Manager: Control API Guide; refer to this document for details about each command.
For example, to list all of the virtual servers:
[email protected] > VirtualServer.getVirtualServerNames
[ Intranet, "Secure Site", webmail ]
Understanding Arguments to CLI Commands
Arguments for commands are given as space separated names; commas between arguments are optional. Argument values that contain a space or other special characters that may confuse the syntax should be "quoted". Lists are contained within square brackets ([ ]).
For example, Pulse Secure Virtual Traffic Manager: Control API Guide details the method “getNodes” in the Pool class as follows:
getNodes( names ) throws ObjectDoesNotExist
Get the lists of nodes for each of the named pools.
String[][] getNodes(
String[] names
)
The corresponding CLI command would be Pool.getNodes. The documentation shows that the command takes an array of pool names (String[] names); the command line to call this method on two pools would be:
[email protected] > Pool.getNodes [ pool1 pool2 ]
{ pool1: [ "serverA:80", "serverB:80" ],
pool2: [ "serverC:80", "serverD:80" ] }
The output from Pool.getNodes is declared as String[][], in other words, an array of arrays. For each pool that was specified, an array of nodes is returned.
For convenience, in its interactive mode, the CLI indexes the output of the command to show the list of nodes prefixed by the pool name that they refer to.
Using a Single Argument
Many commands in the Control API take a list of arguments so that they can operate on more than one object at once. To simplify the use of commands with a single item, the array can be omitted:
[email protected] > Pool.getNodes pool1
[ "serverA:80", "serverB:80" ]
Using Wildcards
The * symbol is a wildcard that can be used to match multiple objects:
[email protected] > VirtualServer.getDefaultPool *
{ Intranet: pool1,
"Secure Site": "Secure pool",
webmail: "Mail servers" }
Partial names can also be wildcarded. For example, to enable keep-alives on all the pools with a name beginning "Pool":
[email protected] > Pool.setKeepalive Pool* 1
Complex Argument Types
Some commands require more complicated argument structures. For instance, VirtualServer.addVirtualServer is defined in Pulse Secure Virtual Traffic Manager: Control API Guide as:
void addVirtualServer(
String[] names,
VirtualServer.BasicInfo[] info )
The BasicInfo structure is defined as:
struct VirtualServer.BasicInfo {
# The port to listen for incoming connections on.
Integer port;
# The protocol that this virtual server handles.
VirtualServer.Protocol protocol;
# The default pool that traffic to this virtual server
# will go to.
String default_pool;
}
Structures are supplied to the CLI by using “{“ and “}” curly brackets, identifying each member with key:value pairs. For example,
[email protected] > VirtualServer.addVirtualServer Intranet { port: 80, protocol: http, default_pool: pool1 }
To obtain help with the expected arguments for any command, use the help available through the CLI:
[email protected] > help VirtualServer.addVirtualServer
Custom Configuration Sets
You can store and retrieve arbitrary name:value configuration pairs in the Traffic Manager configuration system using the CLI. This configuration is replicated across your cluster, and is only accessible through the REST API, SOAP API, and CLI.
You can find a full list of commands associated with storing and retrieving custom configuration by typing help Custom at the prompt.
To store a custom configuration, use the Custom.setStringsLists command. The following example sets a name:value pair under the list named "counters":
Custom.setStringLists [counters], [ {"name": "Test_Counter", "value" : ["12345”, "67890"]} ]
You can add multiple name:value config pairs to the list by appending additional {"name":<name>, "value":<value>} items as desired.
To retrieve the "counters" configuration, use the following command:
Custom.getStringLists counters
Using this system, you can organize your custom configuration into logical groups, initially by creating a new list, and within this, by each name:value pair. Each value can itself be a single item or a list of items.
Built-in Commands
The CLI includes a number of additional commands that simplify viewing and modifying configuration. Full help and usage instructions can be found using help <commandname>.
•info: Shows high-level information about this Traffic Manager, similar to the Home Page of the Admin UI. This shows the Traffic Managers in a cluster, the virtual servers and pools configured, traffic IP addresses, any configuration or operational errors, and the most recent entries in the event logs.
•connect: Connect to a different Traffic Manager. The CLI can be used to communicate with remote Traffic Managers, including Traffic Managers that are not in the same cluster as the local machine. This command is also useful when writing scripts, as the Traffic Manager hostname, username, and password can all be contained in the script file.
•errorlog: Shows the most recent messages in the Traffic Manager event logs.
•catalogs: Lists the contents of the configuration catalogs, showing items such as Monitors, TrafficScript rules and Java Extensions.
•show: Show the configuration of any configuration object in the Traffic Manager. For example:
•show VirtualServer Intranet: Shows a summary of the virtual server 'Intranet'
•show Pool: Shows a summary of all pools
•show VirtualServer customer*: Shows a summary of the virtual servers customer*
You can also just use show with an object name, and it will summarize all objects that match that, for example:
•show Staging: Shows a summary of any object called “Staging”
•show *: Shows everything (may take some time)
The show command can also be used to provide details about all current connections being handled by the Traffic Manager (by using the command show connections). The output is based on the connection info displayed on the Activity > Connections page of the Admin UI, with the following data items listed where a connection is in progress:
Data Item |
Description |
From |
Client IP address and port for connection |
Via |
Local IP address and port the client connected to |
To |
Back-end node used for the connection |
State |
The current connection state; can be one of: C: Connection to client was closed f: Connection finished R: Reading from client W: Writing to client X: Executing rules against client request c: Connecting to a back-end node w: Writing to a back-end node r: Reading from a back-end node C: Closing connection with client K: Holding client connection in keep-alive state. |
VS |
The virtual server handling this connection |
Rule |
The last rule run on the connection |
Pool |
The pool that is used |
BytesIn |
Bytes received from the client |
BytesOut |
Bytes sent to the client |
Timings |
In the format <num1> / <num2> / <num3> where: <num1>: Time since the client established this connection <num2>: Time since last data sent on that client connection <num3>: Time since last data sent on the separate back-end connection |
Retries |
The number of times the server had to retry to connect to a back-end node |
SLM |
The Service Level Monitoring class being used |
VSBW |
The bandwidth class the virtual server used |
PoolBW |
The bandwidth class the pool used |
Code |
The response code that was returned by the back-end node, varies depending on protocol |
Request |
Summary of the request made. For HTTP this is the URL requested |
Additional fields may also be shown where extra information is identified as applicable to the connection.
The full list of possible object types that can be specified as an argument to show is:
action, authenticator, bandwidth, ca, certificate, clientcertificate, connections, event, global, info, java, licensekey, monitor, persistence, pool, protection, rate, rule, slm, trafficip, virtualserver
•stats: Shows counters and statistics for various different objects in the Traffic Manager. For example:
•stats VirtualServer Web - Shows stats for the virtual server “Web”
•stats Pool - Shows stats for all pools
•stats * - Shows stats for everything
You can also just use stats with an object name, and it will display stats for all objects that match that name, for example:
•stats Staging - Shows stats for any object called “Staging”
•stats * - Shows stats for everything (may take some time)
The full list possible stats objects is:
authenticator, bandwidth, event, interface, node, perpoolnode, pool, protection, rate, rule, session, slm, slmpernode, ssl, system, trafficip, virtualserver, webcache, zxtm
•help: Show help topics. For example:
•help overview - Brief overview of the command line interface
•help syntax - Explain the syntax for entering commands and data
•help output - Explain the output format for commands
•help commands - Describe all of the commands
•help classes - Describe all of the API classes
•help <class> - Show the methods for a particular class. For example, help Pool
•help <cmd> - Describe a command. For example, help Pool.addNodes or help show
•rule: Upload, download, and syntax check TrafficScript rules on the Traffic Manager.
•getbackup: Download a backup from the Traffic Manager.
•putbackup: Upload a backup file to the Traffic Manager.
•download: Download a specific configuration file from the Traffic Manager, for offline editing or archiving.
•upload: Upload a specific configuration file to the Traffic Manager.
•edit: Download and edit a specific configuration file from the Traffic Manager, and then upload the modified version.
•watch: Repeatedly run a command and watch the output. This is useful for monitoring changes, e.g. keeping an eye on logs or recording stats. For example:
[email protected] > watch 10 stats webcache
This will show all of the Web cache statistics, updated every ten seconds.