Description
This article describes how to show a complete list of processes on the FortiGate.
Scope
FortiGate.
Solution
When using an SSH client to connect to the console (CLI) only a certain number of processes are shown when issuing the command 'diag sys top', not all process information seems to be displayed.
Use the options available to expand the list of processes, for example:
diagnose sys top 2 99 3
Where:
- '2' is the interval in seconds between each refresh. A low number for the refresh interval is useful for isolating the processes causing CPU spikes, but may not allow a large list of applications to be displayed.
- '99' is the number of lines being displayed during an iteration.
- '3' is the number of iterations this command should display.
Another limitation may be caused by the window size of the SSH client. Displaying 99 lines while the SSH window can only accommodate 30, will truncate the output.
For this, a simple resize or maximize of the SSH window may fix it.
Depending on the features configured or used, the list of processes may have different number of entries. To display a particular one by name (when known, or a part of it known), a similar command and a filter can be used:
diagnose sys top-summary | grep name
Example:
FG# diagnose sys top-summary | grep log
171 21M 0.0 0.5 43 00:01.20 miglogd [x3]
172 6M 0.0 0.2 8 00:00.00 kmiglogd
Note 1: This modifier/filter can’t be used in 'diag sys top'.
Note 2: 'diag sys top-summary' command is missing from FortiOS 5.6.0 to 5.6.3
Note 3: Refer to the article Technical Tip: Deprecated of command '# diagnose sys top-summary' that states from version 6.4.0, 'top-summary command' is removed.
An alternative command to use (grep parameter is supported in FortiOS 7.0.1 GA or higher):
diagnose sys top | grep name
Example:
FG# diagnose sys top-summary | grep log
When troubleshooting memory issues, it is indicated to press 'm' to sort the diag sys top output by memory usage. (the default sort is by CPU).
Example: