cd /usr/local/nagios/share/perfdata/
for i in `find -name "*.rrd"`; do rrdtool dump $i > $i.xml; done
tar -cvzf perfdata.tar.gz */*.rrd.xml
for i in `find -name "*.rrd.xml"`; do rm -f $i; done
cd /usr/local/nagios/share/perfdata/
for i in `find -name "*.rrd"`; do rm -f $i; done
tar -xvzf perfdata.tar.gz
for i in `find -name "*.rrd.xml"`; do rrdtool restore $i `echo $i |sed s/.xml//g`; done
for i in `find -name "*.rrd"`; do chown nagios:nagios $i; done
for i in `find -name "*.rrd.xml"`; do rm -f $i; done
but Im having an ambiguous redirect, can you help me please. Im using Centos 5,6 and 7
Thank you!
Last edited by tmcdonald on Thu Aug 03, 2017 9:15 am, edited 2 times in total.
Reason:Please use [code][/code] tags around long output
Thank you very much! Yep, this is a bash issue.
I've figured it out.
Here's what I've used and it worked (centos5 1386)
for i in $(find *.rrd); do rrdtool dump "$i" > "$i.xml"; done