rrd

How to create a rrd file with a specific time?

六月ゝ 毕业季﹏ 提交于 2019-12-25 01:02:56
问题 I had created a rrd file with a specific time. But when i convert it into xml, i find the start time is inconsitent with the specified time. The version of rrdtool is 1.5.5. And the code is > rrdtool create abc.rrd \ > step 15 --start 1554122342 \ DS:sum:GAUGE:120:U:U \ RRA:AVERAGE:0.5:1:5856 \ RRA:AVERAGE:0.5:4:20160 \ > RRA:AVERAGE:0.5:40:52704 The first few lines is like > <!-- 2019-03-31 20:15:15 CST / 1554034515 --> <row><v>NaN</v></row> > <!-- 2019-03-31 20:15:30 CST / 1554034530 -->

How to read RRD file to get usage data?

本秂侑毒 提交于 2019-12-21 05:12:13
问题 I have setup a mrtg setup with rrdtool. Now I'm planning to get incoming outgoing usage data from these RRD files and failing to find a correct way to do it. Can anyone show we how to get those usage data from rrd files. Then I can maintain a db to keep those usage data and calculate the cost etc. Thank you! 回答1: you can use rrdtool graph ... PRINT:xxx or rather rrdtool xport ... to get data out of the rrd file. If you want to get to the actual data, use rrdtool fetch . you can find tons of

Convert .rrd file to json in python

耗尽温柔 提交于 2019-12-10 16:57:58
问题 Is there any python module available for converting the .rrd file to json format ? 回答1: Following is the code I tried for generating json from rrd file. #!/usr/bin/python import rrdtool import sys def printMetric(): args = ["/var/lib/ganglia/rrds/__SummaryInfo__/cpu_system.rrd", "AVERAGE"] rrdMetric = rrdtool.fetch(args) time = rrdMetric[0][0] step = rrdMetric[0][2] sys.stdout.write(" {\n \"Key1\":\"" + rrdMetric[1][0] +\ "\",\n \"Key2\":\"" + "abcd" +\ "\",\n \"metric_name\":\"" + "cpu

Remove data from RRDTool

有些话、适合烂在心里 提交于 2019-12-07 04:06:13
问题 I have several graphs created by RRDTool that collected bad data during a time period of a couple hours. How can I remove the data from the RRD's during that time period so that it no longer displays? 回答1: Best method I found to do this... Use RRDTool Dump to export RRD files to XML. Open the XML file, find and edit the bad data. Restore the RRD file using RRDTool Restore . 回答2: I had a similar problem where I wanted to discard the most recent few hours from my RRDtool databases, so I wrote a

How can I update data with RRDtool?

99封情书 提交于 2019-12-06 03:15:50
问题 I am using RRDtool for storing data for displaying graphs. I update the RRD by RRDs::update and this fails when trying to rewrite the information, means update data for a time in the past (e.g. someone moved the system timer back). The error I get is: ERROR: Cannot update /opt/dashboard/rrd/Disk/192.168.120.168_disk_1.rrd with '1228032301:24:24' illegal attempt to update using time 1228032301 when last update time is 1228050001 (minimum one second step) I want to always allow the rewrite, how

Remove data from RRDTool

試著忘記壹切 提交于 2019-12-05 09:39:55
I have several graphs created by RRDTool that collected bad data during a time period of a couple hours. How can I remove the data from the RRD's during that time period so that it no longer displays? Best method I found to do this... Use RRDTool Dump to export RRD files to XML. Open the XML file, find and edit the bad data. Restore the RRD file using RRDTool Restore . I had a similar problem where I wanted to discard the most recent few hours from my RRDtool databases, so I wrote a quick script to do it (apologies for the unconventional variable names - coding style inherited from work, sigh)

adding new datasource to an existing RRD

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 11:28:30
问题 I have few 100s of rrds and i want to add 5 extra datasource to all of those rrds. Is it advisable to do so Whats the best way and the fastest way to do it -- Soln -- David OBrien replied in the mailing list after searching the archives ( which you should have done first ) and googling I found several people using this... with perl. Install RRD:Simple #!/usr/local/bin/perl use strict; use RRD::Simple (); my $rrd = RRD::Simple->new(); my $rrdfile=$ARGV[0]; my $source=$ARGV[1]; my $type=$ARGV[2