#keywords proc, snmp, cpu count #title proc ³ª snmp ÀÇ °ªÀ» ÀÌ¿ëÇÏ¿©, cpu counter ¸¦ ±¸ÇÏ´Â °ø½Ä [[TableOfContents]] == Count ¹æ½ÄÀ¸·Î CPU¸¦ ÃøÁ¤ÇØ¾ß ÇÏ´Â ÀÌÀ¯ == * LinuxÀÇ °æ¿ì snmp¿¡¼­ º¸¿©ÁÖ´Â CPU »ç¿ë·®Àº ºÎÆýà ºÎÅÍÀÇ Æò±Õ°ªÀ̹ǷΠ¼º´É ÃøÁ¤½Ã °í·Á´ë»óÀÌ ¾ÈµÊ. * º¸Åë Linux ÀÇ °æ¿ì cronjob ¿¡ ÀÇÇÑ °á°ú¹°À» ÀÌ¿ëÇÏ¿© guage ·Î cpu usage ¸¦ ±×¸®´Â °æ¿ì°¡ ¸¹À½ * guage °ªÀº rrd database ¸¦ update ÇÒ ´ç½ÃÀÇ °ªÀ̹ǷÎ, ÀÌÀü°ªÀ» ¾÷µ¥ÀÌÆ® ÇÏ´Â ¼ø°£ ºÎÅÍ ÇöÀç°ªÀ» ¾÷µ¥ÀÌÆ® ÇÏ´Â ½Ã°£»çÀÌÀÇ »ç¿ë·üÀº ÀüÇô ¹Ý¿µµÇÁö ¸øÇÔ. == ÇØ°á¹æ¹ý == * UCD-SNMP-MIB (.1.3.6.1.4.1.2021) ÀÇ CPU °ü·Ã Counter ¸¦ ÀÌ¿ëÇÏ¿© °ªÀ» ±¸ÇÔ * user => UCD-SNMP-MIB::ssCpuRawUser.0 * nice => UCD-SNMP-MIB::ssCpuRawNice.0 * sys => UCD-SNMP-MIB::ssCpuRawSystem.0 * idle => UCD-SNMP-MIB::ssCpuRawIdle.0 * wait => UCD-SNMP-MIB::ssCpuRawWait.0 * intr => UCD-SNMP-MIB::ssCpuRawInterrupt.0 * irqt => UCD-SNMP-MIB::ssCpuRawSoftIRQ.0 * counter ¹æ½ÄÀ̱⠶§¹®¿¡ °¢ °ªÀÇ 2 ÁöÁ¡(½Ã°£»ó) ÀÇ Â÷À̸¦ ±¸Çϵµ·Ï ÇÑ´Ù. * ¿¹) user = user[post] - user[pref] * scale = 100.0 / (user + nice + sys + idle + wait + intr + irqt) * user = (user + nice) * scale * sys = (sys + intr + irqt) * scale * idle *= scale * idwait *= scale == Âü°í == * linux kernel 2.4 ¿¡¼­´Â ¶Ç´Â (´Ù¸¥ OS ¿¡¼­´Â) IOWAIT/Interrupt/SoftIRQ ¿¡ ´ëÇÑ Counter °¡ ¾øÀ» ¼öµµ ÀÖÀ¸¹Ç·Î ¿¹¿Ü 󸮸¦ ¿°µÎ¿¡ µÎ¾î¾ß ÇÑ´Ù.