Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drop a single sample from munin data

I'm using munin to monitor a postgresql database and I made a 1 time change that caused munin to get a bad sammple (queries per second many orders of magnitude out of the normal range) that is screwing up my graphs. Is there any way I can easily delete a single data point from the munin data?

I guess I need an rrd editor of some kind, but I'm not sure what will be easiest. Annoying that the data isn't just stored in plaintext :(

like image 863
harryh Avatar asked Mar 03 '10 21:03

harryh


1 Answers

Presuming you’re running Linux, it goes something like this:

$ # 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
like image 149
danorton Avatar answered Sep 21 '22 22:09

danorton