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
.inifile, 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
.txtfile, 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.inifile located in the\Program Files (x86)\CatTools3\Templatessub folder of the CatTools root directory. - Save the copy to the
\Program Files (x86)\CatTools3\Devicessub 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
.inifile created in step 1. - Change the following default values in the
.inifile:[device]name=Custom.[Manufacturer].[Type]id=4000- Change
nameto a unique device name. For example:Custom.Cisco.RouterDo not use spaces. Use a period (.) instead.
- Change
idto a unique number that is not being used by any other device.inifile.The number must be within the range of
4000to4999.
[item_Name]default= Unique device name - Change
3. Save and restart CatTools
- After completing changes to the
.inifile, save it to the\Devicessub 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.txtfile located in the\Templatessub folder of the CatTools root directory. - Save the copy of the file to the
\Program Files (x86)\CatTools3\Scriptssub folder. Save the file using the value entered for[device] namein Step 2.Ensure you retain the
.txtfile type suffix.For example, if in the device
.inifile settings,[device] name=Custom.Cisco.FirewallPIX, the script.txtfile name must therefore be:Custom.Cisco.FirewallPIX.txt.
5. Edit the .txt file
- Using a text file editor, open the
.txtfile create in step 4. - Follow the instructions under the SCRIPT NOTES section of the
.txttemplate to customize the script for your device.Although you can open
.txtfiles 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
.txtfile, save the file to the\Scriptssub 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.Loginis 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
.txtfile as necessary.
See Testing your custom device for more information and tips.