To monitor the purpose of the system, I need to redirect the output of the top command to a file so that I use / analyze it. I am trying to do the same, but CPU performance statistics are not saved in the file. screenshots. Expected Result:
[ root@v100 /usr/local/bin]# top last pid: 6959; load averages: 0.01, 0.03, 0.03 up 0+02:47:34 17:51:16 114 processes: 1 running, 108 sleeping, 5 zombie CPU: 0.0% user, 0.0% nice, 1.6% system, 0.0% interrupt, 98.4% idle Mem: 734M Active, 515M Inact, 226M Wired, 212M Buf, 491M Free Swap: 4095M Total, 4095M Free PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 1953 root 150 20 0 3084M 635M uwait 2:44 0.00% java 1663 mysql 46 20 0 400M 139M sbwait 1:29 0.00% mysqld 1354 root 31 20 0 94020K 50796K uwait 0:24 0.00% beam 4233 root 1 20 0 122M 23940K select 0:06 0.00% python 1700 zabbix 1 20 0 20096K 2436K nanslp 0:03 0.00% zabbix_agentd 1799 zabbix 1 20 0 103M 7240K nanslp 0:02 0.00% zabbix_server 4222 root 1 30 0 122M 23300K select 0:02 0.00% python 1696 zabbix 1 20 0 19968K 2424K nanslp 0:02 0.00% zabbix_agentd 2853 root 1 20 0 126M 29780K select 0:02 0.00% python 1793 zabbix 1 20 0 103M 7152K nanslp 0:01 0.00% zabbix_server 1797 zabbix 1 20 0 103M 8348K nanslp 0:01 0.00% zabbix_server 1752 root 1 20 0 122M 22344K select 0:01 0.00% python 1796 zabbix 1 20 0 103M 8136K nanslp 0:01 0.00% zabbix_server 1795 zabbix 1 20 0 103M 8208K nanslp 0:01 0.00% zabbix_server 1801 zabbix 1 20 0 103M 7100K nanslp 0:01 0.00% zabbix_server 3392 root 1 20 0 122M 23392K select 0:01 0.00% python 1798 zabbix 1 20 0 103M 7860K nanslp 0:01 0.00% zabbix_server 2812 root 1 20 0 134M 25184K select 0:01 0.00% python 1791 zabbix 1 20 0 103M 7188K nanslp 0:01 0.00% zabbix_server 1827 root 1 -52 r0 14368K 1400K nanslp 0:01 0.00% watchdogd 1790 zabbix 1 20 0 103M 7164K nanslp 0:01 0.00% zabbix_server 1778 zabbix 1 20 0 103M 8608K nanslp 0:01 0.00% zabbix_server 1780 zabbix 1 20 0 103M 8608K nanslp 0:01 0.00% zabbix_server 2928 root 1 20 0 122M 23272K select 0:01 0.00% python 2960 root 1 20 0 116M 22288K select 0:01 0.00% python 1776 zabbix 1 20 0 103M 7248K nanslp 0:01 0.00% zabbix_server 2892 root 1 20 0 122M 22648K select 0:01 0.00% python 1789 zabbix 1 20 0 103M 7128K nanslp 0:01 0.00% zabbix_server 1814 root 1 20 0 216M 15796K select 0:01 0.00% httpd 1779 zabbix 1 20 0 103M 8608K nanslp 0:01 0.00% zabbix_server 1783 zabbix 1 20 0 103M 8608K nanslp 0:01 0.00% zabbix_server 1800 zabbix 1 20 0 103M 7124K nanslp 0:01 0.00% zabbix_server 1782 zabbix 1 20 0 103M 8608K nanslp 0:01 0.00% zabbix_server 1781 zabbix 1 20 0 103M 8608K nanslp 0:00 0.00% zabbix_server 1792 zabbix 1 20 0 103M 7172K nanslp 0:00 0.00% zabbix_server 2259 root 2 20 0 48088K 4112K uwait 0:00 0.00% cb_heuristics
If I do:
[ root@v100 /usr/local/bin]
then it shows:
[ root@v100 /usr/local/bin]
so here I can control the memory, but not the processor, the reason is the output of the top redirect. CPU statistics not updated
How can I capture CPU statistics?
If you have any suggestions, tell me.
v-jay source share