Submit a ticketCall us

Announcing NCM 7.7
With NCM 7.7, you can examine the rules that make up an access control list for a Cisco ASA device. Then you can apply filters to display only rules that meet the specified criteria, order the rules by line number or by the hit count, and much more.
See new features and improvements.

Home > Success Center > Kiwi CatTools > Kiwi CatTools 3.11 Administrator Guide > Activities > Creating a custom activity > How to create a custom activity

How to create a custom activity

Table of contents
No headers
Created by Caroline Juszczak, last modified by Caroline Juszczak on Jun 28, 2016

Views: 22 Votes: 0 Revisions: 1

 

Quick reference guide to creating a custom activity in CatTools

 

This is a simple step-by-step guide on creating a custom activity in CatTools.

It contains brief instructions on how to add a custom activity type to the CatTools GUI, and how to create a the custom main script and custom client script activity files, and how to make your custom activity available to device types.

 

The custom activity templates files provided by CatTools and referenced in this guide, are based on creating a simple Version report for a Cisco Router device. ??Once you have created the script (.txt and .custom) files, you will need to modify them for your particular activity or report.

 

Further information regarding the custom activity type file (.ini), custom activity main script file (.txt), custom activity client script file (.txt), custom activity device script file (.custom), ct. code examples and cl. code examples of how to use the CatTools internal functions and sub procedures in your activity scripts, can be found in the other sub pages of this chapter.

 

STEPS TO CREATE A CUSTOM ACTIVITY:

 

1. Create a custom activity type file (.ini)

Take a COPY of the Custom.Activity.Template.ini in the \Templates sub folder of the CatTools root directory and save to the \Activities sub folder, giving it a new file name using the syntax: Custom.Type.Name (e.g. Custom.Report.Version).

 

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:

 

[Activity]

name=Custom.Activity.Template

script_main=Main.Custom.Activity.Template.txt

script_client=Client.Custom.Activity.Template.txt

report_file=%AppPath%Reports\Master Custom Activity Template.txt

id=3999

 

Change 'name' item to a UNIQUE activity name. Example: Custom.Report.PortStatus. Note: do not use spaces, use a 'period' mark (.) instead.

Change 'script_main' item to the name of the associated Main script file (use activity name and prefix with 'Main.' to keep UNIQUE).

Change 'script_client' item to the name of the associated Client script file (use activity name and prefix with 'Client.' to keep UNIQUE).

Change 'report_file' item to a UNIQUE report name.

Change 'id' item to a UNIQUE number (i.e. one not used in any other activity .ini file). Number must be within the range of 4000 to 4999.

 

3. Save & restart

Once you have made your changes to the .ini file, save it back to the \Activities sub folder and close.

Restart CatTools to populate the 'Type' drop-down field in the activity setup screen with your new custom activity type.

 

4. Create a custom activity main script file (.txt)

Take a COPY of the Main.Custom.Activity.Template.txt in the \Templates sub folder of the CatTools root directory and save to the \Scripts sub folder, giving it a new file name as specified in the 'script_main' item within the activity type .ini file [Activity] section in step 2) above. Ensure you retain the .txt file type suffix.

 

5. Edit the main script .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 activity.

 

6. Save the main script .txt file

Once you have made your initial changes to the main script .txt file, save it back to the \Scripts sub folder and close.

 

7. Create a custom activity client script file (.txt)

Take a COPY of the Client.Custom.Activity.Template.txt in the \Templates sub folder of the CatTools root directory and save to the \Scripts sub folder, giving it a new file name as specified in the 'script_client' item within the activity type .ini file [Activity] section in step 2) above. Ensure you retain the .txt file type suffix.

 

8. Edit the client script .txt file

Using a text file editor*, open the .txt file created in step 7). ?? Follow the instructions in the SCRIPT NOTES section of the .txt file to begin customizing the script for your activity.

 

9. Save the client script .txt file

Once you have made your initial changes to the client script .txt file, save it back to the \Scripts sub folder and close.

 

10. Create a custom activity device script file (.custom)

Take a COPY of the Custom.Device.Template.txt.custom in the \Templates sub folder of the CatTools root directory and save to the \Scripts sub folder, giving it a new file name. You need to ensure you save the file using the same file name (including the .txt file type suffix) as its associated encrypted device script file (or a custom device script file), and then append an additional suffix '.custom'

 

Example: (creating a custom activity device script file for a Cisco Router)

 

Cisco router encrypted script file provide by CatTools: Cisco.Router.General.txt

Custom activity device script file name will therefore be: Cisco.Router.General.txt.custom

 

11. Edit the device script .custom file

Using a text file editor*, open the .custom file created in step 10).  Read the SCRIPT NOTES section of the .custom file and begin customizing the script for your device. An example of the steps you need to follow to add a custom activity to the .custom device file can be found in The custom activity device script file (.custom) help file page.

 

12. Save the device script .custom file

Once you have made your changes to the device script .custom file, save it back to the \Scripts sub folder and close.

 

13. Testing your custom activity scripts

 

When all the custom activity scripts and the device .custom script files are set up, you can test the new activity within CatTools by setting up the activity to run with the device you created the .custom file for. Use the 'Run Now' button to test the custom activity manually rather then by starting the timer.

Check the Info Log pane for errors and edit your .txt files and .custom file as necessary.

 

See Testing your custom activity for more information and tips.

 

Creating custom activity checklist:

  • Create activity type file (.ini)
  • Create activity Main script file (.txt)
  • Create activity Client script file (.txt)
  • Create activity device script file (.custom)

 

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).

Last modified
07:20, 28 Jun 2016

Tags

Classifications

Public