{"id":287790,"date":"2023-11-22T04:01:22","date_gmt":"2023-11-21T20:01:22","guid":{"rendered":"https:\/\/lrxjmw.cn\/lfwqncsyqkml.html"},"modified":"2023-11-22T04:01:22","modified_gmt":"2023-11-21T20:01:22","slug":"lfwqncsyqkml","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lfwqncsyqkml.html","title":{"rendered":"Linux\u670d\u52a1\u5668\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u547d\u4ee4\u663e\u793a\u7cfb\u7edf\u4e2d\u53ef\u7528\u548c\u8f93\u5165\/\u8f93\u51fa\u7edf\u8ba1\u4fe1\u606f"},"content":{"rendered":"

#ps-Clighttpd-opid=<\/p>\n

\u6216\u5219<\/p>\n

#pgreplighttpd<\/p>\n

\u6216\u5219<\/p>\n

#pgrep-uvivekphp-cgi<\/p>\n

\u590d\u5370PID55977\u7684\u540d\u79f0<\/p>\n

#ps-p55977-ocomm=<\/p>\n

\u524d10\u4e2a\u663e\u5b58\u6d88\u8017\u8fdb\u7a0b<\/p>\n

#ps-auxf|sort-nr-k4|head-10<\/p>\n

\u5411\u6211\u4eec\u5c55\u793a10\u5927\u6d88\u8017CPU\u7684\u8fdb\u7a0b<\/p>\n

#ps-auxf|sort-nr-k3|head-10<\/p>\n

free\u2013\u663e\u793aLinux<\/a>\u670d\u52a1\u5668\u663e\u5b58\u4f7f\u7528\u60c5\u51b5<\/p>\n

free\u547d\u4ee4<\/a>\u663e\u793a\u7cfb\u7edf<\/a>\u4e2d\u53ef\u7528\u548c\u5df2\u7528\u5316\u5b66\u663e\u5b58\u548c\u4ea4\u6362\u663e\u5b58\u7684\u603b\u6570\uff0c\u4ee5\u53ca\u5185\u6838\u4f7f\u7528\u7684\u7f13\u51b2\u533a\u3002<\/p>\n

#free<\/p>\n

\u8f93\u51fa\u6837\u4f8b:<\/p>\n

\n

total used free shared buffers cached\nMem: 12302896 9739664 2563232 0 523124 5154740\n-\/+ buffers\/cache: 4061800 8241096\nSwap: 1052248 0 1052248\n<\/pre>\n<\/p>\n

iostat\u2013MontorLinuxaverageCPUloadanddiskactivity<\/p>\n

iostat\u547d\u4ee4\u62a5\u544a\u8bbe\u5907\u3001\u5206\u533a\u548c\u7f51\u8def\u6587\u4ef6\u7cfb\u7edf\uff08NFS\uff09\u7684\u4e2d\u592e\u5904\u7406\u5668\uff08CPU\uff09\u7edf\u8ba1\u4fe1\u606f\u548c\u8f93\u5165\/\u8f93\u51fa\u7edf\u8ba1\u4fe1\u606f\u3002<\/p>\n

\n

# iostat\n<\/pre>\n<\/p>\n

\u8f93\u51fa\u6837\u4f8b:<\/p>\n

\n

Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) \t06\/26\/2009\navg-cpu: %user %nice %system %iowait %steal %idle\n 3.50 0.09 0.51 0.03 0.00 95.86\nDevice: tps Blk_read\/s Blk_wrtn\/s Blk_read Blk_wrtn\nsda 22.04 31.88 512.03 16193351 260102868\nsda1 0.00 0.00 0.00 2166 180\nsda2 22.04 31.87 512.03 16189010 260102688\nsda3 0.00 0.00 0.00 1615 0\n<\/pre>\n<\/p>\n

sar\u2013\u76d1\u89c6\u3001\u6536\u96c6\u548c\u62a5\u544aLinux\u7cfb\u7edf\u6d3b\u52a8<\/p>\n

sar\u547d\u4ee4\u7528\u4e8e\u641c\u96c6\u3001\u62a5\u544a\u548c\u4fdd\u5b58\u7cfb\u7edf\u6d3b\u52a8\u4fe1\u606f\u3002\u8981\u67e5\u770b\u7f51\u8def\u7edf\u8ba1\u4fe1\u606f\uff0c\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n

#sar-nDEV|more<\/p>\n

\u4ece0\u70b9\u5f00\u59cb\u7684\u7f51\u8def\u7edf\u8ba1\u4fe1\u606f:<\/p>\n

#sar-nDEV-f\/var\/log\/sa\/sa24|more<\/p>\n

\u663e\u793a\u5b9e\u65f6\u501f\u52a9\u7387\u4fe1\u606f:<\/p>\n

#sar45<\/p>\n

\u8f93\u51fa\u6837\u4f8b:<\/p>\n

\n

Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) \t\t06\/26\/2009\n06:45:12 PM CPU %user %nice %system %iowait %steal %idle\n06:45:16 PM all 2.00 0.00 0.22 0.00 0.00 97.78\n06:45:20 PM all 2.07 0.00 0.38 0.03 0.00 97.52\n06:45:24 PM all 0.94 0.00 0.28 0.00 0.00 98.78\n06:45:28 PM all 1.56 0.00 0.22 0.00 0.00 98.22\n06:45:32 PM all 3.53 0.00 0.25 0.03 0.00 96.19\nAverage: all 2.02 0.00 0.27 0.01 0.00 97.70\n<\/pre>\n<\/p>\n

