Documentation forKiwi CatTools

Device Variations

What are variations?

There are a number of device specific script variables that CatTools uses during the execution of device scripts. If the characteristics of your device do not match these device specific variables then the script does 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 is available if the device supports variations. You can access the variations GUI via the Variations tab.

Overview of how to use variations

To use variations on a specific device a variations file for that device must be placed in the \Program Files (x86)\CatTools3\Variations sub folder 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.

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 takes precedence over a group variations file.

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, name the variations file the same as the device script type, for example, Generic.Device.txt. Place the file in a folder with the same name as the group the devices belong to. This folder should be place in the Variations\Groups folder.

For example, to apply a variations file to all devices of the 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 overridden. The value within " " is the value that you should change to your device specific value.

Login Prompts

These are the prompts that the device displays when it asks for a user name or a 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 only the first symbol that appears to the right of the hostname in config mode is selected. This would match the extended config modes. In this example, 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.

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 or invalid lines of config.

  • DEVICE_MORETEXT = "--More--"

Invalid / Incomplete command

These are the messages output by the device when an invalid / incomplete command is entered.

You do not have to include all of the error text but enough so that it can be uniquely recognized 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). You should not include all of the text, but just enough of the text so that it can be uniquely recognized 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.

  • MORETEXT_KEYSTROKE=" "

Device Commands

These are commands that are issued to the device during execution of certain parts of the script. The commands to enter the leave enable / privileged exec (enable) mode.

  • COMMAND_ENTERENABLEMODE = "enable"
  • COMMAND_EXITENABLEMODE = "disable"

The commands to enter or 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: SolarWinds recommends avoiding the use of abbreviated commands such as "sh run" as some of the scripts look for parts of the command, including 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 are 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. Unlike the variations above you can have multiple Backup Ignore Text items in your variations file. You cannot use '|' to delimit multiple items in a single line. Each ignored item must 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 there is a case in which you needed to press the space bar twice prior to logging in, you must 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 prompt with a message. If this is the case, the pre-login message should be set. This ensures the keystrokes are not sent until the message prompt is displayed.

  • 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. For example, if you needed to press the space bar twice after log in, 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 prompt with a message. If this is the case, the post-login message should be set to ensure the keystrokes are not sent until the message is displayed. This should 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 normally determines the device host name and the specified prompts determine the full VTY, enable and config prompt. 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 override CatTools does not try to determine the host name for the device. 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 waits for a specified period of time, normally 30 seconds, and if no data is returned, timeouts. For certain commands which are known to produce more output, such as show commands, this default timeout is increased using a multiplier, normally by 4. If you have a device which is particularly slow, you can increase the default timeout from 30 seconds.

  • RESPONSE_TIMEOUT= "30"

Strip Characters

Some devices include spurious escape or ANSI or 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"
  • RESPONSE_STRIP_ANSICHARS="1"
  • RESPONSE_STRIP_NULLS="1"