{"id":288828,"date":"2023-12-11T05:05:00","date_gmt":"2023-12-10T21:05:00","guid":{"rendered":"https:\/\/lrxjmw.cn\/qsxhzlxtsazh.html"},"modified":"2023-12-11T05:05:00","modified_gmt":"2023-12-10T21:05:00","slug":"qsxhzlxtsazh","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/qsxhzlxtsazh.html","title":{"rendered":"\u8f7b\u677e\u5b66\u4f1a\u5728Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eMRTG\uff0c\u76d1\u63a7\u7f51\u7edc\u6d41\u91cf\u4e0d\u518d\u662f\u96be\u9898"},"content":{"rendered":"

\u5728\u7f51\u7edc\u7ba1\u7406\u548c\u76d1\u63a7\u4e2dmrtg linux\u5b89\u88c5<\/strong>\uff0cMRTG\uff08Multi Router Traffic Grapher\uff09\u662f\u4e00\u79cd\u5e38\u7528\u7684\u5de5\u5177\u3002\u5b83\u53ef\u4ee5\u901a\u8fc7\u56fe\u8868\u7684\u65b9\u5f0f\u5c55\u793a\u7f51\u7edc\u8bbe\u5907\u7684\u6d41\u91cf\u4f7f\u7528\u60c5\u51b5linux\u7cfb\u7edf\u5b89\u88c5\u6559\u7a0b\uff0c\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u4e86\u89e3\u7f51\u7edc\u72b6\u51b5\u3002\u4e0b\u9762\u6211\u5c06\u5206\u4eab\u4e00\u79cd\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u5728Linux<\/a>\u7cfb\u7edf<\/a>\u4e0a\u5b89\u88c5MRTG\uff0c\u5e76\u8fdb\u884c\u914d\u7f6e\u548c\u4f7f\u7528\u3002<\/p>\n

1.\u5b89\u88c5MRTG<\/b><\/p>\n

\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5728Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5MRTG\u3002\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4<\/a>\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n

\n

\nsudo apt-get install mrtg\n<\/pre>\n<\/p>\n

2.\u914d\u7f6eSNMP<\/b><\/p>\n

MRTG\u4f9d\u8d56\u4e8eSNMP\uff08Simple Network Management Protocol\uff09\u6765\u83b7\u53d6\u7f51\u7edc\u8bbe\u5907\u7684\u6d41\u91cf\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u5728\u4f7f\u7528MRTG\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6eSNMP\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5SNMP\uff1a<\/p>\n

\n

\nsudo apt-get install snmp snmpd\n<\/pre>\n<\/p>\n

\u7136\u540e\uff0c\u7f16\u8f91SNMP\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nsudo nano \/etc\/snmp\/snmpd.conf\n<\/pre>\n<\/p>\n

\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u627e\u5230\u4ee5\u4e0b\u4e24\u884c\u5e76\u53d6\u6d88\u6ce8\u91ca\uff08\u53bb\u6389\u884c\u9996\u7684“#”\u7b26\u53f7\uff09\uff1a<\/p>\n

\n

\n#  agentAddress  udp:161\n#  rocommunity public default    -V systemonly\n<\/pre>\n<\/p>\n

\u4fdd\u5b58\u5e76\u9000\u51fa\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n

3.\u914d\u7f6eMRTG<\/b><\/p>\n

\u63a5\u4e0b\u6765mrtg linux\u5b89\u88c5<\/strong>\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6eMRTG\u4ee5\u76d1\u63a7\u7279\u5b9a\u7684\u7f51\u7edc\u8bbe\u5907\u3002\u9996\u5148\uff0c\u5728\u7ec8\u7aef\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

\n

\nsudo cfgmaker --global 'WorkDir:\/var\/www\/html\/mrtg'--output \/etc\/mrtg.cfg public@localhost\n<\/pre>\n<\/p>\n

\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3amrtg.cfg\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u5c06\u5de5\u4f5c\u76ee\u5f55\u8bbe\u7f6e\u4e3a\/var\/www\/html\/mrtg\u3002<\/p>\n

\u7136\u540e\uff0c\u6211\u4eec\u9700\u8981\u751f\u6210MRTG\u56fe\u8868\u6240\u9700\u7684HTML\u6587\u4ef6\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nsudo indexmaker --output=\/var\/www\/html\/mrtg\/index.html \/etc\/mrtg.cfg\n<\/pre>\n<\/p>\n

4.\u521b\u5efa\u7f51\u9875\u76ee\u5f55<\/b><\/p>\n

\u4e3a\u4e86\u80fd\u591f\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95eeMRTG\u56fe\u8868\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u7f51\u9875\u76ee\u5f55\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nsudo mkdir \/var\/www\/html\/mrtg\n<\/pre>\n<\/p>\n

5.\u8fd0\u884cMRTG<\/b><\/p>\n

\u73b0\u5728\uff0c\u6211\u4eec\u53ef\u4ee5\u8fd0\u884cMRTG\u6765\u751f\u6210\u56fe\u8868\u4e86\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nsudo env LANG=C\/usr\/bin\/mrtg \/etc\/mrtg.cfg\n<\/pre>\n<\/p>\n

\u8fd9\u5c06\u5f00\u59cb\u751f\u6210\u56fe\u8868\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u5728\/var\/www\/html\/mrtg\u76ee\u5f55\u4e2d\u3002<\/p>\n

termux\u5b89\u88c5Linux_mrtg linux\u5b89\u88c5_\u5b89\u88c5Linux<\/p>\n

6.\u8bbf\u95eeMRTG\u56fe\u8868<\/b><\/p>\n

\u6253\u5f00\u4f60\u7684\u6d4f\u89c8\u5668\uff0c\u8f93\u5165\u4ee5\u4e0b\u5730\u5740\u6765\u8bbf\u95eeMRTG\u56fe\u8868\uff1a<\/p>\n

\n

\n<\/pre>\n<\/p>\n

\u4f60\u5c06\u770b\u5230\u4e00\u7cfb\u5217\u56fe\u8868linux deepin\uff0c\u5c55\u793a\u4e86\u7f51\u7edc\u8bbe\u5907\u7684\u6d41\u91cf\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n

7.\u81ea\u5b9a\u4e49MRTG\u914d\u7f6e<\/b><\/p>\n

\u5982\u679c\u4f60\u60f3\u81ea\u5b9a\u4e49MRTG\u7684\u914d\u7f6e\uff0c\u53ef\u4ee5\u7f16\u8f91\/etc\/mrtg.cfg\u6587\u4ef6\u3002\u4f60\u53ef\u4ee5\u6dfb\u52a0\u66f4\u591a\u7684\u8bbe\u5907\u3001\u8c03\u6574\u56fe\u8868\u6837\u5f0f\u7b49\u3002<\/p>\n

8.\u5b9a\u65f6\u66f4\u65b0\u56fe\u8868<\/b><\/p>\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cMRTG\u6bcf5\u5206\u949f\u66f4\u65b0\u4e00\u6b21\u56fe\u8868\u3002\u5982\u679c\u4f60\u5e0c\u671b\u8c03\u6574\u66f4\u65b0\u9891\u7387\uff0c\u53ef\u4ee5\u7f16\u8f91\/etc\/crontab\u6587\u4ef6\u3002<\/p>\n

9. MRTG\u7684\u5176\u4ed6\u529f\u80fd<\/b><\/p>\n

\u9664\u4e86\u76d1\u63a7\u7f51\u7edc\u8bbe\u5907\u7684\u6d41\u91cf\u4f7f\u7528\u60c5\u51b5\u5916\uff0cMRTG\u8fd8\u6709\u5176\u4ed6\u5f88\u591a\u6709\u7528\u7684\u529f\u80fd\u3002\u4f60\u53ef\u4ee5\u8fdb\u4e00\u6b65\u4e86\u89e3MRTG\u7684\u6587\u6863\u548c\u6559\u7a0b\uff0c\u4ee5\u53d1\u6398\u66f4\u591a\u53ef\u80fd\u6027\u3002<\/p>\n

10.\u603b\u7ed3<\/b><\/p>\n

\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u6211\u4eec\u5b66\u4e60\u4e86\u5982\u4f55\u5728Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5\u3001\u914d\u7f6e\u548c\u4f7f\u7528MRTG\u6765\u76d1\u63a7\u7f51\u7edc\u8bbe\u5907\u7684\u6d41\u91cf\u4f7f\u7528\u60c5\u51b5\u3002MRTG\u662f\u4e00\u4e2a\u5f3a\u5927\u800c\u7b80\u5355\u7684\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u4e86\u89e3\u548c\u7ba1\u7406\u6211\u4eec\u7684\u7f51\u7edc\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5728Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5MRTG\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6eMRTG\u4ee5\u76d1\u63a7\u7279\u5b9a\u7684\u7f51\u7edc\u8bbe\u5907\u3002\u9664\u4e86\u76d1\u63a7\u7f51\u7edc\u8bbe\u5907\u7684\u6d41\u91cf\u4f7f\u7528\u60c5\u51b5\u5916\uff0cMRTG\u8fd8\u6709\u5176\u4ed6\u5f88\u591a\u6709\u7528\u7684\u529f\u80fd\u3002\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u6211\u4eec\u5b66\u4e60\u4e86\u5982\u4f55\u5728Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5\u3001\u914d\u7f6e\u548c\u4f7f\u7528MRTG\u6765\u76d1\u63a7\u7f51\u7edc\u8bbe\u5907\u7684\u6d41\u91cf\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n","protected":false},"author":1,"featured_media":288829,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-288828","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\/288828","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=288828"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/288828\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/288829"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=288828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=288828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=288828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}