{"id":21401,"date":"2022-10-29T09:02:10","date_gmt":"2022-10-29T01:02:10","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=21401"},"modified":"2022-10-29T09:02:12","modified_gmt":"2022-10-29T01:02:12","slug":"snmp-update","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/snmp-update.html","title":{"rendered":"CentOS\u4e0bSNMP\u7684\u5b89\u88c5\u4e0e\u4f7f\u7528"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u7b80\u5355\u7f51\u7edc\u7ba1\u7406\u534f\u8bae\uff08SNMP\uff09\uff0c\u7531\u4e00\u7ec4\u7f51\u7edc\u7ba1\u7406\u7684\u6807\u51c6\u7ec4\u6210\uff0c\u5305\u542b\u4e00\u4e2a\u5e94\u7528\u5c42\u534f\u8bae\uff08application layer protocol\uff09\u3001\u6570\u636e\u5e93\u6a21\u578b\uff08database schema\uff09\u548c\u4e00\u7ec4\u8d44\u6e90\u5bf9\u8c61\u3002\u8be5\u534f\u8bae\u80fd\u591f\u652f\u6301\u7f51\u7edc\u7ba1\u7406\u7cfb\u7edf\uff0c\u7528\u4ee5\u76d1\u6d4b\u8fde\u63a5\u5230\u7f51\u7edc\u4e0a\u7684\u8bbe\u5907\u662f\u5426\u6709\u4efb\u4f55\u5f15\u8d77\u7ba1\u7406\u4e0a\u5173\u6ce8\u7684\u60c5\u51b5\u3002\u8be5\u534f\u8bae\u662f\u4e92\u8054\u7f51\u5de5\u7a0b\u5de5\u4f5c\u5c0f\u7ec4\uff08IETF\uff0cInternet Engineering Task Force\uff09\u5b9a\u4e49\u7684internet\u534f\u8bae\u7c07\u7684\u4e00\u90e8\u5206\u3002SNMP\u7684\u76ee\u6807\u662f\u7ba1\u7406\u4e92\u8054\u7f51Internet\u4e0a\u4f17\u591a\u5382\u5bb6\u751f\u4ea7\u7684\u8f6f\u786c\u4ef6\u5e73\u53f0\uff0c\u56e0\u6b64SNMP\u53d7Internet\u6807\u51c6\u7f51\u7edc\u7ba1\u7406\u6846\u67b6\u7684\u5f71\u54cd\u4e5f\u5f88\u5927\u3002SNMP\u5df2\u7ecf\u51fa\u5230\u7b2c\u4e09\u4e2a\u7248\u672c\u7684\u534f\u8bae\uff0c\u5176\u529f\u80fd\u8f83\u4ee5\u524d\u5df2\u7ecf\u5927\u5927\u5730\u52a0\u5f3a\u548c\u6539\u8fdb\u4e86\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
1.\u786e\u4fddLinux\u4e3b\u673a\u5df2\u7ecf\u5b89\u88c5\u4e86snmp\u670d\u52a1<\/strong><\/div>\n
# rpm -qa |grep snmp\r\nnet-snmp-5.5-49.el6.i686\r\nnet-snmp-libs-5.5-49.el6.i686\r\nphp-snmp-5.3.3-27.el6_5.i686<\/pre>\n

\"CentOS-Snmp-01\"
\n\u5982\u679c\u6ca1\u6709\uff0c\u90a3\u4e48\u653e\u5165Linux\u5b89\u88c5\u76d8\u627e\u5230snmp\u7684rpm\u5305\u8fdb\u884c\u5b89\u88c5\uff0c\u6216\u8005\u5230\u7f51\u4e0a\u641c\u7d22\u9002\u5408\u81ea\u5df1Linux\u53d1\u884c\u7248\u672c\u7684rpm\u5305\u8fdb\u884c\u5b89\u88c5,\u6216\u8005\u4f7f\u7528yum\u8fdb\u884c\u5b89\u88c5<\/p>\n

2.\u5b89\u88c5<\/strong><\/div>\n

\u9700\u8981\u5b89\u88c5\u7684\u5927\u6982\u6709\u4e00\u4e0b\u51e0\u4e2a\uff1a<\/p>\n

yum install -y net-snmp\r\n\r\nyum install -y net-snmp-devel\r\n\r\nyum install -y net-snmp-libs\r\n\r\nyum install -y net-snmp-perl\r\n\r\nyum install -y net-snmp-utils\r\n\r\nyum install -y mrtg<\/pre>\n

\u5176\u4e2d\u6709\u4e00\u4e9b\u4e0d\u662f\u5fc5\u987b\u7684\uff0c -y \u6307\u7684\u662f\u5bf9\u6240\u6709\u95ee\u9898\u56de\u7b54yes\uff0c\u7701\u53bb\u5b89\u88c5\u65f6\u7684\u4ea4\u4e92\u3002<\/p>\n

3.\u542f\u52a8<\/strong><\/div>\n

\u8f93\u5165 service snmpd start \u5e76\u7528 service snmpd status \u67e5\u770b\u670d\u52a1\u72b6\u6001\u3002 \u6ce8\u610f\uff1a\u6709\u65f6\u8f93\u5165service snmpd status \u540e\u51fa\u73b0<\/strong> snmpd dead but pid file exists<\/strong> \u6216\u8005<\/strong> snmpd dead but subsys locked<\/strong> \u539f\u56e0\u662f\u6ca1\u6709\u5148\u8f93\u5165snmpd\uff0c\u539f\u7406\u8fd8\u4e0d\u662f\u5f88\u660e\u767d\uff0c\u4f46\u662f\u5148\u8bb0\u7740\u5427\u3002<\/strong><\/p>\n

4.\u914d\u7f6e<\/strong><\/div>\n

\u88c5\u597d\u4e4b\u540e\u4fee\u6539\/etc\/snmp\/snmpd.conf\u5bf9\u5176\u8fdb\u884c\u914d\u7f6e A\u3001\u4fee\u6539\u9ed8\u8ba4\u7684 \u201ccommunity\u201d \u00a0 string com2sec\u00a0\u00a0\u00a0\u00a0 notConfigUser\u00a0\u00a0\u00a0\u00a0 default\u00a0\u00a0\u00a0\u00a0 public \u5c06public\u4fee\u6539\u4e3a\u4f60\u624d\u77e5\u9053\u7684\u5b57\u7b26\u4e32; \u53e6default\u5b57\u7b26\u4e32\u5982\u679c\u60f3\u6307\u5b9a\u7279\u5b9a\u7684\u670d\u52a1\u5668\u91c7\u96c6\u6570\u636e\u7684\u8bdd\uff0c\u5c06\u6b64\u5b57\u6bb5\u66ff\u6362\u6210\u5141\u8bb8\u91c7\u96c6\u670d\u52a1\u5668\u7684IP\u5730\u5740\u3002 B\u3001\u628a\u4e0b\u9762\u7684#\u53f7\u53bb\u6389 #view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc C\u3001\u628a\u4e0b\u9762\u7684\u8bed\u53e5 access notConfigGroup \u201d \u201d any noauth exact systemview none none \u6539\u6210\uff1a access notConfigGroup \u201d \u201d any noauth exact mib2 none none<\/p>\n

5.\u91cd\u542fsnmpd\u670d\u52a1<\/strong><\/div>\n
\/etc\/rc.d\/init.d\/snmpd restart<\/pre>\n

\u5b8c\u6210snmpd\u7684\u914d\u7f6e<\/p>\n

6.\u786e\u4fddiptables\u9632\u706b\u5899\u5f00\u653e\u4e86udp 161\u7aef\u53e3\u7684\u8bbf\u95ee\u6743\u9650<\/strong><\/div>\n

\u53ef\u4f7f\u7528iptables -L -n \u67e5\u770b\u5f53\u524diptables\u89c4\u5219
\n\u53ef\u7f16\u8f91\/etc\/sysconfig\/iptables\u6587\u4ef6\u6765\u4fee\u6539iptables\u89c4\u5219<\/p>\n

\u672c\u6587\u539f\u521b\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/snmp-update.html<\/a>\u4f5c\u8005\uff1a\u516c\u5171\u8d26\u53f7\uff0c\u5ba1\u6838\u5458\uff1a\u51af\u742a<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u7b80\u5355\u7f51\u7edc\u7ba1\u7406\u534f\u8bae\uff08SNMP\uff09\uff0c\u7531\u4e00\u7ec4\u7f51\u7edc\u7ba1\u7406\u7684\u6807\u51c6\u7ec4\u6210\uff0c\u5305\u542b\u4e00\u4e2a\u5e94\u7528\u5c42\u534f\u8bae\uff08application la […]<\/p>\n","protected":false},"author":63,"featured_media":21713,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-21401","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/21401","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=21401"}],"version-history":[{"count":8,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/21401\/revisions"}],"predecessor-version":[{"id":256398,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/21401\/revisions\/256398"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/21713"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=21401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=21401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=21401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}