From a0163aa4a5633c8cbe91bc3881281434da1007d0 Mon Sep 17 00:00:00 2001 From: Yuri Slobodyanyuk Date: Fri, 7 Oct 2022 18:26:28 +0000 Subject: [PATCH 1/3] Fortigate cheat sheet, added top --- .../Fortigate-debug-diagnose-complete-cheat-sheet.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc b/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc index ef56a05..9301792 100644 --- a/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc +++ b/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc @@ -85,6 +85,12 @@ iprope lookup 10.10.10.1 34567 8.8.8.8 443 6 LAN1` |*get sys performance stat* |Show real-time operational statistics: CPU load per CPU, memory usage, average network/session, uptime. +|*diagnose sys top [_refresh_] [_num-of-processes_] [_iterations_]* +|Print list of running processes updated every _refresh_ seconds, for +_iterations_ times, sorted in descending order by the CPU load. This `top` command does not display all processes by +default, to show them all, set _num-of-processes_ to high number, for example +100. + |*diagnose debug crashlog read* | Display crash log. Records all daemons crashes and restarts. Some daemons are more critical than others. From dd45f26b8b6efe349a5ddae380e897322c7816dc Mon Sep 17 00:00:00 2001 From: Yuri Slobodyanyuk Date: Sun, 9 Oct 2022 08:52:00 +0000 Subject: [PATCH 2/3] Fortigate additions --- ...tigate-debug-diagnose-complete-cheat-sheet.adoc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc b/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc index 9301792..31c982e 100644 --- a/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc +++ b/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc @@ -86,10 +86,15 @@ iprope lookup 10.10.10.1 34567 8.8.8.8 443 6 LAN1` |Show real-time operational statistics: CPU load per CPU, memory usage, average network/session, uptime. |*diagnose sys top [_refresh_] [_num-of-processes_] [_iterations_]* -|Print list of running processes updated every _refresh_ seconds, for +|Print list of running processes updated every _refresh_ seconds (default 5), for _iterations_ times, sorted in descending order by the CPU load. This `top` command does not display all processes by default, to show them all, set _num-of-processes_ to high number, for example -100. +100. Press "m" to sort the processes by memory consumption. The displayed table +is in this order: `Process id`, `process state: (R)unning, (S)leep, (Z)ombie, +(D)isk Sleep, < Means higher priority`, `CPU used`, `Memory used`. + +|*dia sys kill <_signal-id_> <_process-id_>* +|Forcefully kill the process with the id of _process-id_, sending it the given _signal-id_ (Linux signals, e.g. 9, 11). |*diagnose debug crashlog read* | Display crash log. Records all daemons crashes and restarts. Some daemons are more critical than others. @@ -97,6 +102,11 @@ default, to show them all, set _num-of-processes_ to high number, for example |*diagnose debug crashlog clear* | Clear the crash log. +|*dia sys top-mem [_num-processes_] [detail]* +|Show top (default 5) processes by memory usage, optionally set number of +processes to show with _num-processes_, and use `detail` to get verbose output +(a lot). + |*get hardware memory* | Show memory statistics: free, cached, swap, shared From 37fa192758031da1611a0ced854774fda12e2a78 Mon Sep 17 00:00:00 2001 From: Yuri Slobodyanyuk Date: Sun, 9 Oct 2022 08:52:42 +0000 Subject: [PATCH 3/3] Fortigate additions --- cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc b/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc index 31c982e..d9ce76e 100644 --- a/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc +++ b/cheat-sheets/Fortigate-debug-diagnose-complete-cheat-sheet.adoc @@ -93,7 +93,7 @@ default, to show them all, set _num-of-processes_ to high number, for example is in this order: `Process id`, `process state: (R)unning, (S)leep, (Z)ombie, (D)isk Sleep, < Means higher priority`, `CPU used`, `Memory used`. -|*dia sys kill <_signal-id_> <_process-id_>* +|*dia sys kill _signal-id_ _process-id_* |Forcefully kill the process with the id of _process-id_, sending it the given _signal-id_ (Linux signals, e.g. 9, 11). |*diagnose debug crashlog read*