I'd like to reset all graphs for a certain host in Munin. Anyone who knows how I can do this?
6 Answers
Munin data is stored in Round Robin Database files (.rrd). These are stored under /var/lib/munin.
Each host and hostgroup will have it's own subdirectory under /var/lib/munin
Delete the .rrd files under the hostname in question, and your data will be zeroed out. Graphs will be re-generated after a few minutes.
- 24,065
Or alternatively if you just want to fix the data in the RRD files (for example spike on the network graph on the server reboot), just run:
rrddtool dump /var/lib/munin/xy/z.rrd >z.xml
edit the data in xml file (fix big values, but remember they are in scientific notation) and then just re-create the RRD file:
rrdtool restore z.xml x.rrd
and overwrite the original RRD with this new one. Using this, you can fix the values and still preserve your old data.
EDIT: You can find detailed description and howto here: https://guide.munin-monitoring.org/en/latest/howtos/remove-spikes.html
- 1,610
Yes, delete all the *.rrd files in the folder where munin generates the graphs (where the .html files are). /var/lib/munin/xyz/. It's defined in your munin.conf (dbdir).
The rrd files are regenerated on the next run.
- 4,149
- 1
- 30
- 41
You should also remove the html files that have been created. They are usually located under /var/www/munin/. In that directory, you will find your hostgroup directories. delete the .png files and the .html file of the graph you want to reset.
- 143
Note that the weekly, monthly, and yearly graphs are not recreated every 5 minutes. This can be confusing at first after you've made a change, like spike removal described in another answer, and the day graph reflects the change but the others don't.
Looking at the source of munin-graph, the expiry times for regeneration are:
day graph: 5 minutes
week graph: 30 minutes
month graph: 2 hours
year graph: 24 hours
- 11
I remove a single type graph with next at master server:
- Login as root:
sudo su
- Backup current status:
cp -rp /var/lib/munin /var/lib/munin.bak
- Search and confirm all files to delete for plugin graphs nginx_*:
find /var/lib/munin -name *nginx_*.rrd
Confirm all files to delete!
Delete graph files for plugin nginx_*:
find /var/lib/munin -name *nginx_*.rrd -exec rm {} \;
- 212