Code

Imported upstream version 1.4.2.
[pkg-rrdtool.git] / doc / rrdtutorial.html
index 86eb7dba1d59f948910c56a1cfae6786993e2a51..4d8dede28021eb8a9573e94627d9a7a2cb8e4e21 100644 (file)
@@ -9,8 +9,10 @@
 
 <body style="background-color: white">
 
-<p><a name="__index__"></a></p>
+
 <!-- INDEX BEGIN -->
+<div name="index">
+<p><a name="__index__"></a></p>
 <!--
 
 <ul>
        <li><a href="#see_also">SEE ALSO</a></li>
        <li><a href="#author">AUTHOR</a></li>
 </ul>
+
 -->
+
+
+</div>
 <!-- INDEX END -->
 
 <p>
 </p>
+<hr />
 <h1><a name="name">NAME</a></h1>
 <p>rrdtutorial - Alex van den Bogaerdt's RRDtool tutorial</p>
 <p>
@@ -60,7 +67,7 @@
 <h1><a name="description">DESCRIPTION</a></h1>
 <p>RRDtool is written by Tobias Oetiker &lt;<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>&gt; with
 contributions from many people all around the world. This document is
-written by Alex van den Bogaerdt &lt;<a href="mailto:alex@ergens.op.het.net">alex@ergens.op.het.net</a>&gt; to help you
+written by Alex van den Bogaerdt &lt;<a href="mailto:alex@vandenbogaerdt.nl">alex@vandenbogaerdt.nl</a>&gt; to help you
 understand what RRDtool is and what it can do for you.</p>
 <p>The documentation provided with RRDtool can be too technical for some
 people. This tutorial is here to help you understand the basics of
@@ -77,14 +84,30 @@ networking.</p>
 <p>Please don't skip ahead in this document!  The first part of this
 document explains the basics and may be boring.  But if you don't
 understand the basics, the examples will not be as meaningful to you.</p>
+<p>Sometimes things change.  This example used to provide numbers like
+&quot;0.04&quot; in stead of &quot;4.00000e-02&quot;.  Those are really the same numbers,
+just written down differently.  Don't be alarmed if a future version
+of rrdtool displays a slightly different form of output. The examples
+in this document are correct for version 1.2.0 of RRDtool.</p>
+<p>Also, sometimes bugs do occur. They may also influence the outcome of
+the examples. Example speed4.png was suffering from this (the handling
+of unknown data in an if-statement was wrong). Normal data will be
+just fine (a bug in rrdtool wouldn't last long) but special cases like
+NaN, INF and so on may last a bit longer.  Try another version if you
+can, or just live with it.</p>
+<p>I fixed the speed4.png example (and added a note). There may be other
+examples which suffer from the same or a similar bug.  Try to fix it
+yourself, which is a great excercise. But please do not submit your
+result as a fix to the source of this document. Discuss it on the
+user's list, or write to me.</p>
 <p>
 </p>
 <h2><a name="what_is_rrdtool">What is RRDtool?</a></h2>
 <p>RRDtool refers to Round Robin Database tool.
 Round robin is a technique that works with a fixed amount of data, and a
 pointer to the current element. Think of a circle with some dots plotted
-on the edge -- these dots are the places where data can be stored. Draw an
-arrow from the center of the circle to one of the dots -- this is the pointer.
+on the edge. These dots are the places where data can be stored. Draw an
+arrow from the center of the circle to one of the dots; this is the pointer.
 When the current data is read or written, the pointer moves to the next
 element. As we are on a circle there is neither a beginning nor an end, you can
 go on and on and on. After a while, all the available places will be used and
@@ -95,14 +118,14 @@ data from them.</p>
 <p>
 </p>
 <h2><a name="what_data_can_be_put_into_an_rrd">What data can be put into an RRD?</a></h2>
-<p>You name it, it will probably fit as long as it is some sort of time-series
-data. This means you have to be able to measure some value at several points in time and
-provide this information to RRDtool. If you can do this, RRDtool will be
-able to store it. The values must be numerical but don't have to be
-integers, as is the case with MRTG (the next section will give more details
-on this more specialized application).</p>
+<p>You name it, it will probably fit as long as it is some sort of
+time-series data. This means you have to be able to measure some value
+at several points in time and provide this information to RRDtool. If
+you can do this, RRDtool will be able to store it. The values must be
+numerical but don't have to be integers, as is the case with MRTG (the
+next section will give more details on this more specialized application).</p>
 <p>Many examples below talk about SNMP which is an acronym for Simple Network
-Management Protocol. ``Simple'' refers to the protocol -- it does not
+Management Protocol. &quot;Simple&quot; refers to the protocol. It does not
 mean it is simple to manage or monitor a network. After working your
 way through this document, you should know enough to be able to
 understand what people are talking about. For now, just realize that
@@ -118,11 +141,11 @@ graphing other data sources including temperature, speed, voltage,
 number of printouts and the like.</p>
 <p>Most likely you will start to use RRDtool to store and process data
 collected via SNMP. The data will most likely be bytes (or bits)
-transfered from and to a network or a computer.  But it can also be
+transferred from and to a network or a computer.  But it can also be
 used to display tidal waves, solar radiation, power consumption,
 number of visitors at an exhibition, noise levels near an airport,
 temperature on your favorite holiday location, temperature in the
-fridge and whatever you imagination can come up with.</p>
+fridge and whatever your imagination can come up with.</p>
 <p>You only need a sensor to measure the data and be able to feed the
 numbers into RRDtool. RRDtool then lets you create a database, store
 data in it, retrieve that data and create graphs in PNG format for
