How to create a custom device
Quick reference guide to creating a custom device in CatTools
This is a simple step-by-step guide on creating a new custom device in CatTools. It contains brief instructions on how to add a custom device type to the CatTools GUI, and how to create a custom device script file.
The custom device templates files provided by CatTools and referenced in this guide, are based on a Cisco Router device. It is likely that further modification will be required to the device script (.txt) file once you have created it, in order to get the script to work successfully with your specific device.
Further information regarding the custom device type file (.ini), custom device script file (.txt), and code examples of how to use the CatTools internal functions in your device script, can be found in the other sub pages of this chapter.
Steps to create a custom device:
1. Create a custom device type file (.ini)
Take a COPY of the Custom.Device.Template.ini in the \Templates sub folder of the CatTools root directory and save to the \Devices sub folder, giving it a new file name using the syntax: Custom.Manufacturer.Type (e.g. Custom.Cisco.FirewallPIX).
2. Edit the .ini file
Using a text file editor (such as Notepad), open the .ini file created in step 1. You must change the following items in the .ini file from the template default values:
Change 'name' item to a UNIQUE device name. Example Custom.Cisco.Router Note: do not use spaces, use a 'period' mark (.) instead.
Change 'id' item to a UNIQUE number (i.e. one not used in any other device .ini file). Number must be within the range of 4000 to 4999.
default=Unique device name
Change the 'default' item to a UNIQUE device name.
3. Save & restart
Once you have made your changes to the .ini file, save it back to the \Devices sub folder and close.
Restart CatTools to populate the 'Device type' drop-down field in the device setup screen with your new custom device type.
4. Create a custom device script file (.txt)
Take a COPY of the Custom.Device.Template.txt in the \Templates sub folder of the CatTools root directory and save to the \Scripts sub folder.
Save it with a file name using the value entered for the [device] section 'name' item in step 2 above. Ensure you retain the .txt file type suffix.
(device .ini file settings)
Script file name must therefore be: Custom.Cisco.FirewallPIX.txt
5. Edit the .txt file
Using a text file editor*, open the .txt file created in step 4. Follow the instructions in the SCRIPT NOTES section of the .txt file to begin customizing the script for your device.
Note: although the .txt files can be opened and edited using 'NotePad', a syntax highlighting script editor may make reading and editing the .txt file much easier.
6. Save & test
Once you have made your initial changes to the .txt file, save it back to the \Scripts sub folder and close.
To test your custom device, create an activity that is supported by your custom device script and run it manually using the 'Run Now' button. (Device.ConnectivityTest.Login is a good starting point activity as every device must be able to log in successfully in order to perform any of the
other more complex 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.
Creating custom device checklist:
- Create device type file (.ini)
- Create device script file (.txt)