mpstat\u2013\u5728Linux\u4e0a\u76d1\u89c6\u591a\u5904\u7406\u5668\u7684\u4f7f\u7528\u60c5\u51b5<\/p>\n

mpstat\u547d\u4ee4\u663e\u793a\u6bcf\u4f4d\u53ef\u7528\u5904\u7406\u5668\u7684\u6d3b\u52a8\uff0c\u5904\u7406\u56680\u662f\u7b2c\u4e00\u4e2a\u3002mpstat-pall\u663e\u793a\u6bcf\u4f4d\u5904\u7406\u5668\u7684\u5e73\u5747CPU\u501f\u52a9\u7387\uff1a<\/p>\n

\n

# mpstat -P ALL\n<\/pre>\n<\/p>\n

\u8f93\u51fa\u6837\u4f8b:<\/p>\n

\n

Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in)\t \t06\/26\/2009\n06:48:11 PM CPU %user %nice %sys %iowait %irq %soft %steal %idle intr\/s\n06:48:11 PM all 3.50 0.09 0.34 0.03 0.01 0.17 0.00 95.86 1218.04\n06:48:11 PM 0 3.44 0.08 0.31 0.02 0.00 0.12 0.00 96.04 1000.31\n06:48:11 PM 1 3.10 0.08 0.32 0.09 0.02 0.11 0.00 96.28 34.93\n06:48:11 PM 2 4.16 0.11 0.36 0.02 0.00 0.11 0.00 95.25 0.00\n06:48:11 PM 3 3.77 0.11 0.38 0.03 0.01 0.24 0.00 95.46 44.80\n06:48:11 PM 4 2.96 0.07 0.29 0.04 0.02 0.10 0.00 96.52 25.91\n06:48:11 PM 5 3.26 0.08 0.28 0.03 0.01 0.10 0.00 96.23 14.98\n06:48:11 PM 6 4.00 0.10 0.34 0.01 0.00 0.13 0.00 95.42 3.75\n06:48:11 PM 7 3.30 0.11 0.39 0.03 0.01 0.46 0.00 95.69 76.89\n<\/pre>\n<\/p>\n

pmap\u2013\u5728Linux\u4e0a\u76d1\u63a7\u8fdb\u7a0b\u663e\u5b58\u4f7f\u7528\u60c5\u51b5<\/p>\n

pmap\u547d\u4ee4\u62a5\u544a\u8fdb\u7a0b\u7684\u663e\u5b58\u6620\u5c04\u3002\u4f7f\u7528\u6b64\u547d\u4ee4\u67e5\u627e\u663e\u5b58\u6027\u80fd\u56f0\u5c40\u7684\u8bf1\u56e0\u3002<\/p>\n

#pmap-dPID<\/p>\n

\u8981\u663e\u793aPID47394\u7684\u8fdb\u7a0b\u663e\u5b58\u4fe1\u606f\uff0c\u8bf7\u8f93\u5165\uff1a<\/p>\n

#pmap-d47394<\/p>\n

\u8f93\u51fa\u6837\u4f8b:<\/p>\n

\n

47394: \/usr\/bin\/php-cgi\nAddress Kbytes Mode Offset Device Mapping\n0000000000400000 2584 r-x-- 0000000000000000 008:00002 php-cgi\n0000000000886000 140 rw--- 0000000000286000 008:00002 php-cgi\n00000000008a9000 52 rw--- 00000000008a9000 000:00000 [ anon ]\n0000000000aa8000 76 rw--- 00000000002a8000 008:00002 php-cgi\n000000000f678000 1980 rw--- 000000000f678000 000:00000 [ anon ]\n000000314a600000 112 r-x-- 0000000000000000 008:00002 ld-2.5.so\n000000314a81b000 4 r---- 000000000001b000 008:00002 ld-2.5.so\n000000314a81c000 4 rw--- 000000000001c000 008:00002 ld-2.5.so\n000000314aa00000 1328 r-x-- 0000000000000000 008:00002 libc-2.5.so\n000000314ab4c000 2048 ----- 000000000014c000 008:00002 libc-2.5.so\n.....\n......\n..\n00002af8d48fd000 4 rw--- 0000000000006000 008:00002 xsl.so\n00002af8d490c000 40 r-x-- 0000000000000000 008:00002 libnss_files-2.5.so\n00002af8d4916000 2044 ----- 000000000000a000 008:00002 libnss_files-2.5.so\n00002af8d4b15000 4 r---- 0000000000009000 008:00002 libnss_files-2.5.so\n00002af8d4b16000 4 rw--- 000000000000a000 008:00002 libnss_files-2.5.so\n00002af8d4b17000 768000 rw-s- 0000000000000000 000:00009 zero (deleted)\n00007fffc95fe000 84 rw--- 00007ffffffea000 000:00000 [ stack ]\nffffffffff600000 8192 ----- 0000000000000000 000:00000 [ anon ]\nmapped: 933712K writeable\/private: 4304K shared: 768000K\n<\/pre>\n<\/p>\n

\u6700\u540e\u4e00\u884c\u5341\u5206\u91cd\u8981<\/p>\n

netstat\u2013Linux\u7f51\u8def\u548c\u7edf\u8ba1\u76d1\u63a7\u5de5\u5177<\/p>\n

netstat\u547d\u4ee4\u663e\u793a\u7f51\u8def\u8054\u63a5\u3001\u8def\u7531\u8868\u3001\u63a5\u53e3\u7edf\u8ba1\u4fe1\u606f\u3001\u4f2a\u88c5\u8054\u63a5\u548c\u591a\u64ad\u6210\u5458\u8eab\u5206\u3002<\/p>\n

#netstat-tulpn<\/p>\n

#netstat-nat<\/p>\n

ss\u2013\u7f51\u7edc\u7edf\u8ba1<\/p>\n

ss\u547d\u4ee4\u7528\u4e8e\u5b58\u8d2e\u5957\u63a5\u5b57\u7edf\u8ba1\u4fe1\u606f\u3002\u5b83\u5bb9\u8bb8\u663e\u793a\u7c7b\u4f3c\u4e8enetstat\u7684\u4fe1\u606f\u3002\u8bf7\u6ce8\u610f\uff0cnetstat\u57fa\u672c\u4e0a\u662f\u8fc7\u65f6\u7684\u3002\u56e0\u800c\u987b\u8981\u4f7f\u7528ss\u547d\u4ee4\u3002\u8981\u5728Linux\u4e0aSS\u6240\u6709TCP\u548cUDP\u5957\u63a5\u5b57linux\u67e5\u770b\u7f51\u7edc\u5e26\u5bbd<\/a><\/strong>\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a<\/p>\n

#ss-t-a<\/p>\n

\u6216\u5219<\/p>\n

#ss-u-a<\/p>\n

\u663e\u793a\u5177\u6709\u8fdb\u7a0bselinux\u5b89\u5168\u4e0a\u4e0b\u6587\u7684\u6240\u6709TCP\u5957\u63a5\u5b57\uff1a<\/p>\n

#ss-t-a-Z<\/p>\n

iptraf\u2013\u83b7\u53d6Linux\u4e0a\u7684\u5b9e\u65f6\u7f51\u8def\u7edf\u8ba1\u4fe1\u606f<\/p>\n

iptraf\u547d\u4ee4\u662f\u4ea4\u4e92\u5f0f\u5f69\u8272IPLAN\u76d1\u89c6\u5668\u3002\u5b83\u662f\u4e00\u4e2a\u57fa\u4e8encurses\u7684IPLAN\u76d1\u89c6\u5668\uff0c\u53ef\u4ee5\u751f\u6210\u5404\u7c7b\u7f51\u8def\u7edf\u8ba1\u4fe1\u606f\uff0c\u5305\u62ecTCP\u4fe1\u606f\u3001UDP\u8ba1\u6570\u3001ICMP\u548cOSPF\u4fe1\u606f\u3001\u4ee5\u592a\u7f51\u8d1f\u8f7d\u4fe1\u606f\u3001\u8282\u70b9\u72b6\u6001\u3001IP\u6821\u51c6\u548c\u9519\u8bef\u7b49\u3002\u5b83\u53ef\u4ee5\u4ee5\u4fbf\u4e8e\u9605\u8bfb\u7684\u683c\u5f0f\u63d0\u4f9b\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/p>\n

\u56fe2.iptraf\u901a\u5e38\u63d2\u53e3\u7edf\u8ba1<\/p>\n

\u56fe3\u901a\u8fc7TCP\u8054\u63a5\u7edf\u8ba1\u7f51\u8def\u4f20\u8f93\u60c5\u51b5<\/p>\n

tcpdump\u2013\u8be6\u7ec6\u7684\u7f51\u8def\u6d41\u91cf\u5256\u6790<\/p>\n

tcpdump\u547d\u4ee4\u662f\u5728\u7f51\u8def\u4e0a\u5b58\u8d2e\u6570\u636e\u7684\u7b80\u5355\u547d\u4ee4\u3002\u5e76\u4e14\uff0c\u60a8\u987b\u8981\u633a\u597d\u5730\u7406\u89e3TCP\/IP\u5408\u540c\u80fd\u591f\u4f7f\u7528\u6b64\u5de5\u5177\u3002\u6bd4\u5982linux\u5e38\u7528\u547d\u4ee4\uff0c\u8981\u663e\u793a\u6709\u5173DNS\u7684\u6d41\u91cf\u4fe1\u606f\uff0c\u8bf7\u8f93\u5165\uff1a<\/p>\n

