Monitoring
htop
This command is similar "top" command, but provide much clear and formatted output.
$ htop
1 [|||||||||||| 25.0%] 5 [ 0.0%]
2 [ 0.0%] 6 [||||||||||||||||||||||||||||||||||||||||100.0%]
3 [ 0.0%] 7 [ 0.0%]
4 [|||||||||||| 25.0%] 8 [ 0.0%]
Mem[|||||||||||||||||||||||||||||||||||3.95G/7.27G] Tasks: 170, 952 thr; 2 running
Swp[|| 256M/7.42G] Load average: 0.78 0.91 0.85
Uptime: 2 days, 18:40:37
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
106349 suresh 20 0 221M 5176 3592 R 128. 0.1 0:00.12 htop
1 root 20 0 171M 13500 8100 S 0.0 0.2 0:44.73 /usr/lib/systemd/systemd --switched-root --syste
681 root 20 0 109M 62972 61820 S 0.0 0.8 0:16.00 /usr/lib/systemd/systemd-journald
698 root 20 0 49548 8384 6724 S 0.0 0.1 0:01.10 /usr/lib/systemd/systemd-udevd
895 root 16 -4 23024 1960 1616 S 0.0 0.0 0:00.00 /sbin/auditd
894 root 16 -4 23024 1960 1616 S 0.0 0.0 0:00.13 /sbin/auditd
941 root 20 0 306M 7096 6124 S 0.0 0.1 0:00.00 /usr/sbin/ModemManager
973 root 20 0 306M 7096 6124 S 0.0 0.1 0:00.00 /usr/sbin/ModemManager
914 root 20 0 306M 7096 6124 S 0.0 0.1 0:00.27 /usr/sbin/ModemManager
915 avahi 20 0 31252 3932 3584 S 0.0 0.1 0:01.80 avahi-daemon: running [linux.local]
916 root 20 0 8408 4408 3992 S 0.0 0.1 0:00.09 /usr/libexec/bluetooth/bluetoothd
1188 root 20 0 326M 27828 14020 S 0.0 0.4 0:00.00 /usr/bin/python3 /usr/sbin/firewalld --nofork --
919 root 20 0 326M 27828 14020 S 0.0 0.4 0:01.27 /usr/bin/python3 /usr/sbin/firewalld --nofork --
924 root 20 0 2428 68 0 S 0.0 0.0 0:01.95 /usr/sbin/gpm -m /dev/input/mice -t exps2
955 root 20 0 304M 6840 6588 S 0.0 0.1 0:04.65 /sbin/rngd -f
958 root 20 0 304M 6840 6588 S 0.0 0.1 0:04.65 /sbin/rngd -f
959 root 20 0 304M 6840 6588 S 0.0 0.1 0:04.62 /sbin/rngd -f
960 root 20 0 304M 6840 6588 S 0.0 0.1 0:04.62 /sbin/rngd -f
926 root 20 0 304M 6840 6588 S 0.0 0.1 0:41.77 /sbin/rngd -f
975 rtkit 20 0 149M 2976 2796 S 0.0 0.0 0:00.37 /usr/libexec/rtkit-daemon
976 rtkit RT 1 149M 2976 2796 S 0.0 0.0 0:00.34 /usr/libexec/rtkit-daemon
929 rtkit 21 1 149M 2976 2796 S 0.0 0.0 0:00.74 /usr/libexec/rtkit-daemon
930 root 20 0 247M 7872 7400 S 0.0 0.1 0:02.90 /usr/sbin/sssd -i --logger=files
968 root 20 0 432M 5448 5104 S 0.0 0.1 0:00.00 /usr/libexec/switcheroo-control
977 root 20 0 432M 5448 5104 S 0.0 0.1 0:00.00 /usr/libexec/switcheroo-control
933 root 20 0 432M 5448 5104 S 0.0 0.1 0:00.07 /usr/libexec/switcheroo-control
934 root 20 0 17480 5132 4812 S 0.0 0.1 0:00.81 /usr/lib/systemd/systemd-machined
952 root 20 0 392M 9852 8716 S 0.0 0.1 0:00.00 /usr/libexec/udisks2/udisksd
974 root 20 0 392M 9852 8716 S 0.0 0.1 0:00.02 /usr/libexec/udisks2/udisksd
F1Help F2Setup F3SearchF4FilterF5Tree F6SortByF7Nice -F8Nice +F9Kill F10Quit
Save htop output to a file
Install aha
This is to convert ANSI to HTML
yum install aha
Save output to a file
echo q | htop | aha --black --line-fix > htop.html
iotop
Simple top-like I/O monitor
# iotop
Total DISK READ : 0.00 B/s | Total DISK WRITE : 0.00 B/s
Actual DISK READ: 0.00 B/s | Actual DISK WRITE: 0.00 B/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % systemd --switched-root --system --deserialize 29
2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd]
3 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [rcu_gp]
4 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [rcu_par_gp]
6 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/0:0H-kblockd]
9 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [mm_percpu_wq]
10 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0]
11 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [rcu_sched]
12 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0]
13 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [cpuhp/0]
14 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [cpuhp/1]
15 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1]
16 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/1]
18 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/1:0H-kblockd]
19 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [cpuhp/2]
20 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/2]
21 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/2]
23 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/2:0H-kblockd]
24 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [cpuhp/3]
25 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/3]
26 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/3]
28 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/3:0H-kblockd]
29 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [cpuhp/4]
30 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/4]
31 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/4]
33 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/4:0H-kblockd]
34 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [cpuhp/5]
35 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/5]
36 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/5]
38 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/5:0H-kblockd]
39 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [cpuhp/6]
40 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/6]
41 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/6]
43 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/6:0H-kblockd]
44 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [cpuhp/7]
45 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/7]
46 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/7]
48 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/7:0H-kblockd]
49 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kdevtmpfs]
50 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [netns]
51 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [rcu_tasks_kthre]
52 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kauditd]
53 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [oom_reaper]
54 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [writeback]
55 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kcompactd0]
iptraf-ng
Interactive Colorful IP LAN Monitor
iptraf-ng
Note
It provides the following details:
- IP traffic monitor
- General interface statistics
- Detailed interface statistics
- Statistical breakdowns...
- LAN station monitor
Note
Package needed - iptraf-ng
yum install iptraf-ng
nmon
It is a System analysis tool to get system details.
Note
It is a combination of many commands, which provides details like :
- CPU
- Memory
- Network
- Disk I/O
- Kernel Stats
etc.
# nmon
┌nmon─16k──────[H for help]───Hostname=localhost────Refresh= 2secs ───16:14.40───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │
│ ------------------------------ │
│ _ __ _ __ ___ ___ _ __ For help type H or ... │
│ | '_ \| '_ ` _ \ / _ \| '_ \ nmon -? - hint │
│ | | | | | | | | | (_) | | | | nmon -h - full details │
│ |_| |_|_| |_| |_|\___/|_| |_| │
│ To stop nmon type q to Quit │
│ ------------------------------ │
│ │
│ Fedora release 31 (Thirty One) VERSION="31 (Workstation Edition)" │
│ Vendor=AuthenticAMD Model=AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx │
│ MHz=1345.254 bogomips=4191.83 lscpu:CPU=8 Little Endian │
│ ProcessorChips=1 PhysicalCores=4 Sockets=1 Cores=4 Thrds=2 │
│ Hyperthreads =2 VirtualCPUs =8 MHz=1236 max=2100 min=1400 │
│ │
│ Use these keys to toggle statistics on/off: │
│ c = CPU l = CPU Long-term - = Faster screen updates │
│ C = " WideView U = Utilisation + = Slower screen updates │
│ m = Memory V = Virtual memory j = File Systems │
│ d = Disks n = Network . = only busy disks/procs │
│ r = Resource N = NFS h = more options │
│ k = Kernel t = Top-processes q = Quit │
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ │
ps
To get current user SHELL
ps -p $$
$ ps -p $$
PID TTY TIME CMD
59846 pts/3 00:00:00 bash
$