@@ -148,8 +171,8 @@ and not only for this particular one. Look in the documentation that
 came with RRDtool for the location and usage of the list.</p>
 <p>I suggest you take a moment to subscribe to the mailing list right now
 by sending an email to &lt;<a href="mailto:rrd-users-request@lists.oetiker.ch">rrd-users-request@lists.oetiker.ch</a>&gt; with a
-subject of ``subscribe''. If you ever want to leave this list, just write
-an email to the same address but now with a subject of ``unsubscribe''.</p>
+subject of &quot;subscribe&quot;. If you ever want to leave this list, just write
+an email to the same address but now with a subject of &quot;unsubscribe&quot;.</p>
 <p>
 </p>
 <h2><a name="how_will_you_help_me">How will you help me?</a></h2>
@@ -174,7 +197,7 @@ or compare kilometers (miles if you wish) with bits and bytes. It's
 all the same: some number over some time.</p>
 <p>Assume we have a device that transfers bytes to and from the Internet.
 This device keeps a counter that starts at zero when it is turned on,
-increasing with every byte that is transfered. This counter will probably have
+increasing with every byte that is transferred. This counter will probably have
 a maximum value. If this value is reached and an extra byte is counted,
 the counter starts over at zero. This is the same as many counters
 in the world such as the mileage counter in a car.</p>
@@ -182,10 +205,10 @@ in the world such as the mileage counter in a car.</p>
 get used to that right away. Assume a byte is eight bits and start to
 think in bits not bytes. The counter, however, still counts bytes!
 In the SNMP world most of the counters are 32 bits. That means they are
-counting from 0 to 4'294'967'295. We will use these values in the examples.
+counting from 0 to 4294967295. We will use these values in the examples.
 The device, when asked, returns the current value of the counter. We
 know the time that has passes since we last asked so we now know how
-many bytes have been transfered ***on average*** per second. This is
+many bytes have been transferred ***on average*** per second. This is
 not very hard to calculate. First in words, then in calculations:</p>
 <ol>
 <li>
@@ -208,30 +231,30 @@ Do not try this example, and if you do, don't blame me for the results!</p>
 most into miles per hour by dividing km by 1.6 (close enough).
 I will use the following abbreviations:</p>
 <pre>
M:    meter
KM:   kilometer (= 1'000 meters).
H:    hour
S:    second
KM/H: kilometers per hour
M/S:  meters per second</pre>
m:    meter
km:   kilometer (= 1000 meters).
h:    hour
s:    second
km/h: kilometers per hour
m/s:  meters per second</pre>
 <p>You are driving a car. At 12:05 you read the counter in the dashboard
-and it tells you that the car has moved 12'345 KM until that moment.
-At 12:10 you look again, it reads 12'357 KM. This means you have
-traveled 12 KM in five minutes. A scientist would translate that
+and it tells you that the car has moved 12345 km until that moment.
+At 12:10 you look again, it reads 12357 km. This means you have
+traveled 12 km in five minutes. A scientist would translate that
 into meters per second and this makes a nice comparison toward the
 problem of (bytes per five minutes) versus (bits per second).</p>
-<p>We traveled 12 kilometers which is 12'000 meters. We did that in five
-minutes or 300 seconds. Our speed is 12'000M / 300S or 40 M/S.</p>
-<p>We could also calculate the speed in KM/H: 12 times 5 minutes
-is an hour, so we have to multiply 12 KM by 12 to get 144 KM/H.
-For our native English speaking friends: that's 90 MPH so don't
+<p>We traveled 12 kilometers which is 12000 meters. We did that in five
+minutes or 300 seconds. Our speed is 12000m / 300s or 40 m/s.</p>
+<p>We could also calculate the speed in km/h: 12 times 5 minutes
+is an hour, so we have to multiply 12 km by 12 to get 144 km/h.
+For our native English speaking friends: that's 90 mph so don't
 try this example at home or where I live :)</p>
 <p>Remember: these numbers are averages only.  There is no way to figure out
 from the numbers, if you drove at a constant speed.  There is an example
 later on in this tutorial that explains this.</p>
-<p>I hope you understand that there is no difference in calculating M/S or
-bps; only the way we collect the data is different. Even the K from kilo
-is the same as in networking terms k also means 1'000.</p>
+<p>I hope you understand that there is no difference in calculating m/s or
+bps; only the way we collect the data is different. Even the k from kilo
+is the same as in networking terms k also means 1000.</p>
 <p>We will now create a database where we can keep all these interesting
 numbers. The method used to start the program may differ slightly from
 OS to OS, but I assume you can figure it out if it works different on