#tcpdump-ieth1'udpport53'<\/p>\n

\u67e5\u770b\u8fdb\u51fa\u7aef\u53e380\u7684\u6240\u6709IPv4HTTP\u6570\u636e\u5305\uff0c\u5373\u4ec5\u590d\u5370\u5305\u542b\u6570\u636e\u7684\u6570\u636e\u5305\uff0c\u800c\u4e0d\u662fsyn\u548cfin\u6570\u636e\u5305\u548cack-only\u6570\u636e\u5305\uff0c\u8f93\u5165\uff1a<\/p>\n

#tcpdump'tcpport80and(((ip[2:2]-((ip[0]&0xf)2))!=0)'<\/p>\n

\u663e\u793a\u5230202.54.1.5\u7684\u6240\u6709ftp\u4f1a\u8bdd\uff0c\u8f93\u5165\uff1a<\/p>\n

#tcpdump-ieth1'dst202.54.1.5and(port21or20'<\/p>\n

\u663e\u793a\u5230192.168.1.5\u7684\u6240\u6709HTTP\u4f1a\u8bdd:<\/p>\n

#tcpdump-nieth0'dst192.168.1.5andtcpandporthttp'<\/p>\n

\u4f7f\u7528wireshark\u67e5\u770b\u6709\u5173\u6587\u4ef6\u7684\u8be6\u5c3d\u4fe1\u606f\uff0c\u8f93\u5165\uff1a<\/p>\n

#tcpdump-n-ieth1-s0-woutput.txtsrcordstport80<\/p>\n

iotop\u2013LinuxI\/O\u76d1\u63a7<\/p>\n

iotop\u547d\u4ee4\u76d1\u89c6\u5668I\/O\u501f\u52a9\u7387\u4fe1\u606f\uff0c\u57fa\u4e8eLinux\u5185\u6838\u3002\u5b83\u663e\u793a\u4e86\u6309\u670d\u52a1\u5668\u4e0a\u7684\u8fdb\u7a0b\u6216\u7ebf\u7a0b\u6392\u5e8f\u7684\u5f53\u524dI\/O\u4f7f\u7528\u60c5\u51b5\u8868\u3002<\/p>\n

$sudoiotop<\/p>\n

\u8f93\u51fa\u6837\u4f8b:<\/p>\n

linux\u67e5\u770b\u7f51\u7edc\u5e26\u5bbd_linux\u5e26\u5bbd\u67e5\u770b_linux\u67e5\u770b\u5bbd\u5e26\u7684\u547d\u4ee4<\/p>\n

htop\u2013interactiveprocessviewer<\/p>\n

htop\u662f\u4e00\u4e2a\u57fa\u4e8encurses\u7684\u514d\u8d39\u5f00\u6e90Linux\u8fdb\u7a0b\u67e5\u770b\u5668\u3002\u5b83\u6bd4top\u547d\u4ee4\u8981\u597d\u7528\u5f97\u591a\u3002\u5341\u5206\u5bb9\u6613\u4f7f\u7528\uff0c\u60a8\u53ef\u4ee5\u5728\u4e0d\u4f7f\u7528PIDS\u6216\u79bb\u5f00htop\u63d2\u53e3\u7684\u60c5\u51b5\u4e0b\u9009\u62e9\u8981\u4e2d\u6b62\u6216\u91cd\u65b0\u51bb\u7ed3\u7684\u8fdb\u7a0b\u3002<\/p>\n

$htop<\/p>\n

\u8f93\u51fa\u6837\u4f8b:<\/p>\n

atop\u2013\u9ad8\u7ea7Linux\u7cfb\u7edf\u548c\u8fdb\u7a0b\u76d1\u89c6\u5668<\/p>\n

atop\u662f\u4e00\u4e2a\u5341\u5206\u5f3a\u608d\u7684\u4ea4\u4e92\u5f0f\u76d1\u89c6\u5668\uff0c\u53ef\u4ee5\u67e5\u770bLinux\u7cfb\u7edf\u4e0a\u7684\u8d1f\u8f7d\u3002\u5b83\u4ece\u6027\u80fd\u89d2\u5ea6\u663e\u793a\u6700\u5173\u952e\u7684\u786c\u4ef6\u8d44\u6e90\u3002\u60a8\u53ef\u4ee5\u5feb\u901f\u89c1\u5230CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u548c\u7f51\u8def\u6027\u80fd\u3002\u5b83\u663e\u793a\u4e86\u5728\u8fdb\u7a0b\u7ea7\u522b\u4e0a\uff0c\u4ec0\u4e48\u8fdb\u7a0b\u8d1f\u8d23\u4e0eCPU\u548c\u663e\u5b58\u8d1f\u8f7d\u76f8\u5173\u7684\u6307\u793a\u8d1f\u8f7d\u3002<\/p>\n

