Custom devices in Kiwi CatTools
CatTools provides the ability to create custom device types and script files, should your device not be supported by one of the predefined device types.
An understanding of and experience in Visual Basic scripting is required in order to successfully add custom scripts to CatTools. The sample code template files found the /Templates
sub folder of the CatTools root directory provides help file documentation and comments for adding custom devices.
To add support for a custom device in CatTools, two fields are required:
- The device type
.ini
file, which defines:- The device type name
- The device ID
- The user interface field values and default values which are displayed in the device form when adding or editing a device
- The device script
.txt
file, which contains:- The device type's specific code to allows CatTools to log in to the device
- Enter and exit different modes,
- Activities to be performed - such as configuration backups, sending CLI commands, modifying device configurations
- Parse command output data for reports
The device script file also contains function calls and references to variables within the internal CatTools program code. These are prefixed with cl
.
For a list of cl.
functions and variables, see cl. variables and functions. These functions and variables can be used to develop your custom device script.
Create a custom device
The custom device template files provides by CatTools and referenced below are based on a Cisco Router device. Additional modifications to the device script .txt
file are required once you have created it to customize the script to work successfully with your specific device.
For further information regarding customizing devices see:
- Custom device type files (
.ini
) - Custom device script files (
.txt
) - Code examples of internal CatTools functions
1. Create a custom device type .ini file
- Copy the
Custom.Device.Template.ini
file located in the\Program Files (x86)\CatTools3\Templates
sub folder of the CatTools root directory. - Save the copy to the
\Program Files (x86)\CatTools3\Devices
sub folder - Enter a new file name using the syntax
Custom.[Manufacturer].[DeviceType]
.
For example,Custom.Cisco.FirewallPIX
.
2. Edit the .ini file
- Using a text file editor, such as Notepad, open the
.ini
file created in step 1. - Change the following default values in the
.ini
file:[device]
name=Custom.[Manufacturer].[Type]
id=4000
- Change
name
to a unique device name. For example:Custom.Cisco.Router
Do not use spaces. Use a period (.) instead.
- Change
id
to a unique number that is not being used by any other device.ini
file.The number must be within the range of
4000
to4999
.
[item_Name]
default= Unique device name
- Change
3. Save and restart CatTools
- After completing changes to the
.ini
file, save it to the\Devices
sub folder and close. - Restart CatTools to populate the Device type drop-down field. Your custom device type is now available in the device setup screen.
4. Create a custom device .txt script file
- Make a copy of the
Custom.Device.Template.txt
file located in the\Templates
sub folder of the CatTools root directory. - Save the copy of the file to the
\Program Files (x86)\CatTools3\Scripts
sub folder. Save the file using the value entered for[device] name
in Step 2.Ensure you retain the
.txt
file type suffix.For example, if in the device
.ini
file settings,[device] name=Custom.Cisco.FirewallPIX
, the script.txt
file name must therefore be:Custom.Cisco.FirewallPIX.txt
.
5. Edit the .txt file
- Using a text file editor, open the
.txt
file create in step 4. - Follow the instructions under the SCRIPT NOTES section of the
.txt
template to customize the script for your device.Although you can open
.txt
files using NotePad, a syntax highlighting script editor can make reading and editing the file easier.
6. Save and text
- After you have made your edits to the
.txt
file, save the file to the\Scripts
sub folder and close. - To test your custom device, create an activity in CatTools that is supported by your custom device script. Run it manually using the Run Now button.
UsingDevice.ConnectivityTest.Login
is recommended for testing since every device must be able to log in successfully to perform other activities. - Check the Info Log pane for errors and edit your
.txt
file as necessary.
See Testing your custom device for more information and tips.