We assume you are using example.com as your domain and want to rename oldhost.example.com to newhost.example.com.
1. Backup existing data and configs
cd /backup/
tar cvpzf munin_lib.tar.gz.$(date +%Y%m%d) /var/lib/munin
tar cvpzf munin_html.tar.gz.$(date +%Y%m%d) /www/munin
cp /etc/munin/munin.conf munin.conf.$(date +%Y%m%d)
2. Remove unneeded and legacy stuff (if any)
cd /var/lib/munin/example.com
rm old* test* temp*
cd /var/vhosts/monitor/munin/clickmein.com
rm -R old* test* temp*
3. Disable munin cronjobs
mv /etc/cron.d/munin /etc/cron.d/munin.disabled
4. Rename actual rrd files
for file in /var/lib/munin/example.com/*.rrd; do mv $file `echo $file|sed 's/oldhost\.example\.com/newhost\.example\.com/'`; done5. Edit munin config
I do strongly recommend you prepare all the changes before disabling cronjobs to minimize munin downtime! Just prepare all the changes and save once you have done Step 4.
vi /etc/munin/munin.confAnd then type the following command sequence to replace all occurances in config file in vi editor.
:%s/oldhost\.example\.com/newhost\.example\.com/g6. Enable cronjob
mv /etc/cron.d/munin.disabled /etc/cron.d/munin
That's all! Now just wait 5 minutes (default cronjob interval) to see updates on the munin web-interface.
References:
http://aaltonen.co/2010/12/30/change-munin-node-hostname/
http://beeznest.wordpress.com/2011/06/13/howto-rename-munin-node-without-loosing-history/
Немає коментарів:
Дописати коментар