$atop<\/p>\n

linux\u67e5\u770b\u7f51\u7edc\u5e26\u5bbd_linux\u5e26\u5bbd\u67e5\u770b_linux\u67e5\u770b\u5bbd\u5e26\u7684\u547d\u4ee4<\/p>\n

linux\u5e26\u5bbd\u67e5\u770b_linux\u67e5\u770b\u5bbd\u5e26\u7684\u547d\u4ee4_linux\u67e5\u770b\u7f51\u7edc\u5e26\u5bbd<\/p>\n

acandlastcomm<\/p>\n

\u60a8\u5fc5\u987b\u76d1\u89c6Linux\u670d\u52a1\u5668\u4e0a\u7684\u8fdb\u7a0b\u548c\u767b\u9646\u6d3b\u52a8\u3002psacct\u6216acct\u978b\u5b50\u542b\u591a\u4e2a\u7528\u4e8e\u76d1\u63a7\u6d41\u7a0b\u6d3b\u52a8\u7684\u5b9e\u7528\u7a0b\u5e8flinux \u53d1\u90ae\u4ef6\uff0c\u5305\u62ec\uff1a<\/p>\n

ac\u547d\u4ee4\uff1a\u663e\u793a\u6709\u5173\u7528\u6237\u8054\u63a5\u65f6\u95f4\u7684\u7edf\u8ba1\u4fe1\u606flastcomm\u547d\u4ee4\uff1a\u663e\u793a\u6709\u5173\u5148\u524d\u6267\u884c\u7684\u547d\u4ee4\u7684\u4fe1\u606faccton\u547d\u4ee4\uff1a\u6253\u5f00\u6216\u5173\u6389\u8fdb\u7a0b\u8bb0\u8d26sa\u547d\u4ee4\uff1a\u6c47\u603b\u4f1a\u8ba1\u4fe1\u606fmonit\u2013\u8fc7\u7a0b\u76d1\u7763<\/p>\n

monit\u662f\u4e00\u4e2a\u514d\u8d39\u5f00\u6e90\u7684\u8f6f\u4ef6\uff0c\u5145\u5f53\u8fdb\u7a0b\u7684\u770b\u95e8\u72d7\u3002\u5b83\u5177\u6709\u91cd\u65b0\u542f\u52a8\u5931\u8d25\u670d\u52a1\u7684\u80fd\u529b\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528systemd\u3001daemontools\u6216\u4efb\u4f55\u5176\u4ed6\u7c7b\u4f3c\u7684\u5de5\u5177\u6765\u5b9e\u73b0\u76f8\u540c\u7684\u76ee\u7684\u3002<\/p>\n

nethogs-\u627e\u51fa\u5728Linux\u4e0a\u5360\u7528\u5e26\u5bbd\u6700\u591a\u7684pids<\/p>\n

NetHogs\u662f\u4e00\u79cd\u5927\u578b\u4f46\u4fbf\u6377\u7684\u7f51\u8deftop\u5de5\u5177\u3002\u5b83\u6309\u8fdb\u7a0b\u540d\uff08\u5982firefox\u3001wget\u7b49\uff09\u5bf9\u5e26\u5bbd\u8fdb\u884c\u5206\u7ec4\u3002\u5047\u5982\u7f51\u8def\u6d41\u91cf\u5ffd\u7136\u7206\u53d1\uff0c\u542f\u52a8\u7f51\u7ba1\u3002\u60a8\u5c06\u542c\u5230\u90a3\u4e2aPID\u9020\u6210\u5e26\u5bbd\u98d9\u5347\u3002<\/p>\n

$sudonethogs<\/p>\n

linux\u5e26\u5bbd\u67e5\u770b_linux\u67e5\u770b\u7f51\u7edc\u5e26\u5bbd_linux\u67e5\u770b\u5bbd\u5e26\u7684\u547d\u4ee4<\/p>\n

iftop\u2013\u6309\u4e3b\u673a\u663e\u793a\u63d2\u53e3\u4e0a\u7684\u5e26\u5bbd\u4f7f\u7528\u60c5\u51b5<\/p>\n

iftop\u547d\u4ee4\u7a83\u542c\u7ed9\u5b9a\u63d2\u53e3\u540d\uff08\u5982eth0\uff09\u4e0a\u7684\u7f51\u8def\u6d41\u91cf\u3002\u5b83\u6309\u4e3b\u673a\u5bf9\u663e\u793a\u5f53\u524d\u5e26\u5bbd\u4f7f\u7528\u60c5\u51b5\u7684\u5217\u8868\u3002<\/p>\n

$sudoiftop<\/p>\n

vnstat\u2013\u57fa\u4e8e\u63a7\u5236\u53f0\u7684\u7f51\u8def\u6d41\u91cf\u76d1\u89c6\u5668<\/p>\n

