CMU-SNMPÀÇ ¼Ò°³¿Í »ç¿ë¹ý ³ë Á¤ ¹Î Çѱ¹ Ç×°ø ´ëÇб³ Ç×°øÅë½ÅÁ¤º¸°øÇаú ´ëÇпø http://esc.cl.hangkong.ac.kr/~hmask hmask@esc.cl.hangkong.ac.kr CMU-SNMP´Â Ä«³×±â ¸á·Ð ´ëÇп¡¼­ °³¹ßÇÑ SNMP °ü¸® ÇÁ·Î±×·¥ÀÌ´Ù. CMU-SNMP´Â SNMP ¿¡ÀÌÀüÆ®¿Í ¸î °¡Áö SNMP ÀÀ¿ë ÇÁ·Î±×·¥µéÀ» Æ÷ÇÔÇÏ °í ÀÖÀ¸¸ç, SNMPv1°ú SNMPv2¸¦ Áö¿øÇÑ´Ù(SNMPv2ÀÇ º¸¾È ¹®Á¦ÇØ°áÀ» À§ÇØ Ãʱ⠹öÀüÀÎ SNMPv2party ¸ðµ¨Àº Áö¿øÇÏÁö ¾Ê°í SNMPv2usec ¸ðµ¨À» Áö¿ø ÇÑ´Ù). ÇöÀç °¡Àå ÃֽŠ¹öÀüÀº 3.6ÀÌ¸ç ¸®´ª½º ¾ÈÁ¤Ä¿³Î v2.0.35, ½ÇÇèÄ¿³Î v2.1.125¿Í libc v5.4.38À̻󿡼­ µ¿ÀÛÇÑ´Ù. ÇÏÁö¸¸ ¹öÀü 3.4 ÀÌ»óÀº Å« Â÷ÀÌ°¡ ¾øÀ¸¹Ç·Î ³· Àº ¹öÀüÀ» »ç¿ëÇصµ »ó°ü¾ø´Ù. CMU SNMP¿¡¼­ Áö¿øÇÏ´Â MIB´Â ´ÙÀ½°ú °°´Ù. - MIB-2(RFC 1213) - Identification MIB(RFC 1414) - Host Resources MIB(RFC 1514) - TUBS Linux MIB(¸®´ª½º »ç¾ç¿¡ ¸Â´Â ½ÇÇèÀûÀÎ MIB) 1. ¼³Ä¡ CMU-SNMP´Â ´ÙÀ½ÀÇ site¿¡¼­ ±¸ÇÒ ¼ö ÀÖ´Ù. Main ftp site ftp://ftp.ibr.cs.tu-bs.de/pub/local/linux-cmu-snmp/ Mirror ftp://sunsite.unc.edu/pub/Linux/system/network/admin(±¹¿Ü) ftp://ftp.kreonet.re.kr/pub/Linux/sunsite/system/network/admin(±¹³») ¹èÆ÷ÆÇÀº ¼Ò½º ¹öÀü°ú ¹ÙÀ̳ʸ® ¹öÀüÀÇ µÎ °¡Áö Á¾·ù°¡ ÀÖÀ¸¸ç, 3.4 ¹öÀüÀ» ±â ÁØÀ¸·Î ¼³¸íÇÏ°íÀÚ ÇÑ´Ù. °¢°¢ÀÇ ÆÄÀÏÀ̸§Àº ´ÙÀ½°ú °°´Ù. - cmu-snmp-linux-3.4-src.tar.gz(¼Ò½º ¹öÀü) - cmu-snmp-linux-3.4-bin.tar.gz(¹ÙÀ̳ʸ® ¹öÀü) ¼³Ä¡ ¹æ¹ý ¼³Ä¡ÇÏ´Â ¹æ¹ýÀº ¹ÙÀ̳ʸ® ¹öÀüÀ» ¼³Ä¡ÇÏ´Â ¹æ¹ý°ú ¼Ò½º¸¦ ÄÄÆÄÀÏÇؼ­ ¼³Ä¡ÇÏ ´Â ¹æ¹ý µî µÎ °¡Áö°¡ ÀÖ´Ù. (1) ¹ÙÀ̳ʸ® ¼³Ä¡ ¹ÙÀ̳ʸ® ¹èÆ÷ÆÇÀ» ¼³Ä¡Çϱâ À§Çؼ­´Â ¸ÕÀú ¸®´ª½º ½Ã½ºÅÛÀÌ ELF¸¦ Áö¿øÇØ¾ß ÇÑ´Ù(ELF libc, ELF kernel). ±×¸®°í ±âÁ¸ÀÇ snmpd µ¥¸óÀ̳ª snmplib¸¦ »ç¿ë ÇÏ°í ÀÖÀ¸¸é »èÁ¦ÇÑ ´ÙÀ½¿¡ ¼³Ä¡ÇØ¾ß ÇÑ´Ù. ¼³Ä¡ °úÁ¤Àº ´ÙÀ½°ú °°´Ù. - root·Î login - cd /(root µð·ºÅ丮·Î À̵¿ÇÑ´Ù.) - tar xvzf .../cmu-snmp-linux-3.4-bin.tar.gz (¹èÆ÷ÆÇÀ» Ǭ´Ù.) - cd /tmp/cmu-snmp-linux/etc - ./installconf -mini (agentÀÇ Æнº¿öµå¸¦ ¼³Á¤ÇÑ´Ù.) - /etc/rc.local ÆÄÀÏ¿¡ ´ÙÀ½°ú °°ÀÌ ¡®snmpd¡¯ µ¥¸óÀ» Ãß°¡ÇÑ´Ù. - /usr/sbin/snmpd -f ; echo ¡®snmpd¡¯ (2) ¼Ò½º ¼³Ä¡ - root·Î login - tar xvzf .../cmu-snmp-linux-3.4-src.tar.gz (Àû´çÇÑ µð·ºÅ丮¿¡ ¼Ò½º¸¦ Ǭ´Ù.) - cd cmu-snmp-linux-3.4 - ./configure - make(ÄÄÆÄÀÏ ÇÑ´Ù.) - make install - cd ./etc - ./installconf -mini (agentÀÇ Æнº¿öµå¸¦ ¼³Á¤ÇÑ´Ù.) - /etc/rc.local ÆÄÀÏ¿¡ ´ÙÀ½°ú °°ÀÌ ¡®snmpd¡¯ µ¥¸óÀ» Ãß°¡ÇÑ´Ù. /usr/sbin/snmpd -f ; echo ¡®snmpd¡¯ ¼³Ä¡¸¦ ³¡³µÀ¸¸é Àç ºÎÆÃÇÑ ´ÙÀ½ snmpwalk ÇÁ·Î±×·¥À» »ç¿ëÇÏ¿© Å×½ºÆ® Çغ¸ ÀÚ. ±×¸² 1Àº snmpwalk¸¦ »ç¿ëÇÏ¿© ½Ã½ºÅÛ Å×À̺íÀ» »ìÆ캻 °ÍÀ¸·Î ÇöÀç ¼³Á¤ µÇ¾î ÀÖ´Â ½Ã½ºÅÛ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù. 2. ÀÀ¿ë ÇÁ·Î±×·¥µé (1) snmpd CMUÀÇ SNMP ¿¡ÀÌÀüÆ®·Î¼­ SNMPv1°ú SNMP 2usecÀÇ ÁúÀÇ¿¡ ´ëÇÑ ÀÀ´äÀ» ÇØÁØ´Ù. ȯ°æ ¼³Á¤Àº snmpd.conf ÆÄÀÏ¿¡ ÀÇÇؼ­ ÀÌ·ç¾îÁö¸ç °ü¸®ÀÚ´Â system .sysName, system.sysLocation°ú system.sys Contact µîÀÇ ³»¿ëÀ» ¼³Á¤ÇØ ÁÙ ¼ö ÀÖ´Ù. SNMPv1 ÁúÀÇ¿¡ ´ëÇÑ community À̸§Àº ±âº»ÀûÀ¸·Î ¸ðµÎ ¡®public¡¯À̸ç, host Å×À̺íÀÇ SNMPv2usec ÇüÅÂÀÇ ÁúÀÇ´Â º¸¾È ³»¿ë¿¡ µû¶ó ´Ù¸¥ community¸¦ »ç¿ëÇÑ´Ù. ¿É¼ÇÀº ´ÙÀ½°ú °°´Ù. - d : SNMP ÆÐŶ ³»¿ëÀ» ´ýÇÁÇؼ­ º¸¿©ÁØ´Ù. - f : ½ÇÇàÇÑ ´ÙÀ½ ¹é±×¶ó¿îµå¿¡¼­ µ¿ÀÛÇÏ°Ô ÇÑ´Ù. - c : ½ÇÇà¿¡ ÇÊ¿äÇÑ ¼³Á¤ ÆÄÀÏÀ» ºÒ·¯µéÀδÙ. - a : ½ÇÇà¿¡ ÇÊ¿äÇÑ agent ¼³Á¤ ÆÄÀÏÀ» ºÒ·¯µéÀδÙ. (2) snmpd.conf snmpd¸¦ À§ÇÑ ¼³Á¤ÆÄÀÏÀÌ´Ù. ÆÄÀÏÀÇ ³»¿ëÀº view¿Í user, community ¼³Á¤¿¡ °üÇÑ ºÎºÐ°ú Æ÷Æ®, ÀÎÅÍÆäÀ̽º ¼³Á¤¿¡ °üÇÑ ºÎºÐÀÇ µÎ °¡Áö·Î ³ª´¶´Ù. ÀüÀÚÀÇ ¼³Á¤Àº º¸¾ÈÀ» À§Çؼ­ Á¢±Ù ±ÇÇÑÀ» ´ÙÀ½°ú °°ÀÌ ¼¼ °¡Áö·Î ±¸ºÐµÈ´Ù. switch security posture - mini internet subtree¿¡ ´ëÇؼ­¸¸ read-only ±ÇÇÑÀ¸·Î¸¸ Á¢±ÙÇÒ ¼ö ÀÖ´Ù. - semi system subtree¿Í agent Åë°è¿¡ ´ëÇؼ­¸¸ read-only ±ÇÇÑÀ¸ ·Î Á¢±ÙÇÒ ¼ö ÀÖ´Ù. - very agent Åë°è¿¡ ´ëÇؼ­¸¸ read-only ±ÇÇÑÀ¸·Î Á¢±ÙÇÒ ¼ö ÀÖ´Ù. óÀ½ ¼³Ä¡(installconf)ÇÒ ¶§ ÀÌ ½ºÀ§Ä¡¿¡ µû¶ó¼­ Æнº¿öµå¸¦ Á¤ÇØ ÁÙ ¼ö ÀÖ´Ù. ±× ¿Ü ´Ù¸¥ ¼³Á¤¿¡ ´ëÇÑ Å°¿Í ÆĶó¹ÌÅÍ´Â ´ÙÀ½°ú °°´Ù. À̸¦ ¹ÙÅÁÀ¸·Î ¼³Á¤ÇÑ snmpd.conf ÆÄÀÏÀÇ ¿¹´Â ´ÙÀ½°ú °°´Ù. À̸¦ ¹ÙÅÁÀ¸·Î ¼³Á¤ÇÑ snmpd.conf ÆÄÀÏÀÇ ¿¹´Â ´ÙÀ½°ú °°´Ù. (3) snmpget SNMP ¿¡ÀÌÀüÆ®¿¡°Ô Get Request¸¦ Çؼ­ Response¸¦ ¹Þ¾Æ¿À´Â ÇÁ·Î±×·¥ÀÌ´Ù. »ç¿ë¹ý : snmpget host community variable COMMUNITY Argument snmpget ÇÁ·Î±×·¥Àº SNMPv1/SNMPv2c/SNMPv2u secÀ» ÀüºÎ Áö¿øÇϱ⠶§¹® ¿¡, À̵éÀ» argument¸¦ ÅëÇؼ­ ±¸ºÐÇÑ´Ù. - community ¹®ÀÚ¿­ÀÇ Ã¹ ÀÚ°¡ ¡°+¡±·Î ½ÃÀ۵Ǹé SNMPv2c (cmomunity-based SNMPv2)·Î ÀνÄÇÑ´Ù. - community ¹®ÀÚ¿­ÀÇ Ã¹ ÀÚ°¡ ¡°-¡±·Î ½ÃÀ۵Ǹé SNMPv2u(User-based - security model)·Î ÀνÄÇÑ´Ù. - ±× ¿Ü ´Ù¸¥ community ¹®ÀÚ¿­Àº ÀüºÎ SNMPv1·Î ÀνÄÇÑ´Ù. SNMPv2uÀÇ ÀüüÀûÀÎ community¹®ÀÚ¿­Àº ´ÙÀ½°ú °°´Ù. /userName/[authenticationKey]/[privacyKey]/[contextSelector] ¿©±â¼­ Å° °ªÀº ¹®ÀÚ¿­°ú hex Äڵ带 »ç¿ëÇÒ ¼ö ÀÖÀ¸¸ç, hex Äڵ带 »ç¿ëÇÒ ¶§ ´Â ¹Ýµå½Ã ¸Ç ¾Õ¿¡ ¡®0x¡¯¸¦ Ãß°¡ÇØ¾ß ÇÑ´Ù. »ç¿ë ¿¹´Â ´ÙÀ½°ú °°´Ù. /joy : QoS = noAuth/noPriv, userName = "joe" /boneless/chicken/ranch : QoS = auth/priv, userName ="boneless", authKey ="chicken", privKey ="ranch" /maplesyrup/sugarbush// : QoS = auth/noPriv, context ="other", userName ="maplesyrup" authKey ="sugarbush" /glenn/0x4ca25023b00a6689ef21cb1b6fa9cb0e : QoS = auth/noPriv, context="", userName ="glenn" authKey ="0x4ca25023b00a6689ef21cb1b6fa9cb0e" +public : SNMPv2c public : SNMPv1 (4) snmpgetnext SNMP ¿¡ÀÌÀüÆ®¿¡°Ô Get Next Request¸¦ »ç¿ëÇÏ¿© ¿©·¯ °³ÀÇ Response¸¦ µÇ µ¹·Á ¹Þ´Â´Ù. »ç¿ë¹ý : snmpgetnext host community variable-name [variable-name] . . . (5) snmptrap SNMP Æ®·¦ ¸Þ½ÃÁö¸¦ ÁöÁ¤ÇÑ È£½ºÆ®¿¡ Àü¼ÛÇÑ´Ù. »ç¿ë¹ý : snmptrap host community trap-type specific-type device-description device description Æ®·¦ ¸Þ½ÃÁö¿¡ Àü´ÞÇÒ ÀåÄ¡¿¡ °üÇÑ ¼³¸íÀ¸·Î system. sysDescr.0¿¡ ÀúÀåµÇ´Â º¯¼ö °ªÀÌ´Ù. # snmptrap nic.andrew.cmu.edu public 0 0 ¡®SUN 3/60: SUNOS 4.0¡¯ # (nic.andrew.cmu.eduÀÇ ½Ã½ºÅÛ¿¡ coldStart Æ®·¦À» Àü¼ÛÇÑ´Ù) (6) snmptrapd ¿ÜºÎ¿¡¼­ Àü´ÞµÈ SNMP Æ®·¦ ¸Þ½ÃÁö¸¦ 162¹ø Æ÷Æ®¸¦ ÅëÇؼ­ ¹Þ´Â´Ù. ¿É¼ÇÀº ´ÙÀ½°ú °°´Ù. - p : ¸Þ½ÃÁö¸¦ È­¸é¿¡ Ãâ·ÂÇÑ´Ù. - s : syslog¸¦ »ç¿ëÇÏ¿© ¸Þ½ÃÁö¸¦ ÀúÀåÇÑ´Ù. ÀÌ·± syslog ¸Þ½ÃÁö´Â LOG_WARNING ·¹º§·Î Àü´ÞµÈ´Ù. - v 1 : SNMPv1 Æ®·¦ ¸Þ½ÃÁö¸¦ ¹Þ´Â´Ù. - d : ÆÐŶÀ» ´ýÇÁÇÏ¿© Ãâ·ÂÇÑ´Ù. snmptrapd¸¦ µ¿ÀÛ½ÃÅ°°í snmptrapÀ» »ç¿ëÇÏ¿© localhost·Î Æ®·¦ ¸Þ½ÃÁö¸¦ Àü¼Û ÇÑ ¿¹. snmpd.confÀÇ ¿¹ # snmpd.conf - created Mon Aug 30 16:26:04 KST 1999 # view configuration # viewName OID included/excluded # internet view all .1.3.6.1 included # internet view mini .1.3.6.1 included # for v1 public exclude exclude mib-2.ident.identInfo # and mib-2.host.hrSWRun in the mini view: view xmini .1.3.6.1 included view xmini .1.3.6.1.2.1.24.1 excluded view xmini .1.3.6.1.2.1.25.4 excluded # system, snmp, usecAgent, usecStats view semi .1.3.6.1.2.1.1 included view semi .1.3.6.1.2.1.11 included view semi .1.3.6.1.6.3.6.1.1 included view semi .1.3.6.1.6.3.6.1.2 included # . . . Áß·« # community configuration # commName readV writeV community public xmini - ## uncomment for private entry: # community private mini mini ## port to use (default is 161): # port: 161 ## the entry of system.Contact and system.Location: sysContact: Not Configured sysLocation: Not Configured ## the system name is per default determined from the hostname: # sysName: chappell ## trap sink address and community string. (passed to snmptrap(1)utility). ## authentraps contains the value of snmpEnableAuthenTraps; (default is `disabled¡¯). trap sink: localhost trap community: public snmpEnableAuthenTraps: disabled ## specify type and speed of interfaces: if the last char is an asterisk, any suffix will match. interface: lo0 24 20000000 interface: eth* 6 10000000 interface: sl* 28 28800 interface: ppp* 23 28800