Pre-requisites

 

A reasonable understanding or experience of Visual Basic Scripting is assumed in order to successfully add custom scripts to CatTools.

There are example code template files found in the /Templates sub folder of the CatTools root directory, that can help provide a reasonable level of assistance.

 

 

Overview

Suppose that you would like to create a simple version report for a Cisco Router device. Custom activities in CatTools can accomplish this.

Four files are required.  Three activity files and one custom device file:

 

Activity files:

 

1)  The activity type file (.ini file), which defines the following:

 

activity name,

 

 

activity ID,

 

 

activity main script filename (associated with the activity),

 

 

activity client script filename (associated with the activity),

 

 

the user interface field values and defaults which are displayed in the activity form Options tab when adding or editing an activity.

 

 

2)  The activity main script file (.txt file), which contains code to read the activity options from the CatTools database, prepare folders and files to store output data, set variables, marshal the CatTools Client threads and do any post processing of results in order to create reports or send messages to the CatTools main program.

 

3)  The activity client script file (.txt file), which contains a number of common function calls to the device scripts, i.e. the scripts that send device specific commands in order to get the device to log in, issue the commands required to perform the activity, then log out of the device again.

 

Device file:

 

4) The device script file (.custom file), which contains device type specific code for the custom activity, for example, the commands to send to the device and any parsing of the data before sending the results back to the client activity script.

 

 

The activity client and main script files also contains function calls and references to variables within the internal CatTools program code.  These are prefixed with 'cl.' in the client script and 'ct.' in the main script.    A list of these cl. and ct. functions and variables have also been made available within this chapter to help assist in the development of your custom activity scripts.

 

 

 

How to create a custom activity - a simple step-by-step guide on how to create a custom activity

 

 

The custom activity type file (.ini)  -  information and how to create the custom activity type file

 

 

The custom activity main script file (.txt)  -  information and how to create the custom activity main script file

 

 

The custom activity client script file (.txt)  -  information and how to create the custom activity client script file

 

 

The custom activity device script file (.custom) - information and how to create the custom activity device script file

 

 

cl. / ct. variables and functions - information on the CatTools internal variables and functions exposed to the custom activity script files

 

 

Testing your custom activity  - help and tips on testing your custom activity

 

For more information on what CatTools can do for you visit: Configuration Management and Network Automation | Kiwi CatTools