vnstat\u662f\u4e00\u4e2a\u4fbf\u4e8e\u4f7f\u7528\u7684\u57fa\u4e8e\u63a7\u5236\u53f0\u7684Linux\u7f51\u8def\u6d41\u91cf\u76d1\u89c6\u5668\u3002\u5b83\u4e3a\u6240\u9009\u63d2\u53e3\u4fdd\u7559\u6bcf\u5c0f\u65f6\u3001\u6bcf\u5929\u548c\u6bcf\u6708\u7f51\u8def\u6d41\u91cf\u7684\u65e5\u5fd7\u3002<\/p>\n

$vnstat<\/p>\n

nmon\u2013Linux\u7cfb\u7edf\u7ba1\u7406\u5458\u3001\u8c03\u4f18\u8005\u3001\u57fa\u51c6\u6d4b\u8bd5\u5de5\u5177<\/p>\n

nmon\u662flinux\u7cfb\u7edf\u7ba1\u7406\u5458\u7684\u7ec8\u6781\u5de5\u5177\uff0c\u5b83\u4e3b\u8981\u7528\u4e8e\u6027\u80fd\u8c03\u4f18\u3002\u5b83\u53ef\u4ee5\u4ece\u63a7\u5236\u53f0\u663e\u793aCPU\u3001\u5185\u5b58\u3001\u7f51\u7edc\u3001\u78c1\u76d8\u3001\u6587\u4ef6\u7cfb\u7edf\u3001NFS\u3001\u9876\u7ea7\u8fdb\u7a0b\u8d44\u6e90\u548c\u5206\u533a\u4fe1\u606f\u3002<\/p>\n

$nmon<\/p>\n

glances\u2013\u7ed9Linux\u7cfb\u7edf\u6309\u4e00\u4e2a\u8033\u6735<\/p>\n

glances\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u8de8\u5e73\u53f0\u76d1\u63a7\u5de5\u5177\u3002\u5b83\u5728\u5c0f\u5c4f\u5e55\u4e0a\u63d0\u4f9b\u5927\u91cf\u4fe1\u606f\u3002\u5b83\u8fd8\u53ef\u4ee5\u5728\u987e\u5ba2\u673a\/\u670d\u52a1\u5668\u6a21\u5f0f\u4e0b\u5de5\u4f5c\u3002<\/p>\n

$glances<\/p>\n

strace\u2013\u5728Linux\u4e0a\u76d1\u89c6\u7cfb\u7edf\u8c03\u7528<\/p>\n

\u8981\u8ddf\u8e2aLinux\u7cfb\u7edf\u8c03\u7528\u548c\u8baf\u53f7\u5417\uff1f\u5c1d\u8bd5strace\u547d\u4ee4\u3002\u8fd9\u5bf9\u4e8e\u8c03\u8bd5Web\u670d\u52a1\u5668\u548c\u5176\u4ed6\u670d\u52a1\u5668\u95ee\u9898\u5f88\u6709\u7528\u3002\u4e86\u89e3\u600e\u6837\u4f7f\u7528\u8ddf\u8e2a\u6d41\u7a0b\u5e76\u4e86\u89e3\u5b83\u5728\u505a\u54ea\u4e9b\u3002<\/p>\n

\/proc\/\u6587\u4ef6\u7cfb\u7edf\u2013\u5404\u79cdLinux\u5185\u6838\u7edf\u8ba1\u4fe1\u606f<\/p>\n

\/procfilesystem\u63d0\u4f9b\u6709\u5173\u5404\u7c7b\u786c\u4ef6\u8bbe\u5907\u548c\u5176\u4ed6Linux\u5185\u6838\u4fe1\u606f\u7684\u8be6\u5c3d\u4fe1\u606f\u3002\u6709\u5173\u66f4\u591a\u8be6\u5c3d\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605Linux\u5185\u6838\/proc\u6587\u6863\u3002\u5e38\u89c1\/\u8fc7\u7a0b\u793a\u4f8b\uff1a<\/p>\n

#cat\/proc\/cpuinfo<\/p>\n

#cat\/proc\/meminfo<\/p>\n

#cat\/proc\/zoneinfo<\/p>\n

#cat\/proc\/mounts<\/p>\n

Nagios\u2013Linux\u670d\u52a1\u5668\/\u7f51\u8def\u76d1\u63a7<\/p>\n

