Command Line (CLI) Management Console

The command line interface (CLI) console offers full management capabilities of local and remote simulators (the web console has limited functionality and manages only the local simulator).

Starting CLI console

Windows

  1. Go to the Windows Start menu
  2. Run Nextian SNMP Agent Simulator CLI Console

Linux

Issue the following command in a shell window:

/opt/nextian/snmpsimulator/bin/nextian-snmpsimulator.sh console

Connecting CLI Console to a simulator

The console asks for connection details upon startup:

Do you want to connect to default simulator server? [y/n]

The default connection parameters are 127.0.0.1:43500 for connecting to a local simulator.

Once connected, enter HELP to display all available commands or SHOW to see all simulated devices and their statuses.

CLI Console commands

The console can work in either of two modes:

  • Type mode – for management of device types. A device type is a group of devices using a single SNMP record file. This is the default management mode.
  • Device mode – for management of individual devices (agent instances) under a device type. Use SELECT command to enter the device mode.

A different set of commands is available in each mode. Use the HELP command to see all available commands in the current mode.

Type mode commands
CommandDescription
STARTALLStart simulation for all configured devices of all types.
STOPALLStop simulation for all devices of all types.
SHOWDisplay all configured device types.
SELECT <ID>Select device type identified by ID (use SHOW to retrieve IDs) and enter device mode for this type.
ADD <FILE>Add new device type using FILE as the response file. To start simulation, switch to the device mode (using SELECT) and create a device instance (using ADD).
REMOVE <ID>Remove device type identified by ID. All simulated instances of this type will be removed.
EXITDisconnect and exit the console.
ENDShutdown simulator (will disconnect the console).
Device mode commands
CommandDescription
SHOWDisplay all simulated instances for the current device type.
BACKReturn to type mode.
STARTALLStart simulation of all devices for current type.
STOPALLStop simulation of all devices for current types.
START <ID>Start simulation for a specific device identified by ID (use SHOW to retrieve IDs).
STOP <ID>Stop simulation for a device identified by ID.
REMOVE <ID>Remove a device identified by ID.
ADD <IP RANGE> <NET MASK> <PORT RANGE> <STATE>Add new device(s) without starting them:

  • IP RANGE – a single IP address or a ‘-‘ delimited range of IP addresses
  • NET MASK – network mask in IPv4 representation or mask length
  • PORT RANGE – single port or ‘-‘ delimited port range (port range will be applied for each specified IP address)
  • STATE – optional attribute defining initial device state (valid values are RUN, STOP and DISABLED)

For instance:

ADD 192.168.1.100-192.168.1.104 24 135-136

To start simulation of created device(s), issue START <ID> or STARTALL

EXITDisconnect and exit the console.
ENDShutdown simulator (will disconnect the console).

Running CLI Console in batch mode

ImportantBatch mode is supported only on Linux (use java.exe directly with command line arguments on Windows).

The CLI Console can be run in batch mode, i.e., execute a single command, print results to the standard output and exit. To run the console in the batch mode, invoke it with –c:

  • -c <command> – command to be executed, e.g., SHOW (required).
  • [-t <type>] – optional argument provided if command is to be executed in the ‘type’ mode. If –t is not specified, batch commands are always executed in the device context.
  • [-a <attributes>] – optional arguments passed to the executed command.
  • [-p <port>] – port number on which the target service is running (if not provided, the default port value 43500 is used).
  • [-h <host>] – IP address where the target simulator service is running (if not provided, localhost is used).

For example, to run SHOW command in the batch mode on Linux, issue the following command:

/opt/nextian/snmpsimulator/bin/nextian-snmpsimulator.sh console -c show
Was this page helpful?