Fortinet black logo

Cookbook

Running processes

Copy Link
Copy Doc ID af0e75e9-211f-11ea-9384-00505692583a:76710
Download PDF

Running processes

The diagnose sys top CLI command displays a list of processes that are running on the FortiGate device, as well as information about each process.

The following commands can be used while the command is running:

q

Quit, and return to the command prompt.

c

Sort the process list by the amount of CPU that each process is using.

m

Sort the process list by the amount of memory that each process is using.

The get system performance top command also performs the same function.

Syntax

diagnose sys top [<delay>] [<lines>]

Variable

Description

<delay>

The delay between updates of the process list, in seconds (default = 5).

<lines>

The maximum number of processes that are displayed in the output (default = 20).

Example output

# diagnose sys top 5 5
Run Time:  4 days, 5 hours and 29 minutes
1U, 0N, 0S, 99I, 0WA, 0HI, 0SI, 0ST; 1866T, 1113F
         miglogd      191      S       0.3     6.3
          newcli    18391      R       0.1     0.3
         cmdbsvr       99      S       0.3     1.4
         pyfcgid    15628      S       0.0     1.3
       ipshelper      164      S <     0.3     1.2

Keyword / Variable / Column

Description

Run Time

How long the FortiOS has been running, as a string.

U

The percentage of user space applications using the CPU. In the example, 1U means that 1% of user space applications are using the CPU.

N

Nice, or higher priority, processes, as a percentage.

S

System, or kernel, processes that are using the CPU, as a percentage.

I

The idle CPU usage, as a percentage.

WA

The IO wait, as a percentage.

HI

The hardware interrupts, as a percentage of CPU time used.

SI

The software interrupts, as a percentage of CPU time used.

ST

The steal time, as a percentage.

T

The total FortiOS system memory, in MB. In the example, 1866T means that there is 1866 MB of system memory.

F

The total free memory, in MB. In the example 1113F means that there are 1113 MB of free memory.

Column 1

The process name, such as miglogd, or newcli.

Column 2

The process ID number (PID).

Column 3

The process status:

  • R: running
  • S: sleeping
  • Z: zombie
  • D: disk sleep

A < on a process means that it is high priority.

Column 4

The CPU usage.

Column 5

The memory usage.

Stop a running process

The diagnose sys kill command can be used to stop a running process.

Syntax

diagnose sys kill <signal> <PID>

Variable

Description

<signal>

A number between 1 and 32.

Each number represents a signal sent to kill the process. Signal 11 is commonly used to send the SIGEGV signal, causing the process to generate a Segmentation Fault crashlog. Signal 9, SIGKILL, forces the process to terminate immediate.

For more information about kill commands and signals, see https://www.linux.org/threads/kill-commands-and-signals.8881.

<PID>

The process ID of the process to be killed.

Example

To kill the newcli process from the previous example and generate a Segmentation Fault crashlog, enter the following:

diagnose sys kill 11 18391

Running processes

The diagnose sys top CLI command displays a list of processes that are running on the FortiGate device, as well as information about each process.

The following commands can be used while the command is running:

q

Quit, and return to the command prompt.

c

Sort the process list by the amount of CPU that each process is using.

m

Sort the process list by the amount of memory that each process is using.

The get system performance top command also performs the same function.

Syntax

diagnose sys top [<delay>] [<lines>]

Variable

Description

<delay>

The delay between updates of the process list, in seconds (default = 5).

<lines>

The maximum number of processes that are displayed in the output (default = 20).

Example output

# diagnose sys top 5 5
Run Time:  4 days, 5 hours and 29 minutes
1U, 0N, 0S, 99I, 0WA, 0HI, 0SI, 0ST; 1866T, 1113F
         miglogd      191      S       0.3     6.3
          newcli    18391      R       0.1     0.3
         cmdbsvr       99      S       0.3     1.4
         pyfcgid    15628      S       0.0     1.3
       ipshelper      164      S <     0.3     1.2

Keyword / Variable / Column

Description

Run Time

How long the FortiOS has been running, as a string.

U

The percentage of user space applications using the CPU. In the example, 1U means that 1% of user space applications are using the CPU.

N

Nice, or higher priority, processes, as a percentage.

S

System, or kernel, processes that are using the CPU, as a percentage.

I

The idle CPU usage, as a percentage.

WA

The IO wait, as a percentage.

HI

The hardware interrupts, as a percentage of CPU time used.

SI

The software interrupts, as a percentage of CPU time used.

ST

The steal time, as a percentage.

T

The total FortiOS system memory, in MB. In the example, 1866T means that there is 1866 MB of system memory.

F

The total free memory, in MB. In the example 1113F means that there are 1113 MB of free memory.

Column 1

The process name, such as miglogd, or newcli.

Column 2

The process ID number (PID).

Column 3

The process status:

  • R: running
  • S: sleeping
  • Z: zombie
  • D: disk sleep

A < on a process means that it is high priority.

Column 4

The CPU usage.

Column 5

The memory usage.

Stop a running process

The diagnose sys kill command can be used to stop a running process.

Syntax

diagnose sys kill <signal> <PID>

Variable

Description

<signal>

A number between 1 and 32.

Each number represents a signal sent to kill the process. Signal 11 is commonly used to send the SIGEGV signal, causing the process to generate a Segmentation Fault crashlog. Signal 9, SIGKILL, forces the process to terminate immediate.

For more information about kill commands and signals, see https://www.linux.org/threads/kill-commands-and-signals.8881.

<PID>

The process ID of the process to be killed.

Example

To kill the newcli process from the previous example and generate a Segmentation Fault crashlog, enter the following:

diagnose sys kill 11 18391