{"id":6116,"date":"2019-12-30T22:33:58","date_gmt":"2019-12-30T14:33:58","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=6116"},"modified":"2019-12-31T16:16:28","modified_gmt":"2019-12-31T08:16:28","slug":"glances","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/glances","title":{"rendered":"glances\u547d\u4ee4 – \u9ad8\u5c42\u6b21\u7684\u591a\u5b50\u7cfb\u7edf\u6982\u89c8"},"content":{"rendered":"\n

Linux\u7cfb\u7edf\u81ea\u5e26\u4e86\u5f88\u591a\u7cfb\u7edf\u6027\u80fd\u76d1\u63a7\u5de5\u5177\uff0c\u5982top\uff0cvmstat\uff0ciftop\u7b49\u7b49\uff0c\u8fd8\u6709\u4e00\u6b3e\u76d1\u89c6\u5de5\u5177glances\uff0c\u5b83\u80fd\u628a\u5176\u4ed6\u51e0\u4e2a\u76d1\u63a7\u7684\u6307\u6807\u90fd\u96c6\u4e8e\u4e00\u8eab\u3002Glances\u662f\u4e00\u4e2a\u76f8\u5bf9\u6bd4\u8f83\u65b0\u7684\u7cfb\u7edf\u76d1\u63a7\u5de5\u5177\uff0c\u7528 Python \u7f16\u5199\u7684\uff0c\u4f7f\u7528 psutil \u5e93\u4ece\u7cfb\u7edf\u83b7\u53d6\u4fe1\u606f\u3002\u53ef\u4ee5\u7528\u5b83\u6765\u76d1\u63a7 CPU\u3001\u5e73\u5747\u8d1f\u8f7d\u3001\u5185\u5b58\u3001\u7f51\u7edc\u63a5\u53e3\u3001\u78c1\u76d8 I\/O\uff0c\u6587\u4ef6\u7cfb\u7edf\u7a7a\u95f4\u5229\u7528\u7387\u3001\u6302\u8f7d\u7684\u8bbe\u5907\u3001\u6240\u6709\u6d3b\u52a8\u8fdb\u7a0b\u4ee5\u53ca\u6d88\u8017\u8d44\u6e90\u6700\u591a\u7684\u8fdb\u7a0b\u3002Glances \u6709\u5f88\u591a\u6709\u8da3\u7684\u9009\u9879\u3002\u5b83\u7684\u4e3b\u8981\u7279\u6027\u4e4b\u4e00\u662f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u9600\u503c\uff08careful\u5c0f\u5fc3\u3001warning\u8b66\u544a\u3001critical\u81f4\u547d\uff09\uff0c\u7136\u540e\u5b83\u4f1a\u7528\u4e0d\u540c\u989c\u8272\u663e\u793a\u4fe1\u606f\u4ee5\u8868\u660e\u7cfb\u7edf\u7684\u74f6\u9888\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>glances [\u53c2\u6570] <\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-b<\/td>\u663e\u793a\u7f51\u7edc\u8fde\u63a5\u901f\u5ea6 Byte\/ \u79d2<\/td><\/tr>
-s<\/td>\u8bbe\u7f6e glances \u8fd0\u884c\u6a21\u5f0f\u4e3a\u670d\u52a1\u5668<\/td><\/tr>
-B<\/td>\u7ed1\u5b9a\u670d\u52a1\u5668\u7aef IP \u5730\u5740\u6216\u8005\u4e3b\u673a\u540d\u79f0<\/td><\/tr>
-c<\/td>\u8fde\u63a5 glances \u670d\u52a1\u5668\u7aef<\/td><\/tr>
-t<\/td>\u8bbe\u7f6e\u5c4f\u5e55\u5237\u65b0\u7684\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\u4e3a\u79d2\uff0c\u9ed8\u8ba4\u503c\u4e3a 2 \u79d2\uff0c\u6570\u503c\u8bb8\u53ef\u8303\u56f4\uff1a1~32767<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong> <\/p>\n\n\n\n

192.168.10.10 \u4e3b\u673a\u542f\u52a8 glances \u670d\u52a1\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# glances -s -B 192.168.10.10 &<\/pre>\n\n\n\n

\u4ece\u53e6\u4e00\u53f0\u4e3b\u673a\u67e5\u770b 192.168.10.10 \u4e3b\u673a\u7684\u7cfb\u7edf\u8d1f\u8f7d\u72b6\u6001:<\/p>\n\n\n\n

[root@linuxcool ~]# glances -c 192.168.10.10 <\/pre>\n\n\n\n

\u663e\u793a\u7f51\u7edc\u8fde\u63a5\u901f\u5ea6 Byte\/ \u79d2\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# glances -b<\/pre>\n\n\n\n

\u8bbe\u7f6e\u5c4f\u5e55\u5237\u65b0\u7684\u65f6\u95f4\u95f4\u9694\u4e3a6\u79d2\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# glances -t 6<\/pre>\n","protected":false},"excerpt":{"rendered":"

Linux\u7cfb\u7edf\u81ea\u5e26\u4e86\u5f88\u591a\u7cfb\u7edf\u6027\u80fd\u76d1\u63a7\u5de5\u5177\uff0c\u5982top\uff0cvmstat\uff0ciftop\u7b49\u7b49\uff0c\u8fd8\u6709\u4e00\u6b3e\u76d1\u89c6\u5de5\u5177glance […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6116"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=6116"}],"version-history":[{"count":12,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6116\/revisions"}],"predecessor-version":[{"id":6263,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6116\/revisions\/6263"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=6116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=6116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=6116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}