{"id":65,"date":"2007-07-19T17:03:12","date_gmt":"2007-07-19T15:03:12","guid":{"rendered":"http:\/\/www.hermione.de\/blog\/?p=65"},"modified":"2008-06-05T17:28:20","modified_gmt":"2008-06-05T15:28:20","slug":"rrd","status":"publish","type":"post","link":"http:\/\/blog.hermione.de\/?p=65","title":{"rendered":"RRDTools &#8211; The Basics"},"content":{"rendered":"<p>Round Robin Database Tool is a data logging and graphing system for time series data. It works with a fixed amount of data.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/dadidi.ath.cx\/baru\/baru.png\" \/><\/p>\n<p><!--more--><\/p>\n<h4>RRD Set Up<\/h4>\n<p>Set up of an RRD called baru.rrd which accepts one number of baru value every 600 seconds. If no new data is supplied for more than 86400 seconds, the number of baru becomes *UNKNOWN*.  The minimum acceptable value is 0 and the maximum is 5000.<\/p>\n<p><em>rrdtool create baru00.rrd \\<br \/>\n&#8211;start 1181500000 \\<br \/>\n&#8211;step 600 \\<br \/>\nDS:baru:GAUGE:86400:0:5000 \\<br \/>\nRRA:AVERAGE:0.5:6:480<\/em><\/p>\n<p><em><strong>step<\/strong><\/em> specifies the base interval in seconds with which data will be fed into the RRD.<\/p>\n<p><em><strong>DS:ds-name:DST:heartbeat:min:max<\/strong><\/em> &#8211; data source<br \/>\n<em><strong>GAUGE<\/strong><\/em> is a data source type (details rtfm)<br \/>\n<em><strong>heartbeat<\/strong><\/em> defines the maximum number of seconds that may pass between two updates of this data source before the value of the data source is assumed to be *UNKNOWN*. If the interval between samples is less than heartbeat, then an average rate is calculated and applied for that interval. If the interval between samples is longer than &#8222;heartbeat&#8220;, then that entire interval is considered &#8222;unknown&#8220;.<br \/>\n<em><strong>min and max<\/strong><\/em> define the range of the data.<\/p>\n<p><em><strong>RRA:CF:xff:steps:rows<\/strong><\/em> &#8211; round robin archiv<br \/>\n<em><strong>AVERAGE<\/strong><\/em> &#8211; consolidation function<br \/>\n<em><strong>xff<\/strong><\/em> &#8211; xfiles factor defines what part of a consolidation interval may be made up from *UNKNOWN* data while the consolidated value is still regarded as known.<br \/>\n<em><strong>steps<\/strong><\/em> defines how many of these primary data points are used to build a consolidated data point which then goes into the archive.<br \/>\n<em><strong>rows<\/strong><\/em> defines how many generations of data values are kept in an RRA.<\/p>\n<p>RTFM. Further details at the manpage of rrdcreate :)<\/p>\n<hr \/>\n<h4>Feeding new data into the rrd<\/h4>\n<p>The update function feeds data values into an RRD. The data format is timestamp:value. Or if you use N:value time is set to current time.<\/p>\n<p><em>cat $infile | tr &#8220; &#8220; &#8222;:&#8220; |<br \/>\nwhile read line<br \/>\ndo<br \/>\nrrdtool update baru.rrd $line<br \/>\ndone<br \/>\n<\/em><\/p>\n<p>RTFM. Further details at the manpage of rrdupdate :)<\/p>\n<hr \/>\n<h4>Generating graphics<\/h4>\n<p>RRDTool lets you create graphs in PNG format for display on a web browser.<\/p>\n<p><em>rrdtool graph baru.png \\<br \/>\n&#8211;title &#8222;Baru Counter&#8220; \\<br \/>\n&#8211;vertical-label Barus \\<br \/>\n&#8211;start 1181500000 \\<br \/>\n&#8211;end 1182800000 \\<br \/>\n&#8211;x-grid HOUR:12:DAY:1:DAY:7:0:%Y-%m-%d \\<br \/>\nDEF:baru=baru00.rrd:baru:AVERAGE \\<br \/>\nAREA:baru#ccffcc:&#8220;filled&#8220; \\<br \/>\nLINE2:baru#00aa00<\/em><\/p>\n<p><em><strong>title<\/strong><\/em> &#8211; defines a title to be written into the graph.<br \/>\n<strong><em>start<\/em><\/strong> &#8211; time when the graph should begin [time in seconds since epoche]. Negative numbers are relative to the current time.<br \/>\n<strong><em>end<\/em><\/strong> &#8211; time when the graph should end.<\/p>\n<p><em><strong>DEF:vname=rrd:ds-name:CF<\/strong><\/em><br \/>\nThe DEF call automatically chooses an RRA which contains CF consolidated data in a resolution appropriate for the size of the graph to be drawn.  If the resolution of the RRA is the same as the resolution of the graph one data point from the RRA is be represented by one pixel in the graph.  If the resolution of the RRA is higher than the resolution of the graph, the data in the RRA will be further consolidated according to the consolidation function (CF) chosen.<\/p>\n<p>RTFM. Further details at the manpage of rrdgraph :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Round Robin Database Tool is a data logging and graphing system for time series data. It works with a fixed amount of data.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts\/65"}],"collection":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=65"}],"version-history":[{"count":0,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts\/65\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}