Cli scripts – Amer Networks E5Web GUI User Manual
Page 50

The CLI provides a command called sessionmanager for managing management sessions
themselves. The command can be used to manage all types of management sessions, including:
•
Secure Shell (SSH) CLI sessions.
•
Any CLI session through the serial console interface.
•
Secure Copy (SCP) sessions.
•
Web Interface sessions connected by HTTP or HTTPS.
•
Sessions based on the Clavister proprietary NetCon protocol.
The command without any options gives a summary of currently open sessions:
Device:/> sessionmanager
Session Manager status
----------------------
Active connections
:
3
Maximum allowed connections :
64
Local idle session timeout
:
900
NetCon idle session timeout :
600
To see a list of all sessions use the -list option. Below, is some typical output showing the local
console session:
Device:/> sessionmanager -list
User
Database
IP
Type
Mode
Access
-------- ---------------- ---------
------- -------
--------
local
0.0.0.0
local
console
admin
If the user has full administrator privileges, they can forcibly terminate another management
session using the -disconnect option of the sessionmanager command.
The sessionmanager command options are fully documented in the CLI Reference Guide.
2.1.5. CLI Scripts
To allow the administrator to easily store and execute sets of CLI commands, cOS Core provides a
feature called CLI scripting. A CLI script is a predefined sequence of CLI commands which can be
executed after they are saved to a file and the file is then uploaded to the Clavister Security
Gateway.
The steps for creating a CLI script are as follows:
1.
Create a text file with a text editor containing a sequential list of CLI commands, one per
line.
The Clavister recommended convention is for these files to use the file extension .sgs
(Security Gateway Script). The filename, including the extension, should not be more than 16
characters.
2.
Upload the file to the Clavister Security Gateway using Secure Copy (SCP). Script files must
be stored in a directory under the root called /scripts. SCP uploading is discussed in detail in
Section 2.1.6, “Secure Copy”.
3.
Use the CLI command script -execute to run the script file.
Chapter 2: Management and Maintenance
50