rrdtoolã¯çã
ãã®é ã¯GraphiteããInfluxDBãrrdtoolã«åã£ã¦ä»£ãããã¤ã¤ãããã§ãããããrrdtoolã®ã³ãã³ãå¼æ°ã¯ããã£ã¦ã¿ãã¨æå¤ã¨æ¥½ãããã®ã§ã(人ã«ããã¾ãã)ããã®ããã
"rrdtool 誰ãä¸çªãã£ãããã°ã©ãæãããé¸æ権"
— æ¡åç¿å¸ (@shoichimasuhara) April 4, 2014
ã¨ãæãã¤ãã§è¨ãã¾ããããã¨ããããåºã®å£ã¨ãããå座ã¨ããããã¨ãããããã£ã¦è¦ãã ããã£ã¦ã¿ããã¨æãã¾ã
MRTG
ã¨ããããæ¸ããªããããªæã
MRTGã®ã°ã©ãã彷彿ã¨ããã¾ãããã³ãã³ãã©ã¤ã³ã¯ãã¡ã
rrdtool graph shoichi.example.com_loadavg5_1.png \ --title "load average 5 of shoichi.example.com" \ --start end-1w --end now \ --width 400 \ --height 180 \ DEF:value1=shoichi.example.com_loadavg5.rrd:value:AVERAGE \ AREA:value1#00FF00:"loadavg5" \
shoichi.example.com_loadavg5.rrd ã¨ãããã¡ã¤ã«ã®valueã¨ããã«ã©ã ã®AVERAGEãvalue1ã«å®ç¾©ãã¦AREAã§æ¸ãããã§ããLINE1ã«ããã¨ãããªæã
< AREA:value1#00FF00:"loadavg5" \ --- > LINE1:value1#00FF00:"loadavg5" \
æ®éã§ãããã¨ããã§è² è·600ã£ã¦ãªãããããã£ã¦ã®ã¯ãããSNMPã®äºæ
ã ã£ãã¯ããªã®ã§0.01ããã¦ããã¾ããã
rrdtool graph shoichi.example.com_loadavg5_3.png \ --title "load average 5 of shoichi.example.com" \ --start end-1w --end now \ --width 400 \ --height 180 \ DEF:value1=shoichi.example.com_loadavg5.rrd:value:AVERAGE \ CDEF:value2=value1,0.01,* \ AREA:value2#00FF00:"loadavg5" \
CDEFã§value1ã«0.01ãããã¦value2ãå®ç¾©ãAREAã§è¡¨ç¤ºã¨ãã¦ã¿ã¾ããã
ãã¦ãªã¤ã³ã°ã«ãã«ã¦ã±ãªã«ã©ã¼
rrdtool graphã«ã¯
[-c|--color COLORTAG#rrggbb[aa]]
RRDtool - rrdgraph
ã¨ãããªãã·ã§ã³ãããã¾ãã¦ãããã§è²ãå¤ããããã§ããããµã³ãã«ãç¡ãã®ã§ãµã³ãã«ä¸è¦§ãä½ãã¾ããã赤ãé¨åã該å½COLORTAGãªãã§ããããããã¾ãããï¼
ARROW | 軸ã®ç¢å° | |
---|---|---|
AXIS | 軸ã®è² | |
BACK | èæ¯ | |
CANVAS | ã°ã©ãå å´ã®èæ¯ | |
FONT | ãã©ã³ã | |
FRAME | å¡ä¾ã®æ | |
GRID | ã°ãªãã | |
MGRID | Mã°ãªãã | |
SHADEA | å½±A | |
SHADEB | å½±B |
ãããè¸ã¾ãã¦kibanaã¨ãã®ãããªå¨ï¼ãããããããããããªæãã«ãã¦ã¿â¦ãã¤ããããããªãã©ãã§ãã
rrdtool graph shoichi.example.com_loadavg5_5.png \ --title "load average 5 of shoichi.example.com" \ --start end-1w --end now \ --width 400 \ --height 180 \ --color FONT#FF8C00 \ --color ARROW#FF8C00 \ --color AXIS#FF8C00 \ --color BACK#222222 \ --color CANVAS#000000 \ --color SHADEA#222222 \ --color SHADEB#222222 \ DEF:value1=shoichi.example.com_loadavg5.rrd:value:AVERAGE \ CDEF:value2=value1,0.01,* \ AREA:value2#00FF00:"loadavg5" \
LINE1ã®ã»ãããã£ãè¯ãããï¼
æè¿ãªãããããªããããªæãã®ã»ããã¦ã±ããããªã®ã§
[-E|--slope-mode]
RRDtool - rrdgraph
ã¨ãããªãã·ã§ã³ãã¤ãã¦ã¿ã
ããã«ããã£ã½ãï¼ããããã«AREAãéãã¦LINE2ã«ããã¨ãããªã
rrdtool graph shoichi.example.com_loadavg5_8.png \ --title "load average 5 of shoichi.example.com" \ --start end-1w --end now \ --width 400 \ --height 180 \ --color FONT#FF8C00 \ --color ARROW#FF8C00 \ --color AXIS#FF8C00 \ --color BACK#222222 \ --color CANVAS#000000 \ --color SHADEA#222222 \ --color SHADEB#222222 \ --slope-mode \ DEF:value1=shoichi.example.com_loadavg5.rrd:value:AVERAGE \ CDEF:value2=value1,0.01,* \ AREA:value2#004000 \ LINE2:value2#00FF00:"loadavg5" \
ããã«è£ 飾ç·
CPUã®ã³ã¢æ°ã®ç·ãªãã¦æãã¦ã¿ãã¨è¯ããããªï¼èããã®é¢åãªã®ã§HRULEãã¿æ¸ãã§
> HRULE:2#FF0000:"cpu core":dashes=4 \
ã³ã¢æ°ãè¶ãã¦ãã¨ããã®èæ¯å¡ãã¤ã¶ãã¦ã¿ã¾ãã
å¡ãã¤ã¶ãã¯"GTããLTã§æ¯è¼ãã¦INFãããã¦ããAREA"ã§ããã¾ã
rrdtool graph shoichi.example.com_loadavg5_10.png \ --title "load average 5 of shoichi.example.com" \ --start end-1w --end now \ --width 400 \ --height 180 \ --color FONT#FF8C00 \ --color ARROW#FF8C00 \ --color AXIS#FF8C00 \ --color BACK#222222 \ --color CANVAS#000000 \ --color SHADEA#222222 \ --color SHADEB#222222 \ --slope-mode \ DEF:value1=shoichi.example.com_loadavg5.rrd:value:AVERAGE \ CDEF:value2=value1,0.01,* \ CDEF:over1=value2,2,GT,INF,* \ AREA:over1#662222 \ AREA:value2#004000 \ LINE2:value2#00FF00:"loadavg5" \ HRULE:2#FF0000:"cpu core":dashes=4 \
ããã«ã1é±éåã®ã°ã©ããæãã¦ããã¨æ¯è¼ããã®ã«ä¾¿å©ãªã®ã§æãã¦ã¿ã¾ããã
rrdtool graph shoichi.example.com_loadavg5_11.png \ --title "load average 5 of shoichi.example.com" \ --start end-1w --end now \ --width 400 \ --height 180 \ --color FONT#FF8C00 \ --color ARROW#FF8C00 \ --color AXIS#FF8C00 \ --color BACK#222222 \ --color CANVAS#000000 \ --color SHADEA#222222 \ --color SHADEB#222222 \ --slope-mode \ DEF:value1=shoichi.example.com_loadavg5.rrd:value:AVERAGE \ CDEF:value2=value1,0.01,* \ CDEF:value3=value2 \ SHIFT:value3:604800 \ CDEF:over1=value2,2,GT,INF,* \ AREA:over1#662222 \ AREA:value2#004000 \ LINE2:value2#00FF00:"loadavg5" \ LINE1:value3#FF8C00:"1 week ago" \ HRULE:2#FF0000:"cpu core":dashes=4 \
説æããã¨ããã®CDEF
CDEF:value3=value2 \
ã§ãã£ããvalue3ã«æ¸¡ãã¦
SHIFT:value3:604800 \
ããã§1é±éåãããã¦ã¾ããã§ã§ããã®ããã¡ã
â¦å¡ä¾åºã¦ããã©ã°ã©ãåºã¦ãã
ããããã®ã¯ã
--start end-1w --end now \
ãªã®ã§1é±éåãããã¼ã¿ããªãã®ã§ç·ãå¼ããªããã¨ãããã¨ã§2é±éåã®ãã¼ã¿ãDEFã§ã¨ãã¾ããã
< DEF:value1=shoichi.example.com_loadavg5.rrd:value:AVERAGE \ --- > DEF:value1=shoichi.example.com_loadavg5.rrd:value:AVERAGE:start=end-2w \
ç·ãåºã¦ãã¾ãã(ä¸ã®ç´°ããªã¬ã³ã¸ã®ç·)
"1é±éåã®å¤ã®2åãç¾å¨ã®å¤ãè¶
ããåºåãå¡ãã¤ã¶ã" ããã£ã¦ã¿ããã¨æãã¾ã
rrdtool graph shoichi.example.com_loadavg5_13.png \ --title "load average 5 of shoichi.example.com" \ --start end-1w --end now \ --width 400 \ --height 180 \ --color FONT#FF8C00 \ --color ARROW#FF8C00 \ --color AXIS#FF8C00 \ --color BACK#222222 \ --color CANVAS#000000 \ --color SHADEA#222222 \ --color SHADEB#222222 \ --slope-mode \ DEF:value1=shoichi.example.com_loadavg5.rrd:value:AVERAGE:start=end-2w \ CDEF:value2=value1,0.01,* \ CDEF:value3=value2 \ SHIFT:value3:604800 \ CDEF:over1=value2,2,GT,INF,* \ CDEF:over2=value3,2,*,value2,LT,INF,* \ AREA:over1#662222 \ AREA:over2#442244 \ AREA:value2#004000 \ LINE2:value2#00FF00:"loadavg5" \ LINE1:value3#FF8C00:"1 week ago" \ HRULE:2#FF0000:"cpu core":dashes=4 \
ãã£ãå¡ãã¤ã¶ããã®ãä¸æ¸ãããã¦ãã¾ãã¾ããâ¦ã®ã§ééã¤ããã¾ããã
< AREA:over2#442244 \ --- > AREA:over2#44224480 \
rrdtoolã®è²æå®ã¯ RGBééç ã ã£ãããã¾ããã§ã°ã©ãã¯ãããªæã
ãã¨ããªã§1æ¥ç§»åå¹³åç·æãã¦è¦ã¾ãã
æçµã®ã³ãã³ããªãã·ã§ã³ã¯ãã¡ã
rrdtool graph shoichi.example.com_loadavg5_15.png \ --title "load average 5 of shoichi.example.com" \ --start end-1w --end now \ --width 400 \ --height 180 \ --color FONT#FF8C00 \ --color ARROW#FF8C00 \ --color AXIS#FF8C00 \ --color BACK#222222 \ --color CANVAS#000000 \ --color SHADEA#222222 \ --color SHADEB#222222 \ --slope-mode \ DEF:value1=shoichi.example.com_loadavg5.rrd:value:AVERAGE:start=end-2w \ CDEF:value2=value1,0.01,* \ CDEF:value3=value2 \ SHIFT:value3:604800 \ CDEF:over1=value2,2,GT,INF,* \ CDEF:over2=value3,2,*,value2,LT,INF,* \ CDEF:sm=value2,86400,TREND \ AREA:over1#662222 \ AREA:over2#44224480 \ AREA:value2#004000 \ LINE2:value2#00FF00:"loadavg5" \ LINE1:value3#FF8C00:"1 week ago" \ LINE2:sm#FFFFFF80:"trend 1 day" \ HRULE:2#FF0000:"cpu core":dashes=4 \
ãã¶ã¤ã³ã®åé¡ãªã®ã§ãã¶ã¤ã³åãè²å½©æè¦ã®ç¡ãåã§ã¯éçããã¾ãããã¿ãªãããããã£ã¦ã¿ã¦ã«ãã³ããã°ã©ããæãã¦ã¿ã¦ãã ããã