@@ -251,8 +274,8 @@ and skip all of the '\' characters.</p>
 <h2><a name="what_has_been_created">What has been created?</a></h2>
 <p>We created the round robin database called test (test.rrd) which starts at
 noon the day I started writing this document, 7th of March, 1999 (this date
-translates to 920'804'400 seconds as explained below). Our database holds
-one data source (DS) named ``speed'' that represents a counter. This counter
+translates to 920804400 seconds as explained below). Our database holds
+one data source (DS) named &quot;speed&quot; that represents a counter. This counter
 is read every five minutes (this is the default therefore you don't have to
 put <code>--step=300</code>).  In the same database two round robin archives (RRAs)
 are kept, one averages the data every time it is read (e.g., there's nothing
@@ -266,25 +289,25 @@ it will therefore look different for different time zones.</p>
 This means your time zone is different. In all examples where I talk
 about time, the hours may be wrong for you. This has little effect on
 the results of the examples, just correct the hours while reading.
-As an example: where I will see ``12:05'' the UK folks will see ``11:05''.</p>
+As an example: where I will see &quot;12:05&quot; the UK folks will see &quot;11:05&quot;.</p>
 <p>We now have to fill our database with some numbers. We'll pretend to
 have read the following numbers:</p>
 <pre>
- 12:05  12345 KM
- 12:10  12357 KM
- 12:15  12363 KM
- 12:20  12363 KM
- 12:25  12363 KM
- 12:30  12373 KM
- 12:35  12383 KM
- 12:40  12393 KM
- 12:45  12399 KM
- 12:50  12405 KM
- 12:55  12411 KM
- 13:00  12415 KM
- 13:05  12420 KM
- 13:10  12422 KM
- 13:15  12423 KM</pre>
+ 12:05  12345 km
+ 12:10  12357 km
+ 12:15  12363 km
+ 12:20  12363 km
+ 12:25  12363 km
+ 12:30  12373 km
+ 12:35  12383 km
+ 12:40  12393 km
+ 12:45  12399 km
+ 12:50  12405 km
+ 12:55  12411 km
+ 13:00  12415 km
+ 13:05  12420 km
+ 13:10  12422 km
+ 13:15  12423 km</pre>
 <p>We fill the database as follows:</p>
 <pre>
  rrdtool update test.rrd 920804700:12345 920805000:12357 920805300:12363
@@ -300,7 +323,7 @@ have read the following numbers:</p>
 <p>As you can see, it is possible to feed more than one value into the
 database in one command. I had to stop at three for readability but
 the real maximum per line is OS dependent.</p>
-<p>We can now retrieve the data from our database using ``rrdtool fetch'':</p>
+<p>We can now retrieve the data from our database using &quot;rrdtool fetch&quot;:</p>
 <pre>
  rrdtool fetch test.rrd AVERAGE --start 920804400 --end 920809200</pre>
 <p>It should return the following output:</p>
@@ -324,16 +347,11 @@ the real maximum per line is OS dependent.</p>
  920808900: 3.3333333333e-03
  920809200: nan</pre>
 <p>If it doesn't, something may be wrong.  Perhaps your OS will print
-``NaN'' in a different form. ``NaN'' stands for ``Not A Number''.  If your OS
-writes ``U'' or ``UNKN'' or something similar that's okay.  If something
+&quot;NaN&quot; in a different form. &quot;NaN&quot; stands for &quot;Not A Number&quot;.  If your OS
+writes &quot;U&quot; or &quot;UNKN&quot; or something similar that's okay.  If something
 else is wrong, it will probably be due to an error you made (assuming
 that my tutorial is correct of course :-). In that case: delete the
-database and try again.  Sometimes things change.  This example used
-to provide numbers like ``0.04'' in stead of ``4.00000e-02''.  Those are
-really the same numbers, just written down differently.  Don't be
-alarmed if a future version of rrdtool displays a slightly different
-form of output. The examples in this document are correct for version
-1.2.0 of RRDtool.</p>
+database and try again.</p>
 <p>The meaning of the above output will become clear below.</p>
 <p>
 </p>
@@ -346,7 +364,7 @@ form of output. The examples in this document are correct for version
          LINE2:myspeed#FF0000</pre>
 <p>This will create speed.png which starts at 12:00 and ends at 13:00.
 There is a definition of a variable called myspeed, using the data from RRA
-``speed'' out of database ``test.rrd''. The line drawn is 2 pixels high
+&quot;speed&quot; out of database &quot;test.rrd&quot;. The line drawn is 2 pixels high
 and represents the variable myspeed. The color is red (specified by
 its rgb-representation, see below).</p>
 <p>You'll notice that the start of the graph is not at 12:00 but at 12:05.
@@ -357,34 +375,34 @@ not happen a lot, hopefully.</p>
 <p>The colors are built up from red, green and blue. For each of the
 components, you specify how much to use in hexadecimal where 00 means
 not included and FF means fully included.
-The ``color'' white is a mixture of red, green and blue: FFFFFF
-The ``color'' black is all colors off: 000000</p>
+The &quot;color&quot; white is a mixture of red, green and blue: FFFFFF
+The &quot;color&quot; black is all colors off: 000000</p>
 <pre>
    red     #FF0000
    green   #00FF00
    blue    #0000FF
    magenta #FF00FF     (mixed red with blue)
    gray    #555555     (one third of all components)</pre>
-<p>Additionally you can add an alpha channel (transparency).  The default
-will be ``FF'' which means non-transparent.</p>
+<p>Additionally you can (with a recent RRDtool)  add an alpha channel
+(transparency).  The default will be &quot;FF&quot; which means non-transparent.</p>
 <p>The PNG you just created can be displayed using your favorite image
 viewer.  Web browsers will display the PNG via the URL
-``file:///the/path/to/speed.png''</p>
+&quot;file:///the/path/to/speed.png&quot;</p>
 <p>
 </p>
 <h2><a name="graphics_with_some_math">Graphics with some math</a></h2>
 <p>When looking at the image, you notice that the horizontal axis is labeled
 12:10, 12:20, 12:30, 12:40 and 12:50. Sometimes a label doesn't fit (12:00
-and 13:00 would be candidates) so they are skipped.</p>
+and 13:00 would be likely candidates) so they are skipped.</p>
 <p>The vertical axis displays the range we entered. We provided
 kilometers and when divided by 300 seconds, we get very small
