Skip to main content
simonz_FTNT
Staff & Editor
Staff & Editor
December 1, 2023

Technical Tip: TAC debug script with TeraTerm

  • December 1, 2023
  • 0 replies
  • 10283 views
Description

This article describes how to use the TAC debug script to collect debug from FortiGate in case it has a high CPU, high memory, packet drop, or misbehavior.

Scope

FortiGate.

Solution

The following script is crafted to collect required debug commands depending on what issue is being troubleshooted, and is useful to collect that information beforehand before raising a ticket with TAC: Support portal.

 

Below is the current supported list of debug, which will be updated from time to time:

  • WAD.
  • IPS Engine.
  • VPN.
  • NP6/NP7/NPxlite.
  • CPU & Memory related.
  • Packet sniffer.
  • Custom debug.

 

Make the following changes to the script according to the environment, and it will prompt for the password when beginning to run the script for debug collection.

 

username = 'admin'     Username used to login into FortiGate (super_admin) profile is required.
hostname = 'xx.xx.xx.xx' IP address of the device.
sshport = '22' Change if using a custom SSH port.
dpath = 'C:\FTNTTACDebug'  Log file store location.
vdom = 'root'  Specify VDOM that needs a debug command to run.
waittime = '300' Pause duration before the next execution of the command in seconds.
lsize = '10M' Log rotate file size (M = megabyte).
NP = '1'  Number of NP processors, use 'diag npu npX port-list' to check. Leave it default if the device does not have NP.
wadworker = '2'    Number of WAD workers, check using the 'diag test application wad 1000command. Leave it default if not debugging on WAD.
verb = '6' Sniffer verbose level.
sniint = 'any' Specify the interface for a packet sniffer.
sniwait = '5' Sniffer waits for the timer.
secure = 0  1-TeraTerm console will run in the background, 0-Show on desktop (default).
mloop = 10000000
Define the number of times to collect debug.
option = '3,0' 1-WAD, 2-IPSE, 3-CPUMEM, 4-VPN, 5-NP6, 6-NP7, 7-NPx (SoC 3 & 4), 8-SNIFF, 9-NP7lite, 10-CUSTOM.


v1.4 script supports collecting 2 different sets of debugs in a single TeraTerm macro. The option is separated by ',' and the second digit shall remain ZERO if it does not need to collect additional debug.

Refer to Troubleshooting Tip: Preparing windows machine to run TeraTerm scripts for guidance on how to run the script and to download the TeraTerm installer.
Refer to Troubleshooting Tip: Using a PID process debugging TeraTerm script for guidance on how to use TeraTerm scripts to debug processes.


If the secure option is set to '1': when closing the TeraTerm macro script, the console will remain open in the background as it was not properly shut down. It can be closed to the task manager or use the cleanup.ps1 (PowerShell script in cleanup.zip) to close TeraTerm.

Note:

This script is now compatible with TeraTerm version 5.3 or above.