{"id":5110,"date":"2013-06-21T20:33:54","date_gmt":"2013-06-21T12:33:54","guid":{"rendered":"http:\/\/jpuyy.com\/?p=5110"},"modified":"2014-05-12T17:49:23","modified_gmt":"2014-05-12T09:49:23","slug":"jiankongbao-snmp-ubuntu","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=5110","title":{"rendered":"\u4f7f\u7528\u76d1\u63a7\u5b9d\u7684snmp\u76d1\u63a7ubuntu"},"content":{"rendered":"<p>snmp\u4f7f\u7528\u5f88\u65b9\u4fbf\uff0c\u53ef\u4ee5\u76d1\u63a7cpu, load average, memory, net, \u78c1\u76d8I\/O\uff0c\u76d1\u63a7\u5b9d(http:\/\/www.jiankongbao.com)\u63d0\u4f9b\u4e86\u7b80\u5355\u7684snmp\u76d1\u63a7\u3002<\/p>\n<p>\u5728\u76d1\u63a7\u5b9d\u4e2d\u627e\u5230\u6dfb\u52a0snmp\u670d\u52a1\u5668\uff0c\u9700\u8981\u51c6\u5907\u51e0\u6837\u4fe1\u606f\uff1a<\/p>\n<p>*\u670d\u52a1\u5668\u7684ip\u5730\u5740<br \/>\n*snmp\u7684\u7528\u6237\u540d\uff0c\u5bc6\u7801<\/p>\n<p>\u8fd9\u91cc\u4f7f\u7528snmp v3\u7248\u672c\uff0c\u540c\u65f6\u4f7f\u7528md5\u52a0\u5bc6<\/p>\n<p>\u5b89\u88c5snmpd<\/p>\n<pre>apt-get install snmpd<\/pre>\n<p>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6snmpd.conf\uff0c\u53ef\u4ee5\u4f7f\u7528man snmpd.conf\u67e5\u770bsnmpd.conf\u5177\u4f53\u6bb5\u7684\u8bbe\u7f6e<\/p>\n<pre>vim \/etc\/snmp\/snmpd.conf<\/pre>\n<p>\u5c06\u76d1\u542c\u672c\u5730ip\u6539\u4e3a\u76d1\u542c\u6240\u6709<\/p>\n<p>\u5373\u5c06agentAddress udp:127.0.0.1:161 \u6539\u4e3a\u00a0agentAddress udp:161<\/p>\n<p>\u63a5\u4e0b\u6765\u521b\u5efa\u4e00\u4e2a\u7528\u6237jpuyy\uff0c\u5bc6\u7801\u4e3ajpuyy123\uff0c\u8fd9\u91cc\u9700\u8981\u81f3\u5c118\u4f4d\u5bc6\u7801<\/p>\n<pre># net-snmp-config --create-snmpv3-user -ro -A jpuyy123\u00a0-a MD5 jpuyy\r\n adding the following line to \/var\/lib\/snmp\/snmpd.conf:\r\n createUser jpuyy MD5 \"jpuyy123\" DES\r\n adding the following line to \/usr\/share\/snmp\/snmpd.conf:\r\n rouser jpuyy<\/pre>\n<p>\u53ef\u4ee5\u53d1\u73b0\u81ea\u52a8\u5c06\u7528\u6237\u4fe1\u606f\u548c\u6743\u9650\u8bb0\u5f55\u5230\u4e86\u4e0d\u540c\u7684\u6587\u4ef6\u91cc\u3002<\/p>\n<p>\u542f\u52a8snmpd\u670d\u52a1<\/p>\n<pre>\/etc\/init.d\/snmpd start<\/pre>\n<p>\u6700\u540e\u68c0\u67e5\u4e00\u4e0b\u9632\u706b\u5899\u662f\u5426\u6253\u5f00\u4e86udp 161\u7aef\u53e3<\/p>\n<p>\u53c2\u8003\uff1a<\/p>\n<p><a href=\"http:\/\/wiki.jiankongbao.com\/doku.php\/%E6%96%87%E6%A1%A3:%E5%AE%89%E5%85%A8%E6%8C%87%E5%BC%95\">http:\/\/wiki.jiankongbao.com\/doku.php\/%E6%96%87%E6%A1%A3:%E5%AE%89%E5%85%A8%E6%8C%87%E5%BC%95<\/a><\/p>\n<p><a href=\"http:\/\/blog.jiankongbao.com\/?p=160\">http:\/\/blog.jiankongbao.com\/?p=160<\/a><\/p>\n<p>snmp\u5c0f\u77e5\u8bc6\uff1a\u7b80\u5355\u7f51\u7edc\u7ba1\u7406\u534f\u8bae\uff08SNMP\uff0cSimple Network Management Protocol\uff09\uff0csnmp\u7ba1\u7406\u7aef\u53eb\u505asnmp manager\uff1bsnmp\u4ee3\u7406\u7aef\u4e3asnmp agent\uff0c\u5b58\u5728\u4e8e\u88ab\u7ba1\u7406\u7684\u8bbe\u5907\u4e2d\u3002snmp\u662f\u57fa\u4e8eudp\u4f20\u8f93\u7684\u3002<\/p>\n<p>\u4f7f\u7528snmpwalk\u6765\u53d6\u51fasnmp\u4fe1\u606f\uff0c\u4e0d\u540c\u7248\u672c\u4f7f\u7528\u7684\u547d\u4ee4\u4e0d\u4e00\u6837\u3002<\/p>\n<p class=\"p1\">snmpwalk -v 2c\u00a0-c public\u00a0192.168.1.8<\/p>\n<p class=\"p1\">snmpwalk -v 1 -c public\u00a0192.168.1.8<\/p>\n","protected":false},"excerpt":{"rendered":"<p>snmp\u4f7f\u7528\u5f88\u65b9\u4fbf\uff0c\u53ef\u4ee5\u76d1\u63a7cpu, load average, memory, net, \u78c1\u76d8I\/O\uff0c\u76d1\u63a7\u5b9d(http:\/\/www.jiankongbao.com)\u63d0\u4f9b\u4e86\u7b80\u5355\u7684snmp\u76d1\u63a7\u3002 \u5728\u76d1\u63a7\u5b9d\u4e2d\u627e\u5230\u6dfb\u52a0snmp\u670d\u52a1\u5668\uff0c\u9700\u8981\u51c6\u5907\u51e0\u6837\u4fe1\u606f\uff1a *\u670d\u52a1\u5668\u7684ip\u5730\u5740 *snmp\u7684\u7528\u6237\u540d\uff0c\u5bc6\u7801 \u8fd9\u91cc\u4f7f\u7528snmp v3\u7248\u672c\uff0c\u540c\u65f6\u4f7f\u7528md5\u52a0\u5bc6 \u5b89\u88c5snmpd apt-get install snmpd \u4fee\u6539\u914d\u7f6e\u6587\u4ef6snmpd.conf\uff0c\u53ef\u4ee5\u4f7f\u7528man snmpd.conf\u67e5\u770bsnmpd.conf\u5177\u4f53\u6bb5\u7684\u8bbe\u7f6e vim \/etc\/snmp\/snmpd.conf \u5c06\u76d1\u542c\u672c\u5730ip\u6539\u4e3a\u76d1\u542c\u6240\u6709 \u5373\u5c06agentAddress udp:127.0.0.1:161 \u6539\u4e3a\u00a0agentAddress udp:161 \u63a5\u4e0b\u6765\u521b\u5efa\u4e00\u4e2a\u7528\u6237jpuyy\uff0c\u5bc6\u7801\u4e3ajpuyy123\uff0c\u8fd9\u91cc\u9700\u8981\u81f3\u5c118\u4f4d\u5bc6\u7801 # net-snmp-config &#8211;create-snmpv3-user -ro -A jpuyy123\u00a0-a MD5 jpuyy adding the following line to \/var\/lib\/snmp\/snmpd.conf: createUser jpuyy MD5 &#8220;jpuyy123&#8221; DES adding the following line to \/usr\/share\/snmp\/snmpd.conf: rouser jpuyy \u53ef\u4ee5\u53d1\u73b0\u81ea\u52a8\u5c06\u7528\u6237\u4fe1\u606f\u548c\u6743\u9650\u8bb0\u5f55\u5230\u4e86\u4e0d\u540c\u7684\u6587\u4ef6\u91cc\u3002 \u542f\u52a8snmpd\u670d\u52a1 \/etc\/init.d\/snmpd [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[147],"class_list":["post-5110","post","type-post","status-publish","format-standard","hentry","category-life","tag-snmpd"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5110"}],"version-history":[{"count":9,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5110\/revisions"}],"predecessor-version":[{"id":6300,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5110\/revisions\/6300"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}