Nagios\u662f\u4e00\u6b3e\u6d41\u884c\u7684\u5f00\u6e90\u8ba1\u7b97\u673a\u7cfb\u7edf\u548c\u7f51\u8def\u76d1\u63a7\u5e94\u7528\u8f6f\u4ef6\u3002\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u76d1\u89c6\u6240\u6709\u4e3b\u673a\u3001\u7f51\u7edc\u8bbe\u5907\u548c\u670d\u52a1\u3002\u5b83\u53ef\u4ee5\u5728\u51fa\u73b0\u95ee\u9898\u65f6\u53d1\u51fa\u8b66\u62a5linux\u67e5\u770b\u7f51\u7edc\u5e26\u5bbd<\/strong>\uff0c\u5728\u60c5\u51b5\u597d\u8f6c\u65f6\u518d\u5ea6\u53d1\u51fa\u8b66\u62a5\u3002\u540a\u6247\u662f\u201c\u5168\u624b\u52a8Nagios\u201d\u3002Fan\u7684\u76ee\u6807\u662f\u63d0\u4f9bNagios\u5b89\u88c5\uff0c\u5305\u62ecNagios\u793e\u533a\u63d0\u4f9b\u7684\u5927\u591a\u6570\u5de5\u5177\u3002Fan\u4ee5\u6807\u51c6ISO\u683c\u5f0f\u63d0\u4f9b\u4e86\u4e00\u4e2acdrom\u6620\u50cf\uff0c\u4f7f\u5b89\u88c5Nagios\u670d\u52a1\u5668\u663e\u5f97\u5bb9\u6613\u3002\u636e\u6089\uff0c\u4e3a\u4e86\u6539\u5584Nagios\u5468\u56f4\u7684\u7528\u6237\u4f53\u9a8c\uff0c\u53d1\u884c\u7248\u4e2d\u8fd8\u5305\u62ec\u4e86\u5927\u91cf\u5de5\u5177\u3002<\/p>\n

Cacti\u2013\u57fa\u4e8eWeb\u7684Linux\u76d1\u63a7\u5de5\u5177<\/p>\n

Cacti\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u7f51\u8def\u7ed8\u56fe\u89e3\u51b3\u65b9\u6848\uff0c\u501f\u4ee5\u501f\u52a9rrdtool\u7684\u6570\u636e\u50a8\u5b58\u548c\u7ed8\u56fe\u529f\u80fd\u3002Cacti\u63d0\u4f9b\u4e86\u5feb\u901f\u8f6c\u50a8\u3001\u9ad8\u7ea7\u56fe\u5f62\u6a21\u677f\u3001\u591a\u79cd\u6570\u636e\u91c7\u96c6\u65b9\u5f0f\u548c\u5f00\u7bb1\u5373\u7528\u7684\u7528\u6237\u7ba1\u7406\u529f\u80fd\u3002\u6240\u6709\u90a3\u4e9b\u90fd\u88ab\u5305\u88c5\u5728\u4e00\u4e2a\u76f4\u89c2\u3001\u6613\u4e8e\u4f7f\u7528\u7684\u754c\u9762\u4e2d\uff0c\u8fd9\u5bf9\u4e8e\u5c40\u57df\u7f51\u5927\u5c0f\u7684\u5b89\u88c5\uff08\u5305\u62ec\u5177\u6709\u6570\u767e\u4e2a\u8bbe\u5907\u7684\u590d\u6742\u7f51\u8def\uff09\u662f\u6709\u610f\u4e49\u7684\u3002\u5b83\u53ef\u4ee5\u63d0\u4f9b\u5173\u4e8e\u7f51\u8def\u3001CPU\u3001\u5185\u5b58\u3001\u767b\u5f55\u7528\u6237\u3001Apache\u3001DNS\u670d\u52a1\u5668\u7b49\u7684\u6570\u636e\u3002\u8bf7\u53c2\u9605centos\/rhel\u4e0b\u7684\u600e\u4e48\u5b89\u88c5\u548c\u914d\u7f6ecacti\u7f51\u8def\u7ed8\u56fe\u5de5\u5177\u3002<\/p>\n

KDE\u7cfb\u7edf\u5b88\u536b\u2013\u5b9e\u65f6Linux\u7cfb\u7edf\u62a5\u544a\u548c\u7ed8\u56fe<\/p>\n