-numbers. To be exact, the first value was 12 (12'357-12'345) and divided
-by 300 this makes 0.04, which is displayed by RRDtool as ``40 m''
-meaning ``40/1'000''. The ``m'' (milli) has nothing to do with meters,
+numbers. To be exact, the first value was 12 (12357-12345) and divided
+by 300 this makes 0.04, which is displayed by RRDtool as &quot;40 m&quot;
+meaning &quot;40/1000&quot;. The &quot;m&quot; (milli) has nothing to do with meters (also m),
 kilometers or millimeters! RRDtool doesn't know about the physical
 units of our data, it just works with dimensionless numbers.</p>
 <p>If we had measured our distances in meters, this would have been
-(12'357'000-12'345'000)/300 = 12'000/300 = 40.</p>
+(12357000-12345000)/300 = 12000/300 = 40.</p>
 <p>As most people have a better feel for numbers in this range, we'll
 correct that. We could recreate our database and store the correct
 data, but there is a better way: we do some calculations while creating
@@ -396,31 +414,37 @@ the png file!</p>
       DEF:myspeed=test.rrd:speed:AVERAGE              \
       CDEF:realspeed=myspeed,1000,\*                  \
       LINE2:realspeed#FF0000</pre>
-<p>Note: Make sure not to forget the backslash \ in front of the
-multiplication operator * above. The backslash is needed to ``escape''
-the * as some operating systems might interpret and expand * instead
-of passing it to the rrdtool command.</p>
-<p>After viewing this PNG, you notice the ``m'' (milli) has
+<p>Note: I need to escape the multiplication operator * with a backslash.
+If I don't, the operating system may interpret it and use it for file
+name expansion. You could also place the line within quotation marks
+like so:</p>
+<pre>
+      &quot;CDEF:realspeed=myspeed,1000,*&quot;                  \</pre>
+<p>It boils down to: it is RRDtool which should see *, not your shell.
+And it is your shell interpreting \, not RRDtool. You may need to
+adjust examples accordingly if you happen to use an operating
+system or shell which behaves differently.</p>
+<p>After viewing this PNG, you notice the &quot;m&quot; (milli) has
 disappeared. This it what the correct result would be. Also, a label
 has been added to the image.  Apart from the things mentioned above,
 the PNG should look the same.</p>
 <p>The calculations are specified in the CDEF part above and are in
-Reverse Polish Notation (``RPN''). What we requested RRDtool to do is:
-``take the data source myspeed and the number 1000; multiply
-those''. Don't bother with RPN yet, it will be explained later on in
+Reverse Polish Notation (&quot;RPN&quot;). What we requested RRDtool to do is:
+&quot;take the data source myspeed and the number 1000; multiply
+those&quot;. Don't bother with RPN yet, it will be explained later on in
 more detail. Also, you may want to read my tutorial on CDEFs and Steve
 Rader's tutorial on RPN. But first finish this tutorial.</p>
-<p>Hang on! If we can multiply values with 1'000, it should also be possible
+<p>Hang on! If we can multiply values with 1000, it should also be possible
 to display kilometers per hour from the same data!</p>
 <p>To change a value that is measured in meters per second:</p>
 <pre>
- Calculate meters per hour:     value * 3'600
- Calculate kilometers per hour: value / 1'000
- Together this makes:           value * (3'600/1'000) or value * 3.6</pre>
+ Calculate meters per hour:     value * 3600
+ Calculate kilometers per hour: value / 1000
+ Together this makes:           value * (3600/1000) or value * 3.6</pre>
 <p>In our example database we made a mistake and we need to compensate for
-this by multiplying with 1'000. Applying that correction:</p>
+this by multiplying with 1000. Applying that correction:</p>
 <pre>
- value * 3.6  * 1'000 == value * 3'600</pre>
+ value * 3.6  * 1000 == value * 3600</pre>
 <p>Now let's create this PNG, and add some more magic ...</p>
 <pre>
  rrdtool graph speed3.png                             \
@@ -435,7 +459,7 @@ this by multiplying with 1'000. Applying that correction:</p>
       AREA:fast#FF0000:&quot;Too fast&quot;</pre>
 <p>Note: here we use another means to escape the * operator by enclosing
 the whole string in double quotes.</p>
-<p>This graph looks much better. Speed is shown in KM/H and there is even
+<p>This graph looks much better. Speed is shown in km/h and there is even
 an extra line with the maximum allowed speed (on the road I travel
 on). I also changed the colors used to display speed and changed it
 from a line into an area.</p>
@@ -459,7 +483,8 @@ following PNG:</p>
       --start 920804400 --end 920808000               \
       --vertical-label km/h                           \
       DEF:myspeed=test.rrd:speed:AVERAGE              \
-      &quot;CDEF:kmh=myspeed,3600,*&quot;                       \
+      CDEF:nonans=myspeed,UN,0,myspeed,IF             \
+      CDEF:kmh=nonans,3600,*                          \
       CDEF:fast=kmh,100,GT,100,0,IF                   \
       CDEF:over=kmh,100,GT,kmh,100,-,0,IF             \
       CDEF:good=kmh,100,GT,0,kmh,IF                   \
@@ -467,6 +492,9 @@ following PNG:</p>
       AREA:good#00FF00:&quot;Good speed&quot;                   \
       AREA:fast#550000:&quot;Too fast&quot;                     \
       STACK:over#FF0000:&quot;Over speed&quot;</pre>
+<p>Remember the note in the beginning?  I had to remove unknown data from
+this example. The 'nonans' CDEF is new, and the 6th line (which used to
+be the 5th line) used to read 'CDEF:kmh=myspeed,3600,*'</p>
 <p>Let's create a quick and dirty HTML page to view the three PNGs:</p>
 <pre>
    &lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;Speed&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;
@@ -476,7 +504,7 @@ following PNG:</p>
    &lt;BR&gt;
    &lt;IMG src=&quot;speed4.png&quot; alt=&quot;Traveled too fast?&quot;&gt;
    &lt;/BODY&gt;&lt;/HTML&gt;</pre>
-<p>Name the file ``speed.html'' or similar, and look at it in your web browser.</p>
+<p>Name the file &quot;speed.html&quot; or similar, and look at it in your web browser.</p>
 <p>Now, all you have to do is measure the values regularly and update the
 database.  When you want to view the data, recreate the PNGs and make
 sure to refresh them in your browser. (Note: just clicking reload may
@@ -486,9 +514,9 @@ or ctrl-F5).</p>
 </p>
 <h2><a name="updates_in_reality">Updates in Reality</a></h2>
 <p>We've already used the <code>update</code> command: it took one or more
-parameters in the form of ``&lt;time&gt;:&lt;value&gt;''. You'll be glad to know
-that you can specify the current time by filling in a ``N'' as the time.
-Or you could use the ``time'' function in Perl (the shortest example in
+parameters in the form of &quot;&lt;time&gt;:&lt;value&gt;&quot;. You'll be glad to know
+that you can specify the current time by filling in a &quot;N&quot; as the time.
+Or you could use the &quot;time&quot; function in Perl (the shortest example in
 this tutorial):</p>
 <pre>
    perl -e 'print time, &quot;\n&quot; '</pre>
@@ -513,8 +541,8 @@ coffee machine, a device that counts the electricity used,
 whatever. Any incrementing counter can be monitored and graphed using
 the stuff you learned so far. Later on we will also be able to monitor
 other types of values like temperature.</p>
-<p>Most (?) people interested in RRDtool will use the counter that keeps track
-of octets (bytes) transfered by a network device. So let's do just
+<p>Many people interested in RRDtool will use the counter that keeps track
+of octets (bytes) transferred by a network device. So let's do just
 that next. We will start with a description of how to collect data.</p>
 <p>Some people will make a remark that there are tools which can do this data
 collection for you. They are right! However, I feel it is important that
@@ -522,7 +550,7 @@ you understand they are not necessary. When you have to determine why
 things went wrong you need to know how they work.</p>
 <p>One tool used in the example has been talked about very briefly in the
 beginning of this document, it is called SNMP. It is a way of talking
-to networked equipment. The tool I use below is called ``snmpget'' and
+to networked equipment. The tool I use below is called &quot;snmpget&quot; and
 this is how it works:</p>
 <pre>
    snmpget device password OID</pre>
@@ -530,14 +558,14 @@ this is how it works:</p>
 <pre>
    snmpget -v[version] -c[password] device OID</pre>
 <p>For device you substitute the name, or the IP address, of your device.
-For password you use the ``community read string'' as it is called in the
-SNMP world.  For some devices the default of ``public'' might work, however
+For password you use the &quot;community read string&quot; as it is called in the
+SNMP world.  For some devices the default of &quot;public&quot; might work, however
 this can be disabled, altered or protected for privacy and security
 reasons.  Read the documentation that comes with your device or program.</p>
-<p>Then there is this parameter, called OID, which means ``object identifier''.</p>
+<p>Then there is this parameter, called OID, which means &quot;object identifier&quot;.</p>
 <p>When you start to learn about SNMP it looks very confusing. It isn't
 all that difficult when you look at the Management Information Base
-(``MIB'').  It is an upside-down tree that describes data, with a single node
+(&quot;MIB&quot;).  It is an upside-down tree that describes data, with a single node
 as the root and from there a number of branches.  These branches end
 up in another node, they branch out, etc.  All the branches have a name
 and they form the path that we follow all the way down.  The branches
@@ -553,7 +581,7 @@ you specify the complete OID.  Often those programs will leave out
 the default portion when returning the data to you.  To make things
 worse, they have several default prefixes ...</p>
 <p>Ok, lets continue to the start of our OID: we had 1.3.6.1.2.1
-From there, we are especially interested in the branch ``interfaces''
+From there, we are especially interested in the branch &quot;interfaces&quot;
 which has number 2 (e.g., 1.3.6.1.2.1.2 or 1.3.6.1.2.1.interfaces).</p>
 <p>First, we have to get some SNMP program. First look if there is a
 pre-compiled package available for your OS. This is the preferred way.
@@ -570,12 +598,12 @@ adapt the example to make it work.</p>
    snmpget -v2c -c public myrouter system.sysDescr.0</pre>
 <p>The device should answer with a description of itself, perhaps an
 empty one. Until you got a valid answer from a device, perhaps using a
-different ``password'', or a different device, there is no point in
+different &quot;password&quot;, or a different device, there is no point in
 continuing.</p>
 <pre>
    snmpget -v2c -c public myrouter interfaces.ifNumber.0</pre>
 <p>Hopefully you get a number as a result, the number of interfaces.
-If so, you can carry on and try a different program called ``snmpwalk''.</p>
+If so, you can carry on and try a different program called &quot;snmpwalk&quot;.</p>
 <pre>
    snmpwalk -v2c -c public myrouter interfaces.ifTable.ifEntry.ifDescr</pre>
 <p>If it returns with a list of interfaces, you're almost there.
@@ -587,7 +615,7 @@ Here's an example:
    interfaces.ifTable.ifEntry.ifDescr.3 = &quot;BRI0&quot; Hex: 42 52 49 30
    interfaces.ifTable.ifEntry.ifDescr.4 = &quot;Ethernet0&quot;
    interfaces.ifTable.ifEntry.ifDescr.5 = &quot;Loopback0&quot;</pre>
-<p>On this cisco equipment, I would like to monitor the ``Ethernet0''
+<p>On this cisco equipment, I would like to monitor the &quot;Ethernet0&quot;
 interface and from the above output I see that it is number four. I try:</p>
 <pre>
    [user@host /home/alex]$ snmpget -v2c -c public cisco 2.2.1.10.4 2.2.1.16.4</pre>
@@ -632,9 +660,9 @@ amount of data:</p>
  732 1-day samples:     732   days</pre>
 <p>These ranges are appended, so the total amount of data stored in the
 database is approximately 797 days. RRDtool stores the data
-differently, it doesn't start the ``weekly'' archive where the ``daily''
+differently, it doesn't start the &quot;weekly&quot; archive where the &quot;daily&quot;
 archive stopped. For both archives the most recent data will be near
-``now'' and therefore we will need to keep more data than MRTG does!</p>
+&quot;now&quot; and therefore we will need to keep more data than MRTG does!</p>
 <p>We will need:</p>
 <pre>
  600 samples of 5 minutes  (2 days and 2 hours)
@@ -678,10 +706,10 @@ to do exactly on your OS to make it work.</p>
             AREA:inoctets#00FF00:&quot;In traffic&quot; \
             LINE1:outoctets#0000FF:&quot;Out traffic&quot;</pre>
 <p>This should produce a picture with one day worth of traffic.
-One day is 24 hours of 60 minutes of 60 seconds: 24*60*60=86'400, we
-start at now minus 86'400 seconds. We define (with DEFs) inoctets and
+One day is 24 hours of 60 minutes of 60 seconds: 24*60*60=86400, we
+start at now minus 86400 seconds. We define (with DEFs) inoctets and
 outoctets as the average values from the database myrouter.rrd and draw
-an area for the ``in'' traffic and a line for the ``out'' traffic.</p>
+an area for the &quot;in&quot; traffic and a line for the &quot;out&quot; traffic.</p>
 <p>View the image and keep logging data for a few more days.
 If you like, you could try the examples from the test database and
 see if you can get various options and calculations to work.</p>
@@ -695,15 +723,15 @@ second.</p>
 the maximum values instead of the average values. Let's go
 into this a bit more.</p>
 <p>Recall all the stuff about the speed of the car. Suppose we drove at 144
-KM/H during 5 minutes and then were stopped by the police for 25 minutes.
+km/h during 5 minutes and then were stopped by the police for 25 minutes.
 At the end of the lecture we would take our laptop and create and view the
 image taken from the database. If we look at the second RRA we did
 create, we would have the average from 6 samples. The samples measured
 would be 144+0+0+0+0+0=144, divided by 30 minutes, corrected for the
-error by 1000, translated into KM/H, with a result of 24 KM/H.
+error by 1000, translated into km/h, with a result of 24 km/h.
 I would still get a ticket but not for speeding anymore :)</p>
 <p>Obviously, in this case we shouldn't look at the averages. In some
-cases they are handy. If you want to know how many KM you had traveled,
+cases they are handy. If you want to know how many km you had traveled,
 the averaged picture would be the right one to look at. On the other hand, for
 the speed that we traveled at, the maximum numbers seen is much more
 interesting. Later we will see more types.</p>
@@ -713,19 +741,19 @@ Over time, they will grow apart more and more. In the last database
 we have created, there are two archives that keep data per day. The
 archive that keeps averages will show low numbers, the archive that
 shows maxima will have higher numbers.</p>
-<p>For my car this would translate in averages per day of 96/24=4 KM/H
+<p>For my car this would translate in averages per day of 96/24=4 km/h
 (as I travel about 94 kilometers on a day) during working days, and
-maxima of 120 KM/H (my top speed that I reach every day).</p>
+maxima of 120 km/h (my top speed that I reach every day).</p>
 <p>Big difference. Do not look at the second graph to estimate the
 distances that I travel and do not look at the first graph to
 estimate my speed. This will work if the samples are close together,
 as they are in five minutes, but not if you average.</p>
 <p>On some days, I go for a long ride. If I go across Europe and travel
-for 12 hours, the first graph will rise to about 60 KM/H. The second
-one will show 180 KM/H. This means that I traveled a distance of 60
-KM/H times 24 H = 1440 KM. I did this with a higher speed and a
-maximum around 180 KM/H. However, it probably doesn't mean that I
-traveled for 8 hours at a constant speed of 180 KM/H!</p>
+for 12 hours, the first graph will rise to about 60 km/h. The second
+one will show 180 km/h. This means that I traveled a distance of 60
+km/h times 24 h = 1440 km. I did this with a higher speed and a
+maximum around 180 km/h. However, it probably doesn't mean that I
+traveled for 8 hours at a constant speed of 180 km/h!</p>
 <p>This is a real example: go with the flow through Germany (fast!) and stop
 a few times for gas and coffee. Drive slowly through Austria and the
 Netherlands. Be careful in the mountains and villages. If you would
@@ -740,7 +768,7 @@ period of time. Therefore we average it, eventually to one value per
 day. From this one value, we cannot see much detail, of course.</p>
 <p>Make sure you understand the last few paragraphs. There is no value
 in only a line and a few axis, you need to know what they mean and
-interpret the data in ana appropriate way. This is true for all data.</p>
+interpret the data in an appropriate way. This is true for all data.</p>
 <p>The biggest mistake you can make is to use the collected data for
 something that it is not suitable for. You would be better off if
 you didn't have the graph at all.</p>
@@ -749,8 +777,8 @@ you didn't have the graph at all.</p>
 <h2><a name="let_s_review_what_you_now_should_know">Let's review what you now should know</a></h2>
 <p>You know how to create a database and can put data in it. You can get
 the numbers out again by creating an image, do math on the data from
-the database and view the resulte instead of the raw data.  You know
-about the difference between averages and maxima, and when to use
+the database and view the result instead of the raw data.  You know
+about the difference between averages and maximum, and when to use
 which (or at least you should have an idea).</p>
 <p>RRDtool can do more than what we have learned up to now. Before you
 continue with the rest of this doc, I recommend that you reread from
@@ -792,7 +820,7 @@ GAUGE. There are more such data types:</p>
 counter with one difference: RRDtool assumes the counter is reset when
 it's read. That is: its delta is known without calculation by RRDtool
 whereas RRDtool needs to calculate it for the counter type.
-Example: our first example (12'345, 12'357, 12'363, 12'363) would read:
+Example: our first example (12345, 12357, 12363, 12363) would read:
 unknown, 12, 6, 0. The rest of the calculations stay the same.
 The other one, derive, is like counter. Unlike counter, it can also
 decrease so it can have a negative delta. Again, the rest of the
@@ -832,12 +860,12 @@ difference by the amount of time lapsed. This should end up as a
 straight line at 1 (the deltas are 300, the time is 300).</p>
 </li>
 <li>
-<p>Line B is of type GAUGE. These are ``real'' values so they should match
+<p>Line B is of type GAUGE. These are &quot;real&quot; values so they should match
 what we put in: a sort of a wave.</p>
 </li>
 <li>
 <p>Line C is of type DERIVE. It should be a counter that can decrease. It does
-so between 2'400 and 0, with 1'800 in-between.</p>
+so between 2400 and 0, with 1800 in-between.</p>
 </li>
 <li>
 <p>Line D is of type ABSOLUTE. This is like counter but it works on
@@ -846,7 +874,7 @@ and as you can see (hopefully) this has a different result.</p>
 </li>
 </ul>
 <p>This translates in the following values, starting at 23:10 and ending
-at 00:10 the next day (where ``u'' means unknown/unplotted):</p>
+at 00:10 the next day (where &quot;u&quot; means unknown/unplotted):</p>
 <pre>
  - Line A:  u  u  1  1  1  1  1  1  1  1  1  u
  - Line B:  u  1  3  5  3  1  2  4  6  4  2  u
@@ -893,10 +921,10 @@ increasing values.</p>
 <h2><a name="counter_wraps">Counter Wraps</a></h2>
 <p>There are a few more basics to show. Some important options are still to
 be covered and we haven't look at counter wraps yet. First the counter wrap:
-In our car we notice that the counter shows 999'987. We travel 20 KM and
-the counter should go to 1'000'007. Unfortunately, there are only six digits
-on our counter so it really shows 000'007. If we would plot that on a type
-DERIVE, it would mean that the counter was set back 999'980 KM. It wasn't,
+In our car we notice that the counter shows 999987. We travel 20 km and
+the counter should go to 1000007. Unfortunately, there are only six digits
+on our counter so it really shows 000007. If we would plot that on a type
+DERIVE, it would mean that the counter was set back 999980 km. It wasn't,
 and there has to be some protection for this. This protection is only
 available for type COUNTER which should be used for this kind of counter
 anyways. How does it work? Type counter should never decrease and
@@ -904,15 +932,15 @@ therefore RRDtool must assume it wrapped if it does decrease!
 If the delta is negative, this can be compensated for by adding the
 maximum value of the counter + 1. For our car this would be:</p>
 <pre>
