ÇǸ£¸£µåRRDTool ¿ë °´Ã¼ ÁöÇâ ÆÄÀ̽ã ÀÎÅÍÆäÀ̽º | |
Áö±Ý ´Ù¿î·Îµå |
ÇǸ£¸£µå ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- BSD License
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- Duncan McGreggor
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- https://launchpad.net/~oubiwann
ÇǸ£¸£µå ű×
ÇǸ£¸£µå ¼³¸í
RRDTool ¿ë °´Ã¼ ÁöÇâ ÆÄÀ̽ã ÀÎÅÍÆäÀ̽º PyRRD ¸í·É ÁÙ ±×·¡ÇÁ¿Í ¶ó¿îµå ·Îºó µ¥ÀÌÅͺ£À̽º À¯Æ¿¸®Æ¼, RRDtoolÀǸ¦À§ÇÑ °´Ã¼ ÁöÇâ ·¡ÆÛÀÔ´Ï´Ù. 1 : ¿ø·¡´ÂÀÌ °³ ¼³°è ¸ñÇ¥¸¦ °¡Áö°í ÀÖ¾ú´Ù. ÆÄÀ̽ã ÇÁ·Î±×·¡¸Ó°¡ »ç¶ûÇÏ´Â °ÍÀ̶ó°í RRDtoolÀÇ¿¡ ´ëÇÑ ÀÎÅÍÆäÀ̽º¸¦ Á¦°ø, AND2. ÀÌÀü¿¡ rrdtool.The ÀÌÀ¯·Î ÆÄÀ̽㠹ÙÀεù¿¡ ÀÇÁ¸ÇÏÁö ºÐ¸íÇÏ´Ù. ÈÄÀÚ¿¡ ´ëÇÑ µ¿±âµéÀº ¸ðµÎ ¼ÓµµÀÇ ÀåÁ¡À» ÀÌ·¸°Ô ÀÚ½ÅÀÇ ½Ã½ºÅÛ¿¡ ±× (°Í)µéÀÌ ±×µé¿¡ ´ëÇÑ ÆÄÀ̽㠹ÙÀεùÀ» ÅëÇÕÇÏ´Â °èȹÀ» Áñ±æ ¼ö ÀÖ½À´Ï´Ù °ÍÀ» ¾î·Á¿î ¼±ÅÃÀÌ°í PyRRD ÇÁ·ÎÁ§Æ®ÀÇ ÀÚ½ÅÀÇ ¿î¿µ üÁ¦¿¡ RRDtoolÀÇ ¹ÙÀεùÀ» ÄÄÆÄÀÏÀ»Çß´ø ¸¹Àº »ç¶÷µéÀÌ ÀÖ¾ú´Ù ¹ÙÀεù»Ó¸¸ ¾Æ´Ï¶ó XML 󸮸¦À§ÇÑ ElementTreeÀÇ PyRRD ¸ÞÀÌÅ©¾÷ »ç¿ëÀÇ PyRRD.DependenciesSome ºÎºÐ¿¡¼ API À¯¿ë¼º¿¡¼. ÆÄÀ̽ã 2.5 ÀÌ»óÀÌÀÖ´Â °æ¿ì, PyRRD´Â xml.etreeÀ» »ç¿ëÇÕ´Ï´Ù. ÆÄÀ̽㠹öÀüÀÌ ÀûÀº 2.5 ÀÌ»óÀ̸ç (¿¹ : ´ýÇÁ ±â´É°ú °¡Á® ¿À±â / Á¤º¸ ¹æ¹ý µî) XML 󸮿¡ µû¶ó ±â´ÉÀ» »ç¿ëÇÏ·Á¸é, ´ç½ÅÀº ElementTree ¶óÀ̺귯¸®¸¦ ¼³Ä¡ÇؾßÇÕ´Ï´Ù .InstallationPyRRD Æò¼Ò¿¡ ¼³Ä¡µÇ¾î ¹æ¹ý : installYou setup.py ÆÄÀ̽ãÀº ¶ÇÇÑ ´ç½ÅÀÇ PYTHONPATH¿¡ ./ÀÌ ±ä¸¸Å ±×°ÍÀ» ¼³Ä¡ÇÏÁö ¾Ê°í pyRRDÀ» »ç¿ëÇÒ ¼ö ÀÖÀ¸¸ç, ´ç½ÅÀÌ .UsageCreate RRD ÆÄÀÏÀ» ÇÁ·Î±×·¡¹ÖÇÕ´Ï´Ù (pyrrd ÇÏÀ§ µð·ºÅ丮°¡) ÃÖ»óÀ§ µð·ºÅ丮¿¡ ÀÖ½À´Ï´Ù >> > pyrrd.rrd ¼öÀÔ µ¥ÀÌÅÍ ¼Ò½º, RRA¿¡¼ RRD >>> ÆÄÀϸí = '/tmp/test.rrd'µ¥ÀÌÅÍ ¼Ò½º >>> = [] >>> roundRobinArchives = [] >>> µ¥ÀÌÅÍ ¼Ò½º´Â dataSource = (... = dsName '¼Óµµ'dsType = 'COUNTER'ÇÏÆ® ºñÆ® = 600) >>> dataSources.append (´Â dataSource) >>> roundRobinArchives.append (RRA (CF = 'AVERAGE'XFF = 0.5, ´Ü°è = 1 Çà = 24) ) >>> roundRobinArchives.append (RRA (CF = 'AVERAGE'XFF = 0.5, ´Ü°è = 6 Çà = 10)) = >>> myRRD RRD (ÆÄÀϸí, DS = µ¥ÀÌÅÍ ¼Ò½º, RRA = roundRobinArchives ... ±âµ¿ = 920,804,400) >>> myRRD.create ()ÇÏÀÚ °Ë»ç´Â F ÀÖ´ÂÁö ILE°¡ Á¸Àç : >>> °¡Á® ¿À±â ¿î¿µ üÁ¦°¡ >>> os.path.isfile (ÆÄÀÏ À̸§) µð½ºÅ©¿¡ ¾²±â¸¦ ÀúÀå TrueIn ¼ø¼´Â ´ÙÀ½ PyRRD ¹öÆÛ °ª°ú´Â ÇÑ °¡Áö¿¡ RRD ÆÄÀÏ¿¡ °ªÀ» ±â·ÏÇÑ´Ù : >>> myRRD.bufferValue¸¦ ( '920805600', '12363') >>> myRRD.bufferValue ( '920805900', '12363') >>> myRRD.bufferValue ( '920806200', '12373') >>> myRRD.bufferValue ( '920806500', ' 12383 ') >>> myRRD.update ()ÇÏÀÚ Á» ´õ ¸¹Àº µ¥ÀÌÅ͸¦ Ãß°¡ >>> myRRD.bufferValue¸¦ ('920806800 ','12393 ') >>> myRRD.bufferValue ('920807100 ','12399 ') >>> myRRD.bufferValue ( '920807400', '12405') >>> myRRD.bufferValue ( '920807700', '12411') >>> myRRD.bufferValue ( '920808000', '12415') >>> myRRD.bufferValue ( ' 920808300 ','12420 ') >>> myRRD.bufferValue ('920808600 ','12422 ') >>> myRRD.bufferValue ('920808900 ','12423 ') >>> myRRD.update ()ÀÖ´Â °Å È£±â½ÉÀ» ´ç½Å¿¡°ÔÇÏ´Â °æ¿ì ´ÙÀ½°úÀÇ RRD ÆÄÀÏ¿¡¼ Á» °É¸± ¼ö ÀÖ½À´Ï´Ù : myRRD.info ()¸¦ ±× Ãâ·ÂÀº ¿©±â¿¡ ÀμâµÇÁö ¾Ê½À´Ï´Ù, '³Ê¹« ¸¹Àº °ø°£À» Â÷Áö ¿øÀÎ. ±×·¯³ª,ÀÌ ±×·¡ÇÁ¸¦ ¸¸µé ¼öÀÖ´Â ºñ½ÁÇÑ À̸§ RRDtoolÀÇÀÇ command.In ¸í·ÉÀÇ Ãâ·Â°ú ¸Å¿ì À¯»çÇÕ´Ï´Ù, ¿ì¸®´Â ¸î °¡Áö µ¥ÀÌÅÍ Á¤ÀÇ°¡ ÇÊ¿äÇÕ´Ï´Ù. ¿ì¸®´Â ¶ÇÇÑ ¸î °¡Áö °è»ê Á¤ÀÇ¿Í ÁÁÀº meansure¿¡ ´ëÇÑ º¯¼ö Á¤ÀÇ¿¡ ´øÁú°Å¾ß : >>> pyrrd.graph °¡Á® ¿À±â¿¡¼ DEF, CDEF, VDEF, ¼±, ¿µ¿ª, GPRINT >>> def1 = DEF (rrdfile = myRRD.filename, VNAME = 'myspeed'... dsName = dataSource.name) >>> cdef1 = CDEF (VNAME = 'kmh'RPN = '% S, 3600, *'def1.vname %) = >>> cdef2 CDEF (= VNAME 'ºü¸¥'RPN = 'kmh, 100, GT, kmh 0, IF') >>> cdef3 = CDEF (VNAME = 'ÁÁ´Ù', RPN = 'kmh, 100, GT, 0, kmh, IF')> VDEF vdef1 >> = (VNAME = 'mymax'RPN = '% S, MAXIMUM'%ÀÇ def1.vname) >>> vdef2 = VDEF (VNAME = 'myavg'RPN = '%ÀÇ Æò±Õ'%ÀÇ def1.vname = '# 006600'= >>> ¿µ¿ª 1 = AREA (defObj = cdef3, »ö»ó) 'ÃÖ´ë Çã¿ë') >>> 1 È£¼± = LINE (°ª = 100, »ö»ó = '# 990000', Àü¼³, Àü¼³ = 'ÁÁÀº ¼Óµµ' ) >>> AREA2 = AREA '³Ê¹« ºü¸¥'(defObj = cdef2, »ö»ó = '#ÀÇ CC6633', Àü¼³ =) >>> 2 È£¼± = LINE (defObj = vdef2, »ö»ó = '# 000099', Àü¼³ = '³» Æò±Õ' , ... ½ºÅÃ, >>> gprint1 = GPRINT (vdef2) ÁøÁ¤ÇÑ = '% 6.2lf ½Ã¼Ó') »ö»óÀÌ »îÀÇ ¾ç³äÀÔ´Ï´Ù. ÇÏÀÚ Çâ½Å·á ±×°ÍÀ» Á¶±Ý : >>> pyrrd.graph ¼öÀÔ ColorAttributes¿¡¼ÀÌ >>> CA°¡ ColorAttributesÀ» = () >>> ca.back = '# 333333'>>> ca.canvas = '# 333333'>>> Ķ¸®Æ÷´Ï¾Æ .shadea = "# 000000">>> ca.shadeb = "# 111111">>> ca.mgrid = '#CCCCCC'>>> ca.axis = '#FFFFFF'>>> ca.frame = '#AAAAAA '>>> ca.font ='#FFFFFF '>>> ca.arrow ='¿ì¸®°¡ ¿ì¸®ÀÇ RRD ÆÄÀÏÀÇ µ¥ÀÌÅÍ¿¡ ´ëÇÑ ±×·¡ÇÁ¸¦ ¸¸µé ¼ö ÀÖ½À´Ï´Ù FFFFFF'Now # : pyrrd.graph °¡Á® ¿À±â ±×·¡ÇÁ¿¡¼ >>> >>> graphfile = "/tmp/rrdgraph.png">>> g = ±×·¡ÇÁ (>>> g.data.extend (graphfile = 920,805,000 ÃÖÁ¾ = 920,810,000 ... vertical_label = 'kmh'Ä÷¯ = CA ½ÃÀÛ) ) >>> g.write ()ÇÏÀÚ make°¡ ÀÖ´ÂÁö°¡ÀÖ´Ù : >>> os.path.isfile ( graphfile) TrueOpen ±× ÀûÀýÇÑ RRD ±×·¡ÇÁ °ÍÀ» ÁÁ¾ÆÇÏ´Â À̹ÌÁö ºê¶ó¿ìÀú ¹× È®ÀÎ ÃÖ´ë generated.LetÀÇ ±ú²ýÇÑ ¿ì¸®´Â Àӽà µð·ºÅ丮¿¡ ³Ö¾î ÇÑ ÆÄÀÏÀ» ¹é¾÷ : >>> os.unlink (ÆÄÀÏ À̸§) >>> os.unlink ( graphfile) ¿ä±¸ »çÇ× : ¡¤ ÆÄÀ̽ã ÀÌ ¸±¸®½º¿¡¼´Â »õ·Î¿î ±â´É : ¡¤ Æ÷Àå °³¼± ¹× ¹®¼È·Îµå.
ÇǸ£¸£µå °ü·Ã ¼ÒÇÁÆ®¿þ¾î
viewklass.
LESTIF ¶Ç´Â OSF / MOTIF »ç¿ëÀÚ ÀÎÅÍÆäÀ̽º ÅøŶÀ» »ç¿ëÇÏ´Â ÀÀ¿ë ÇÁ·Î±×·¥À» °³¹ßÇϱâÀ§ÇÑ C ++ ÇÁ·¹ÀÓ ¿öÅ©. ...
134