Was looking for a quick way to answer the question "What changes were made to the configuration?" and found myself writing a script to perform a comparison of historical data store configurations found in /var/lib/128technology.
Here is a semi-useful script to display recent configuration changes. Probably would not have chosen bash, in hindsight, but it does the trick if you don't mind the XML-diff output. A useful enhancement would be to convert the XML to "show config flat" format before the diff. Just paste the text below into a file such as "config-diff.sh" and make it executable.
#!/bin/bash
# Script to diff configuration history
LIB=/var/lib/128technology
TMP=/var/lib/128technology/cfgtmp
if [ ! -d $TMP ]; then
mkdir -p $TMP;
fi;
echo "----------------------------------------------------------------------------------------------------------------"
echo "Comparing files current to 1"
echo "---------------------------------------------------------------------------"
echo "Configuration file $((num)): $LIB/t128-running.xml"
diff "$LIB/t128-running.xml" "$LIB/t128-running.1.xml" | grep datastore | awk '/datastore/{i++}i==1' > $TMP/date1
date1="$(cut -d '"' -f2 < $TMP/date1)"
date1="$((date1 / 1000))"
echo "Created:"
date -d "@$((date1))"
echo "---------------------------------------------------------------------------"
echo "Configuration file $((num + 1)): $LIB/t128-running.$((num + 1)).xml"
diff "$LIB/t128-running.xml" "$LIB/t128-running.1.xml" | grep datastore | awk '/datastore/{i++}i==2' > $TMP/date2
date2="$(cut -d '"' -f2 < $TMP/date2)"
date2="$((date2 / 1000))"
echo "Created:"
date -d "@$((date2))"
echo "---------------------------------------------------------------------------"
diff "$TMP/1.xml" "$TMP/2.xml" | grep -v datastore
echo "----------------------------------------------------------------------------------------------------------------"
for (( num=1; num<=8; num++ )); do
echo "Comparing files $num to $((num + 1))"
echo "---------------------------------------------------------------------------"
echo "Configuration file $((num)): $LIB/t128-running.$num.xml"
diff "$LIB/t128-running.$num.xml" "$LIB/t128-running.$((num + 1)).xml" | grep datastore | awk '/datastore/{i++}i==1' > $TMP/date1
date1="$(cut -d '"' -f2 < $TMP/date1)"
date1="$((date1 / 1000))"
echo "Created:"
date -d "@$((date1))"
echo "---------------------------------------------------------------------------"
echo "Configuration file $((num + 1)): $LIB/t128-running.$((num + 1)).xml"
diff "$LIB/t128-running.$num.xml" "$LIB/t128-running.$((num + 1)).xml" | grep datastore | awk '/datastore/{i++}i==2' > $TMP/date2
date2="$(cut -d '"' -f2 < $TMP/date2)"
date2="$((date2 / 1000))"
echo "Created:"
date -d "@$((date2))"
echo "---------------------------------------------------------------------------"
diff "$LIB/t128-running.$num.xml" "$LIB/t128-running.$((num + 1)).xml" | grep -v datastore
echo "----------------------------------------------------------------------------------------------------------------"
echo "----------------------------------------------------------------------------------------------------------------"
done
rm $TMP/date1 $TMP/date2
rmdir $TMP
------------------------------
Don Troshynski
CTO - Global Sales
------------------------------