在查容器内部资源利用情况时候,发现top命令无法使用,报错“TERM environment variable not set.”。从网上找到了解决方案,如下。
[root@localhost ~]# docker exec -ti redis /bin/bash[root@9bf53a30e849 /]# topTERM environment variable not set.[root@9bf53a30e849 /]# echo $TERMdumb[root@9bf53a30e849 /]# export TERM=dumb[root@9bf53a30e849 /]# top top - 11:14:13 up 85 days, 20:18, 0 users, load average: 8.75, 8.61, 8.53Tasks: 28 total, 1 running, 27 sleeping, 0 stopped, 0 zombie%Cpu(s): 1.7 us, 0.3 sy, 12.5 ni, 85.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 stKiB Mem : 13175309+total, 10896009+free, 9802708 used, 12990288 buff/cacheKiB Swap: 4194300 total, 4194300 free, 0 used. 11734181+avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND root 20 0 11604 1364 1164 S 0.0 0.0 1:04.54 run.sh nagios 20 0 44212 1352 804 S 0.0 0.0 5:50.39 nrpe root 20 0 22720 1308 700 S 0.0 0.0 0:38.39 crond root 20 0 82488 3484 2640 S 0.0 0.0 0:00.00 sshd root 20 0 322668 2096 1792 S 0.0 0.0 115:39.77 LiveDistribute. root 20 0 322668 1924 1736 S 0.0 0.0 116:06.00 LiveDistribute. root 20 0 322668 2080 1736 S 0.0 0.0 116:44.28 LiveDistribute. root 20 0 322668 1932 1736 S 0.0 0.0 113:00.33 LiveDistribute. root 20 0 322668 1912 1736 S 0.0 0.0 111:23.64 LiveDistribute. root 20 0 257132 2064 1724 S 0.0 0.0 11:13.00 LiveDistribute. root 20 0 257132 2060 1724 S 0.0 0.0 11:30.31 LiveDistribute. root 20 0 257132 2064 1724 S 0.0 0.0 11:12.71 LiveDistribute. root 20 0 257132 4100 1724 S 0.0 0.0 11:25.46 LiveDistribute. root 20 0 10792 2664 1168 S 0.0 0.0 573:00.03 keepBusinessPro root 20 0 9508 1396 1192 S 0.0 0.0 0:00.00 startTaskManage root 20 0 38.893g 1.079g 14000 S 0.0 0.9 814:57.20 java root 20 0 11744 1748 1428 S 0.0 0.0 0:00.02 bash root 20 0 11740 1748 1428 S 0.0 0.0 0:00.02 bash root 20 0 24776 1780 1440 S 0.0 0.0 0:00.00 vi root 20 0 11744 1864 1468 S 0.0 0.0 0:00.02 bash root 20 0 9512 1428 1220 S 0.0 0.0 0:00.00 startTaskProces root 20 0 35.458g 717284 15548 S 0.0 0.5 0:24.31 java root 20 0 4312 352 280 S 0.0 0.0 0:00.00 sleep root 20 0 24212 1472 1096 R 0.0 0.0 0:00.00 top root 20 0 11740 1860 1468 S 0.0 0.0 0:00.02 bash root 20 0 11740 1908 1496 S 0.0 0.0 0:00.04 bash root 20 0 11740 1864 1468 S 0.0 0.0 0:00.02 bash root 20 0 24772 1700 1364 S 0.0 0.0 0:00.01 vi
http://www.cnblogs.com/zhenyuyaodidiao/p/5340465.html