ksysguard\u662f\u4e00\u4e2a\u7528\u4e8eKDE\u684c\u9762\u7684\u7f51\u8def\u5316\u7684\u4efb\u52a1\u548c\u7cfb\u7edf\u76d1\u63a7\u5e94\u7528\u7a0b\u5e8f\u3002\u8fd9\u4e2a\u5de5\u5177\u53ef\u4ee5\u5728ssh\u4f1a\u8bdd\u4e0a\u8fd0\u884c\u3002\u5b83\u63d0\u4f9b\u4e86\u8bb8\u591a\u529f\u80fd\uff0c\u6bd4\u5982\u987e\u5ba2\u7aef\/\u670d\u52a1\u5668\u4f53\u7cfb\u7ed3\u6784\uff0c\u53ef\u4ee5\u76d1\u89c6\u672c\u5730\u548c\u8fdc\u7a0b\u4e3b\u673a\u3002\u56fe\u5f62\u540e\u7aef\u4f7f\u7528\u6240\u8c13\u7684\u4f20\u611f\u6765\u68c0\u7d22\u5b83\u663e\u793a\u7684\u4fe1\u606f\u3002\u4f20\u611f\u53ef\u4ee5\u8fd4\u56de\u7b80\u5355\u7684\u503c\u6216\u66f4\u590d\u6742\u7684\u4fe1\u606f\uff0c\u5982\u8868\u3002\u5bf9\u4e8e\u6bcf\u79cd\u7c7b\u578b\u7684\u4fe1\u606f\uff0c\u63d0\u4f9b\u4e00\u4e2a\u6216\u591a\u4e2a\u663e\u793a\u5668\u3002\u5728\u5de5\u4f5c\u8868\u4e2d\u7ec4\u7ec7\u663e\u793a\uff0c\u8fd9\u79cd\u5de5\u4f5c\u8868\u53ef\u4ee5\u4e92\u76f8\u72ec\u7acb\u5730\u4fdd\u5b58\u548c\u52a0\u8f7d\u3002\u56e0\u800c\uff0cksysguard\u9664\u4e86\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4efb\u52a1\u7ba1\u7406\u5668\uff0c\u5e76\u4e14\u662f\u4e00\u4e2a\u5341\u5206\u5f3a\u608d\u7684\u5de5\u5177\u6765\u63a7\u5236\u5c0f\u578b\u670d\u52a1\u5668\u573a\u3002<\/p>\n

linux\u5e26\u5bbd\u67e5\u770b_linux\u67e5\u770b\u7f51\u7edc\u5e26\u5bbd_linux\u67e5\u770b\u5bbd\u5e26\u7684\u547d\u4ee4<\/p>\n

\u56feKDE\u7cfb\u7edf\u76d1\u63a7\u8f6f\u4ef6<\/p>\n

GnomeLinux\u7cfb\u7edf\u76d1\u63a7<\/p>\n

\u7cfb\u7edf\u76d1\u89c6\u5668\u5e94\u7528\u7a0b\u5e8f\u4f7f\u60a8\u8fd8\u80fd\u663e\u793a\u57fa\u672c\u7684\u7cfb\u7edf\u4fe1\u606f\u548c\u76d1\u89c6\u7cfb\u7edf\u8fdb\u7a0b\u3001\u7cfb\u7edf\u8d44\u6e90\u7684\u4f7f\u7528\u60c5\u51b5\u548c\u6587\u4ef6\u7cfb\u7edf\u60c5\u51b5\u3002\u8fd8\u53ef\u4ee5\u4f7f\u7528\u7cfb\u7edf\u76d1\u89c6\u5668\u66f4\u6539\u7cfb\u7edf\u7684\u884c\u4e3a\u3002\u4f3c\u4e4e\u4e0d\u5982KDE\u7cfb\u7edf\u4fdd\u62a4\u529f\u80fd\u5f3a\u608d\uff0c\u4f46\u5b83\u63d0\u4f9b\u4e86\u5bf9\u65b0\u7528\u6237\u6709\u7528\u7684\u57fa\u672c\u4fe1\u606f\u3002<\/p>\n

linux\u67e5\u770b\u7f51\u7edc\u5e26\u5bbd_linux\u5e26\u5bbd\u67e5\u770b_linux\u67e5\u770b\u5bbd\u5e26\u7684\u547d\u4ee4<\/p>\n

Gnome\u7cfb\u7edf\u76d1\u63a7\u7a0b\u5e8f<\/p>\n

\u4e0d\u4ec5\u4e0a\u8ff0\u4ecb\u7ecd\u7684\u76d1\u63a7\u5de5\u5177\u5916\uff0c\u8fd8\u6709\u5927\u540d\u9f0e\u9f0e\u7684zabbix\u548cOpen-Falcon\u7b49\u9002\u5b9c\u5728\u5c40\u57df\u7f51\u5185\u8fdb\u884c\u76d1\u63a7\u7684\u5de5\u5177\u3002\u672c\u6587\u5c31\u4e0d\u518d\u8be6\u5c3d\u4ecb\u7ecd\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Linux\u7f51\u7edc\u548c\u7edf\u8ba1\u76d1\u63a7\u5de5\u5177nmon\u662flinux\u7cfb\u7edf\u7ba1\u7406\u5458\u7684\u7ec8\u6781\u5de5\u5177\uff0c\u5b83\u4e3b\u8981\u7528\u4e8e\u6027\u80fd\u8c03\u4f18\u3002Nagios\u662f\u4e00\u6b3e\u6d41\u884c\u7684\u5f00\u6e90\u8ba1\u7b97\u673a\u7cfb\u7edf\u548c\u7f51\u7edc\u76d1\u63a7\u5e94\u7528\u8f6f\u4ef6\u3002ksysguard\u662f\u4e00\u4e2a\u7528\u4e8eKDE\u684c\u9762\u7684\u7f51\u7edc\u5316\u7684\u4efb\u52a1\u548c\u7cfb\u7edf\u76d1\u63a7\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"author":1,"featured_media":287791,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-287790","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/287790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=287790"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/287790\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/287791"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=287790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=287790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=287790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}