Skip to content

Instantly share code, notes, and snippets.

@TuningYourCode
Last active April 7, 2022 20:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TuningYourCode/d1edb8b525bcc46dcafe308c030f742a to your computer and use it in GitHub Desktop.
Save TuningYourCode/d1edb8b525bcc46dcafe308c030f742a to your computer and use it in GitHub Desktop.
munin rrd merge history
#!/bin/bash
$ip_old_munin_server = '192.168.0.200'
mkdir -p /backup/old
for filename in /var/lib/munin/*/*/*.rrd; do
if [ ! -f "/backup/old/$(basename "$filename")" ]; then
echo $filename
ssh $ip_old_munin_server "rrdtool dump $filename" | rrdtool restore - "/backup/old/$(basename "$filename")"
mv $filename "${filename}_before"
python simple-rrd-merge.py "/backup/old/$(basename "$filename")" "${filename}_before" | rrdtool restore /dev/stdin $filename
chown munin:munin $filename
fi
done
@TuningYourCode
Copy link
Author

uses the following python script:
https://gist.github.com/arantius/2166343

script is only for quick&dirty migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment