Viewed 59k times. Improve this question. Yasiru G Yasiru G 6, 5 5 gold badges 19 19 silver badges 38 38 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. Tobi Oetiker Tobi Oetiker 4, 2 2 gold badges 16 16 silver badges 22 22 bronze badges. Thank you Tobi : I found a useful command 'rrdtool fetch xxx.
Let me explain my problem here; I was using mrtg setup with. I was collecting usage from. I hope this can be done using rrdtool fetch. Any advice appreciate. Hi Tobi Oetiker, I use 'rrdtool fetch xxx.
But I cannot file any similarities if I compare it with the data of log file the graphs are same. Please help! I cannot understand a single word of what your are trying to explain. How do I fill the Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta. Each archive measures data for a different time period. For instance, the archives can capture data for intervals of 10 seconds, 30 seconds, 1 minute or 5 minutes.
In this example, the first RRA archive contains averaged metrics for one minute 60s intervals, while the second RRA measures the same metric, but averaged over five minutes. The same metrics are also available for intervals of one hour and one day. Notice also that every archive has a different number of rows, representing a different historical period where the data is kept. If you want to know more, please read the excellent introduction tutorial to RRD database.
But I was pleased to discover that a Google Summer of Code project created a proof-of-concept R package to read these files. The author of this package is Plamen Dimitrov , who published the code on GitHub and also wrote an explanatory blog post.
Because I had to provide some suggestions to our customers, I decided to update the package, provide some example code, and generally improve the reliability.
The result is not yet on CRAN, but you can install the development version of package from github. To build the package from source, you first need to install librrd. Installing RRDtool from your Linux package manager will usually also install this library. Once you have the system requirements in place, you can install the development version of the R package from GitHub using:. The package itself contains some built-in RRD files, so you should be able to run the following code directly. This function reports information about the names of each archive RRA file, the consolidation function, and the number of observations:.
To read an entire RRD file, i. This returns a list of tibble objects:. Since the resulting object is a list of tibble objects, you can easily use R functions to work with an individual archive:. For example, the CPU metrics contains a time stamp and metrics for average user and sys usage, as well as the nice value, idle time, interrupt requests and soft interrupt requests :.
Since the data is in tibble format, you can easily extract specific data, e. The underlying code in the rrd package is written in C, and is therefore blazingly fast. Reading an entire RRD file takes a fraction of a second, but sometimes you may want to extract a specific RRA archive immediately.
To use this function, you must specify several arguments that define the specific data to retrieve. This includes the consolidation function e. For example, you can easily plot these data using your favourite packages, like ggplot2 :.
0コメント