|Top Previous Next|
What are variations?
There are a number of device specific script variables that CatTools uses during the execution of device scripts. If the charactersitics of your device do not match these device specific variables then the script will not work correctly. The variations system provides a way to override these device specific variables on a device by device basis.
Which devices support variations?
The Generic.Device script is a basic script designed to be a starting point for the use of variations. However, some of the other scripts also support the use of variations. In the device information panel a variations tab will be available if the device supports variations. You can access the variations GUI via the Variations tab (shown below).
Overview of how to use variations
To use variations on a specific device a variations file for that device must be placed in the \Variations subfolder of the CatTools install directory. The variations file must be named the same as the 'Device File Name' in the CatTools Device Information|Device info pane. The file must have a .txt extension.
So for example if your device was 'Generic Device 1' with a File Name of 'Generic_Device_1' your variations file would be called 'Generic_Device_1.txt'
You can manually create this file using notepad or you can use the variations GUI.
An individual variations file will take precedence over a group variations file (see below).
Applying variations to a group of devices
It is possible to apply a single variations file to all devices of the same script type that belong to the same group. To do this you should name the variations file the same as the device script type . eg. Generic.Device.txt. It should be placed in a folder with the same name as the group the devices belong to. This folder should be in the Variations\Groups folder. So for example to apply a variations file to all devices of Juniper.Router device type that belong to a group called HeadOffice your directory structure would be; ...CatTools\Variations\Groups\HeadOffice\Juniper.Router.txt
You can manually create this file using notepad or you can use the variations GUI.
Variations File Contents
The variations file should include only the items you need to override.
Outlined below are the items that can be overidden. The value within the "" is the value that you should change to your device specific value.
Login Prompts:- These are the prompts that the device will display when it asks for username or password.
DEVICE_USERNAMEPROMPT = "Username:"
DEVICE_PASSWORDPROMPT = "Password:"
Mode Prompts:- These are the characters which appear at the end of the hostname in the various modes the device has. So for example, if at your VTY prompt 'Cisco2950>' was displayed the prompt would be ">".
DEVICE_STANDARDPROMPT = ">"
DEVICE_PRIVILEGEDPROMPT = "#"
DEVICE_CONFIGPROMPT = "("
Note that in this case, for the config prompt we have selected only the first symbol that appears to the right of the hostname in config mode. So this would match the 'extended' config modes also. eg. It would match Cisco2950(config) and Cisco2950(Config-if) because 'Cisco2950(' appears in both of these prompts.
More Text (Paging prompts):- This is the text that is displayed at the end of a page when device paging is turned on. Note: you must include all of the 'more' paging prompt text. The Device.Backup.Running Config activity strips the more text from the saved config. If you have not set the full 'more' paging prompt text, then the saved config may contain additional undesirable/invalid lines of config.
DEVICE_MORETEXT = "--More--"
Invalid / Incomplete command :- These are the messages output by the device when an invalid or incomplete command are entered. Note: you do not have to include all of the 'error' text but enough so that it can be uniquely recognised and distinguished from other device output.
DEVICE_INVALIDCOMMAND = "% Invalid input detected at"
DEVICE_INCOMPLETECOMMAND = "% Incomplete command"
Yes/No Text:- This is the text that appears when the device asks you a question which requires a yes or no answer. For example: "Reload Config (y/n)". Note that you should not include all of the text but just enough so that it can be uniquely recognised and distinguished from other device output.
DEVICE_YESNOTEXT = "(y/n)"
More Text Keystroke:- This is the key that is pressed to continue from a paging prompt.
Device Commands:- These are commands that are issued to the device during execution of certain parts of the script.
The commands to enter ane leave enable / priviledged exec (enable) mode.
COMMAND_ENTERENABLEMODE = "enable"
COMMAND_EXITENABLEMODE = "disable"
The commands to enter / leave config mode.
COMMAND_ENTERCONFIG = "configure terminal"
COMMAND_EXITCONFIG = "CTRL-Z"
The commands to disable / enable paging.
COMMAND_DISABLEPAGING = "terminal len 0"
COMMAND_ENABLEPAGING = "terminal len 24"
The commands to show the running config and the start up config. Note it is best not to use abbrevaited commands such as "sh run" as some of the scripts look for parts of the command, such as 'show' and use this to determine whether to increase the timeout for that command.
COMMAND_RUNNINGCONFIG = "show running-config"
COMMAND_STARTUPCONFIG = "show startup-config"
The commands to save changes, disconnect from the device and ping another device.
COMMAND_SAVENVRAM = "write mem"
COMMAND_DISCONNECT = "exit"
COMMAND_PING = "ping"
Backup Ignore Text:- The Device.Backup.Running Config activity defines certain items that will be ignored as changes when the current and previous configs are compared. This variation allows you to add additional device specific items to the ignore text. Note that unlike the variations above you can have multiple 'Backup Ignore Text' items in your variations file. You cannot '|' delimit multiple items in a single line. Each ignored item should be on a new line. See Ignore Text for more information.
BACKUP_IGNORETEXT = "^! Last configuration change at"
BACKUP_IGNORETEXT = "<Time"
Pre-Login Keystroke:- Some devices require keystrokes to be sent prior to login to 'wake up' the device. You can specify more than one 'Pre Login Keystoke' item so if, for example, you needed to press space twice prior to login you would include two 'Pre login keystokes' lines, each sending a single space.
PRE_LOGIN_KEYSTROKE = "CTRL-Y"
PRE_LOGIN_KEYSTROKE = "CTRL-Z"
PRE_LOGIN_KEYSTROKE = "CR"
PRE_LOGIN_KEYSTROKE = " "
PRE_LOGIN_KEYSTROKE = "Y"
Pre-Login Message:- Some devices that require pre-login Keystrokes will prompt with a message. If this is the case then the pre-login message should be set as this will ensure the keystrokes are not sent until the message appears.
PRE_LOGIN_MESSAGE = "Press CTRL-Y to continue"
Post-Login Keystroke:- Some devices require keystrokes to be sent after to login. For example at a menu to get to the CLI prompt. You can specify more than one 'Post Login Keystoke' item so if, for example, you needed to press space twice after login you would include two 'Post login keystokes' lines, each sending a single space.
POST_LOGIN_KEYSTROKE = "CTRL-Y"
POST_LOGIN_KEYSTROKE = "CTRL-Z"
POST_LOGIN_KEYSTROKE = "CR"
POST_LOGIN_KEYSTROKE = " "
POST_LOGIN_KEYSTROKE = "Y"
Post-Login Message:- Some devices that require post-login Keystrokes will prompt with a message. If this is the case then the post-login message should be set as this will ensure the keystrokes are not sent until the message appears. For example this mught be part of the text that appears in a menu prior to keys strokes being sent to enter the CLI.
POST_LOGIN_MESSAGE = "Press C to enter the CLI"
Full Prompt Values:- CatTools will normally determine the device hostname and from this and the specified prompts determine the full VTY, enable and config prompt. However should CatTools not be able to do this for your device you can specify the full values. If any of the below four values are used as an overide CatTools will not try to determine the hostname for the device. Therefore generally speaking if you intend to use any of the below you should specify values for all four items.
FULL_HOSTNAMEID = "Cisco2950"
FULL_VTYPROMPT = "Cisco2950>"
FULL_ENABLEPROMPT = "Cisco2950#"
FULL_CONFIGPROMPT = "Cisco2950("
Data Timeout:- When CatTools waits for a response from a device it will wait for a specified period of time (normally 30 seconds) and if no data is returned will timeout. For certain commands which are known to produce more output, such as 'show' commands, this default timeout will be increased using a multiplier (normally *4). If you have a device which is particularly slow you can increase the default timeout from 30 seconds.
Strip Characters:- Some devices include spurious escape \ ANSI \Null characters in their output. Functionality to remove these from the buffer as the data is captured can be turned on if required.
RESPONSE_STRIP_VT100ESC = "1"