DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Crossbeam Configuration Collection Script

05.12.2009
| 4325 views |
  • submit to reddit
        // This script will gather and grab the configuration & logs from a crossbeam X series chassis.

#!/bin/bash
cd /var/log
tar cf $HOSTNAME-tech-support.tar messages*
tar rf $HOSTNAME-tech-support.tar audit*
cd /tftpboot/.private/home/$USER/
echo "Now saving technical data... "
echo "Please wait... executing 'show tech-support...'"
yes |/crossbeam/bin/cli -i "show tech-support" > $HOSTNAME-show-tech-support.txt
echo "tech support data saved - stage 1 of 2 complete..."
echo " "
echo " "
echo "Preparing to compress the results, this may take a few minutes... "
tar rf $HOSTNAME-tech-support.tar $HOSTNAME-show-tech-support.txt
gzip $HOSTNAME-tech-support.tar
/bin/rm $HOSTNAME-show-tech-support.txt
echo "Tech Support data collection complete."
echo " "
echo "File saved as /tftpboot/.private/home/$USER/$HOSTNAME-tech-support.tar " 
#
# Run this script
# bash <scriptname>
#