繁体   English   中英

从munin数据中删除一个样本

[英]Drop a single sample from munin data

我正在使用munin监视postgresql数据库,我做了一次更改,导致munin得到一个糟糕的声音(每秒查询超出正常范围的许多数量级),这搞砸了我的图形。 有什么方法可以轻松地从munin数据中删除单个数据点吗?

我想我需要某种rrd编辑器,但我不确定什么是最简单的。 恼人的是,数据不只是以明文存储:(

假设您正在运行Linux,它会是这样的:

$ # 1) Stop the cron job from running
$ sudo mv /etc/cron.d/munin /tmp/munin-cron-job
$ # 2) Run as munin account
$ sudo su - munin
$ # 3) Wait a minute, else run this to make sure any
$ #    background munin-cron is finished
$ munin-cron
$ # 4) Export data file to XML
$ rrdtool dump \
>      /var/lib/munin/example.com/www.example.com-$PLUGIN-d.rrd \
>      > /tmp/data.xml
$ # 5) Run your favorite editor on the XML file
$ # (The data will likely have been transformed.
$ #    Making a backup first wouldn't hurt.)
$ vi /tmp/data.xml
$ # 6) Import the changes
$ rrdtool restore \
>        /tmp/data.xml \
>        /var/lib/munin/example.com/www.example.com-$PLUGIN-d.rrd
$ rm /tmp/data.xml
$ # You might want to delete related graphic files /var/cache/munin/...
$ # 7) Exit munin account and re-enable cron job
$ exit
$ sudo mv /tmp/munin-cron-job /etc/cron.d/munin

备份你的rrd,

停止写任何东西,或快速

导出到xml:rrdtool转储vi中的file.rrd> thefile.xml编辑,用NaN替换有问题的数字

import rrdtool restore thefile.xml(或者不管语法是什么 - 谷歌吧)

DONE

暂无
暂无

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

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