- Delta = 7 - 999'987 = -999'980    (instead of 1'000'007-999'987=20)</pre>
+ Delta = 7 - 999987 = -999980    (instead of 1000007-999987=20)</pre>
 <pre>
- Real delta = -999'980 + 999'999 + 1 = 20</pre>
+ Real delta = -999980 + 999999 + 1 = 20</pre>
 <p>At the time of writing this document, RRDtool knows of counters that
 are either 32 bits or 64 bits of size. These counters can handle the
 following different values:</p>
 <pre>
- - 32 bits: 0 ..           4'294'967'295
- - 64 bits: 0 .. 18'446'744'073'709'551'615</pre>
+ - 32 bits: 0 ..           4294967295
+ - 64 bits: 0 .. 18446744073709551615</pre>
 <p>If these numbers look strange to you, you can view them in
 their hexadecimal form:</p>
 <pre>
@@ -936,50 +964,50 @@ Try to do the calculations yourself or just believe me if your calculator
 can't handle the numbers :)</p>
 <p>Correction numbers:</p>
 <pre>
- - 32 bits: (4'294'967'295 + 1) =                                4'294'967'296
- - 64 bits: (18'446'744'073'709'551'615 + 1)
-                                    - correction1 = 18'446'744'069'414'584'320</pre>
+ - 32 bits: (4294967295 + 1) =                                4294967296
+ - 64 bits: (18446744073709551615 + 1)
+                                    - correction1 = 18446744069414584320</pre>
 <pre>
- Before:        4'294'967'200
+ Before:        4294967200
  Increase:                100
- Should become: 4'294'967'300
+ Should become: 4294967300
  But really is:             4
- Delta:        -4'294'967'196
- Correction1:  -4'294'967'196 + 4'294'967'296 = 100</pre>
+ Delta:        -4294967196
+ Correction1:  -4294967196 + 4294967296 = 100</pre>
 <pre>
- Before:        18'446'744'073'709'551'000
+ Before:        18446744073709551000
  Increase:                             800
- Should become: 18'446'744'073'709'551'800
+ Should become: 18446744073709551800
  But really is:                        184
- Delta:        -18'446'744'073'709'550'816
- Correction1:  -18'446'744'073'709'550'816
-                                + 4'294'967'296 = -18'446'744'069'414'583'520
- Correction2:  -18'446'744'069'414'583'520
-                   + 18'446'744'069'414'584'320 = 800</pre>
+ Delta:        -18446744073709550816
+ Correction1:  -18446744073709550816
+                                + 4294967296 = -18446744069414583520
+ Correction2:  -18446744069414583520
+                   + 18446744069414584320 = 800</pre>
 <pre>
- Before:        18'446'744'073'709'551'615 ( maximum value )
- Increase:      18'446'744'069'414'584'320 ( absurd increase, minimum for
- Should become: 36'893'488'143'124'135'935             this example to work )
- But really is: 18'446'744'069'414'584'319
- Delta:                     -4'294'967'296
- Correction1:  -4'294'967'296 + 4'294'967'296 = 0
+ Before:        18446744073709551615 ( maximum value )
+ Increase:      18446744069414584320 ( absurd increase, minimum for
+ Should become: 36893488143124135935             this example to work )
+ But really is: 18446744069414584319
+ Delta:                     -4294967296
+ Correction1:  -4294967296 + 4294967296 = 0
  (not negative -&gt; no correction2)</pre>
 <pre>
- Before:        18'446'744'073'709'551'615 ( maximum value )
- Increase:      18'446'744'069'414'584'319 ( one less increase )
- Should become: 36'893'488'143'124'135'934
- But really is: 18'446'744'069'414'584'318
- Delta:                     -4'294'967'297
- Correction1:  -4'294'967'297 + 4'294'967'296 = -1
- Correction2:  -1 + 18'446'744'069'414'584'320 = 18'446'744'069'414'584'319</pre>
+ Before:        18446744073709551615 ( maximum value )
+ Increase:      18446744069414584319 ( one less increase )
+ Should become: 36893488143124135934
+ But really is: 18446744069414584318
+ Delta:                     -4294967297
+ Correction1:  -4294967297 + 4294967296 = -1
+ Correction2:  -1 + 18446744069414584320 = 18446744069414584319</pre>
 <p>As you can see from the last two examples, you need strange numbers
 for RRDtool to fail (provided it's bug free of course), so this should
 not happen. However, SNMP or whatever method you choose to collect the
 data, might also report wrong numbers occasionally.  We can't prevent all
-errors, but there are some things we can do. The RRDtool ``create'' command
+errors, but there are some things we can do. The RRDtool &quot;create&quot; command
 takes two special parameters for this. They define
-the minimum and maximum allowed values. Until now, we used ``U'', meaning
-``unknown''. If you provide values for one or both of them and if RRDtool
+the minimum and maximum allowed values. Until now, we used &quot;U&quot;, meaning
+&quot;unknown&quot;. If you provide values for one or both of them and if RRDtool
 receives data points that are outside these limits, it will ignore those
 values. For a thermometer in degrees Celsius, the absolute minimum is
 just under -273. For my router, I can assume this minimum is much higher
@@ -1017,8 +1045,8 @@ RRDtool interpolates and stores 300 as it should be.</p>
  time+300: 300 delta=300   time+300:  300 delta=300
  time+600: 600 delta=300   time+603:  603 delta=303
  time+900: 900 delta=300   time+900:  900 delta=297</pre>
-<p>Let's create two identical databases. I've chosen the time range 920'805'000
-to 920'805'900 as this goes very well with the example numbers.</p>
+<p>Let's create two identical databases. I've chosen the time range 920805000
+to 920805900 as this goes very well with the example numbers.</p>
 <pre>
    rrdtool create seconds1.rrd   \
       --start 920804700          \
@@ -1064,7 +1092,7 @@ input being different.</p>
 you to be able to work with RRDtool and to read the additional
 documentation available. There is plenty more to discover about
 RRDtool and you will find more and more uses for this package. You can
-easly create graphs using just the examples provided and using only
+easily create graphs using just the examples provided and using only
 RRDtool. You can also use one of the front ends to RRDtool that are
 available.</p>
 <p>
@@ -1094,7 +1122,7 @@ other people by pointing them to this document when they are asking
 basic questions. They will not only get their answers, but at the same
 time learn a whole lot more.</p>
 <p>Alex van den Bogaerdt
-&lt;<a href="mailto:alex@ergens.op.het.net">alex@ergens.op.het.net</a>&gt;</p>
+&lt;<a href="mailto:alex@vandenbogaerdt.nl">alex@vandenbogaerdt.nl</a>&gt;</p>
 
 </body>