|
Variables |
Top Previous Next |
|
Below are a list of the built in variables available to the Client scripts.
Use the "cl" prefix to access a variable or function from the client.
For example: If cl.QuitNow = 1 then exit sub
Variables:
QuitNow As Long
If set to a value other than 0, indicates that the script must stop processing and exit immediately.
When the STOP button is pressed on the Activities page, the value of QuitNow will be set to 1 for each running thread.
Ensure that this variable is checked within any long duration loops so that the client will respond to the stop events in a timely manner.
DeviceName As String
Name of the current device that has been passed from the main script via the marshal threads function.
Use this value to perform further database lookups based on this device name.
ScheduleNumber as integer
Contains the current schedule number. Each activity is assigned a unique identifying number. This number is used as the unique key for database lookups of activity information.
ScriptFileClient As String
File name of the current script file that is currently being run
UniqueFileID As String
Unique file ID prefix for this script (set from the Main script). Use this unique value when writing results files that are to be read by the main script. This avoids other threads from overwriting the same results file.
ProcessID As Long
The ID number of this thread (1 to MaxThreads). This value is not unique since the thread can be reused for running a different script and connecting to a different device. This variable can be used when signalling the main script as a way of identifying the number of this thread.
AppPath As String
The folder in which the main application (CatTools) is installed. This folder is always terminated with a "\" character. Use this variable as the root path when saving data to results files. (The ClientTemp folder for example is located under the root path.)
DeviceHostnameID
Hostname as recovered from the device after login. For example: sales1600. When a connection to a device is made, the hostname is extracted from the prompt. A prompt of "sales1600>" gets extracted and converted to "sales1600".
DeviceVTYPrompt
This value holds the prompt that is expected to be returned after an action is taken in vty mode. For example, after a show interface command has completed, the DeviceVTYPrompt can be expected. Example: sales1600>
DeviceEnablePrompt
This value holds the prompt that is expected to be returned after an action is taken in enable mode. For example, after a show interface command has completed, the DeviceEnablePrompt can be expected. Example: sales1600#
RecDataTimeOut as long
Holds the number of seconds to wait for a response from the device. For example, time to wait for login prompt to be received after sending a command.
RxBuffer As String
Holds the data returned from the active connection. For example: SendData Blah, then WaitForMultData. After a return value has been matched or the timeout has occurred, the received data will be held in RxBuffer.
StripVT100ESC as Long
If set to non zero, vt100 type escape sequences are removed from the buffer stream at the point of reception.
This is useful for devices with menu based telnet interfaces. This variable can be toggled at any time to enable or disable the removal of the escape sequences. For example, set this variable = 1, then call the WaitForMultData function.
DebugMode as long
If set to 1, the send and receive data from the active connection is written to a debug text file. The filename is made up from the formula: AppPath + "Capture" + UniqueFileID + ".txt". This variable is set to 0 for normal operation.
Device values.
After calling the function DBDevicesGetAllFields(DeviceName), the following fields are loaded with the information from the database.
CurDevType As String
Device type. For example: Cisco.Router.General or Cisco.Firewall.PIX.
To ensure a good match, always test for lowercase values. If Lcase(CurDevType) = "cisco.router.general" then...
CurDevGroup As String
Group to which the device belongs. This is a free form field and can be any value that the user specifies.
CurDevName As String
Device name. This is a free form field and can be any value that the user specifies. The device name must be unique.
CurDevHostAddress As String
IP address or hostname of the device.
CurDevFilename As String
A base filename for use when saving information to file for this device. The filename is made from the device name. All illegal filename characters are replaced with an underscore.
CurDevModel As String
Device model. For example: 1601 or 3300. This is a free form field and can be any value that the user specifies.
CurDevConnectVia As String
The name of the device to connect to first before attempting a telnet or SSH session. For example, connect to device A , then attempt a telnet connection to the current device.
CurDevTelnet As String
Method used for connection. Dependant on the particular device. Example: Telnet, SSH1, COMM.
CurDevTelnetPort As String
Port to use for connection attempt. Example: 23 for telnet, 22 for SSH, 1 for COMM1.
CurDevSession As String
Session number to use once connected to device. Example: Telnet to device, then issue session 15 command to connect to LANE card.
CurDevVTYPass As String
VTY password for the device.
CurDevConsolePass As String
Console password for the device. The console password is only required when the connection is via the console (COMM port connection).
CurDevEnablePass As String
Enable password for the device. This is usually the enable-secret password on Cisco devices.
CurDevPrivilegeLevel As String
The privilege level to use when entering enable mode. Example: Enable 7.
CurDevAAAUsername As String
Username to use when device is set to use AAA (TACACS/RADIUS/Username)
CurDevAAAPassword As String
Password to use when device is set to use AAA (TACACS/RADIUS/Username)
CurDevVTYPrompt As String
The VTY prompt to expect from the device. Normally set to "" if the default prompt is expected. Example: Login:
CurDevConsolePrompt As String
The Console prompt to expect from the device. Normally set to "" if the default prompt is expected. Example: Login:
CurDevEnablePrompt As String
The Enable mode prompt to expect from the device. Normally set to "" if the default prompt is expected. Example: Password:
CurDevAAAUserPrompt As String
The Username prompt to expect from the device. Normally set to "" if the default prompt is expected. Example: Username:
CurDevAAAPassPrompt As String
The Password prompt to expect from the device. Normally set to "" if the default prompt is expected. Example: Password:
CurDevRequireVTYLogin As String
Check box value. 0 = no VTY password expected, 1 = VTY password expected.
CurDevLoginUsesAAA As String
Check box value. 0 = no Username/Password expected, 1 = Uses AAA. Username/Password required.
CurDevEnableUsesAAA As String
Check box value. 0 = no Username/Password expected for enable mode, 1 = Uses AAA for enable. Username/Password required when entering enable mode.
CurDevAddress1 As String
Free form address information
CurDevAddress2 As String
Free form address information
CurDevAddress3 As String
Free form address information
CurDevContactName As String
Name of contact for device
CurDevContactPhone As String
Contact phone number for device contact
CurDevContactEmail As String
Contact e-mail address for device contact
CurDevContactOther As String
Other contact info for device contact
CurDevAlertEmail As String
E-mail to send alert info to for this device. If left blank, the e-mail address defined in the properties will be used.
CurDevSerialNumber As String
Device serial number. Free form field.
CurDevAssetTag As String
Device asset tag information. Free form field.
CurDevIdentification As String
Other device identification. Free form field.
CurDevSerialOther As String
Other device identification. Free form field.
CurDevActivitySpecific1 As String
Activity specific information for this device.
CurDevActivitySpecific2 As String
Activity specific information for this device.
Temp01 to Temp10 as Variant
General purpose global variables for use by the client scripts. Can be used to allow transfer of data from one script to another. These values are not initialised on startup and may contain data from previous script instances. |