{"id":102,"date":"2009-10-21T14:35:00","date_gmt":"2009-10-21T14:35:00","guid":{"rendered":"http:\/\/antynet.pl\/index.php\/2009\/10\/21\/linux-rrdtool\/"},"modified":"2009-10-21T14:35:00","modified_gmt":"2009-10-21T14:35:00","slug":"linux-rrdtool","status":"publish","type":"post","link":"https:\/\/www.antynet.pl\/index.php\/2009\/10\/21\/linux-rrdtool\/","title":{"rendered":"LINUX RRDTOOL"},"content":{"rendered":"<p><span style=\"font-weight: bold;\">describe database creation<\/span>:<br \/>rrdtool create base.rrd -s 240 \\<br \/>DS:DS-NAME:<i>GAUGE | COUNTER | DERIVE | ABSOLUTE<\/i>:HEARTBEAT:0:U \\<br \/>RRA:CF:XFF:3:840<br \/>-s # step default is 300 sec<br \/>DS # DATA SOURCE<br \/>DS-NAME # variable name<br \/>RRA # ROUND ROBIN ARCHIVE &#8211; one archive in database<br \/>CF # CONSOLIDATION FUNCTION &#8211; MAX | MIN | AVERAGE | LAST<br \/>PDP # PRIMARY DATA POINT<br \/>XFF # XFILES FACTOR &#8211; factor, from 0 to 1 describe how many PDP can be&nbsp;&nbsp; UNKNOWN before record will be write to database as UNKNOWN<\/p>\n<p><span style=\"font-weight: bold;\">example:<\/span><br \/>rrdtool create base.rrd -s 240 \\<br \/>DS:input:COUNTER:600:0:U \\<br \/>RRA:AVERAGE:0.5:3:840<\/p>\n<p>base.rrd #database file<br \/><span style=\"color: blue;\">-s 240<\/span> #record step in database are set to 240 sec<br \/>input #data chain name<br \/><span style=\"color: blue;\">COUNTER<\/span> #counter type<br \/>(COUNTER &#8211; best for increasing values as network interfaces counters, you take into account that interface network counters is roll back when achieve top value 2<sup>32<\/sup> or 2 <sup>64<\/sup> and start from zero value<br \/>GAUGE &#8211; best for non increasing values)<\/p>\n<p><b>example of counting data:<\/b><br \/>value of first probe = 100<br \/>value of second probe = 150<br \/>value of third probe = 180<\/p>\n<p>for counter type &#8211; COUNTER<br \/>will be calculate difference 150-100=50 and 180-150=30<br \/>then depends on <span style=\"color: blue;\">RRA<\/span> ( <span style=\"color: blue;\">AVERAGE<\/span>, <span style=\"color: blue;\">MAX<\/span>, <span style=\"color: blue;\">MIN<\/span> or <span style=\"color: blue;\">LAST<\/span>),<br \/>values will be:<br \/>for AVERAGE=(50+30)\/2=40,<br \/>for MAX=50,<br \/>for MIN=30,<br \/>for LAST=30<\/p>\n<p>for counter type &#8211; GAUGE<br \/>will not be calculate difference<br \/>then depends on RRA<br \/>for AVERAGE= (100+150+180)\/3=143,<br \/>for MAX=180,<br \/>for MIN=100,<br \/>for LAST=180<\/p>\n<p><span style=\"color: blue;\">600<\/span> #600 sec, between each probe before probe will be marked as UNKNOWN,<br \/><span style=\"color: blue;\">0<\/span> #minimal value<br \/><span style=\"color: blue;\">U<\/span> #maximal value &#8222;U&#8221; is UNKNOWN<br \/><span style=\"color: blue;\">0.5<\/span> #ratio of UNKNOWN probes 0-1, 0.5 means 50%<br \/><span style=\"color: blue;\">3<\/span> #result of CF function will be get from 3 probes but 50% from them can be UNKNOWN<br \/><span style=\"color: blue;\">840<\/span> #maximal amount of probes which can be store in database (amount of records), you can not resize database file so it must be set at startup.<\/p>\n<p><i>let&#8217;s calculate how many probes should be store in our database during week:<\/i><\/p>\n<p>from previous settings we assume that value is generated from 3 probes which are collected every 240 sec<br \/>3*240=720 sec.<br \/>so final value will be store in database every 720 sec<br \/>720\/60=12 min.<br \/>means that every value in our html chart will be refresh every 12 min. <\/p>\n<p>3600\/720=5 probes per hour<br \/>24*3600\/720=120 probes per day,<br \/>7*24*3600\/720=840 probes per week<\/p>\n<p><b>other:<\/b><br \/>rrdtool dump [baza.rrd] [plik.xml] #export database to xml file<br \/>rrdtool fetch [baza.rrd] AVERAGE -s -6[min | h] #get records from last 6 min | hour.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>describe database creation:rrdtool create base.rrd -s 240 \\DS:DS-NAME:GAUGE | COUNTER | DERIVE | ABSOLUTE:HEARTBEAT:0:U \\RRA:CF:XFF:3:840-s # step default is 300 secDS # DATA SOURCEDS-NAME # variable nameRRA # ROUND ROBIN ARCHIVE &#8211; one archive in databaseCF # CONSOLIDATION FUNCTION &#8211; MAX | MIN | AVERAGE | LASTPDP # PRIMARY DATA POINTXFF # XFILES FACTOR &#8211; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1],"tags":[19],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-bez-kategorii","tag-linux-rrdtool"],"_links":{"self":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":0,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}