简体   繁体   English

更新现有RRD文件中的值

[英]Updating values in an existing RRD file

I have an rrd file working fine under cacti, drawing a graph for me for more than a year from one data source. 我有一个rrd文件,在仙人掌下工作良好,可以从一个数据源为我绘制图形一年多。

Today, I discovered that the data in the rrd file is not correct. 今天,我发现rrd文件中的数据不正确。 I have corrected the data source and fixed problem for the future. 我已更正了数据源并解决了将来的问题。 However, I need to divide the previous data by 2 to correct it historically as well. 但是,我需要将以前的数据除以2来从历史上进行校正。

Is it possible to update the values of an rrd file? 是否可以更新rrd文件的值? If yes, how can I achieve this? 如果是,我该如何实现?

Data in the RRAs cannot be directly changed once written. 一旦写入,RRA中的数据将无法直接更改。

However, what you can do is to dump the data to XML (using rrdtool dump ); 但是,您可以做的是将数据转储到XML中(使用rrdtool dump )。 edit it using some other method; 使用其他方法进行编辑; and then reload the data into a new RRD file (using rrdtool restore ). 然后将数据重新加载到新的RRD文件中(使用rrdtool restore )。 This, of course, requires you to create some method to automatically modify the values in the XML file, but this should be simpler than trying to modify the RRD directly. 当然,这需要您创建一些方法来自动修改XML文件中的值,但是这比尝试直接修改RRD更简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM