Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Script for Crossbeam XOS 8.x to collect all technical support data and
- # prepare for uploading to Crossbeam support. This script is a collaborative
- # effort between Crossbeam Systems, Jim Noble, and Paul Gower
- # Last updated on 7/1/2009
- # Last modification - addition of traplog in it's own file - corrected to remove the traplog.txt file and tar file
- clear
- echo "Tarring messages and audit files"
- echo " "
- echo " "
- cd /var/log #move to the log file directory
- # create the tar file, and put the message logs into it
- nice -n 19 tar cf /tftpboot/.private/home/$USER/$HOSTNAME-tech-support.tar messages*
- # add the audit logs to the existing tar file
- nice -n 19 tar rf /tftpboot/.private/home/$USER/$HOSTNAME-tech-support.tar audit*
- # add the audit logs to the existing tar file
- cd /tftpboot/.private/home/$USER/ #move back to the user home directory
- echo "Now saving technical data... "
- echo "Please wait... executing 'show tech-support...'"
- # disable the "more" command and generate the
- # show-tech data and dump to a file
- nice -n 19 /crossbeam/bin/cli -i "enable no more" | /crossbeam/bin/cli -i "show tech-support" > $HOSTNAME-show-tech-support.txt
- # dump the traplogs to a file
- nice -n 19 /crossbeam/bin/cli -i "show traplog" >> $HOSTNAME-show-traplog.txt
- #re-enable the "more command"
- nice -n 19 /crossbeam/bin/cli -i "enable more" > /dev/null
- echo "Tech support data saved - stage 1 of 2 complete..."
- echo " "
- echo " "
- echo "Preparing to compress the results, this may take a few minutes... "
- #add the techsupport.txt file to the tar file
- nice -n 19 tar rf $HOSTNAME-tech-support.tar $HOSTNAME-show-tech-support.txt
- #add the traplog.txt file to the tar file
- nice -n 19 tar rf $HOSTNAME-tech-support.tar $HOSTNAME-show-traplog.txt
- #zip up the tar file
- nice -n 19 gzip $HOSTNAME-tech-support.tar
- #clean up the tech support file
- nice -n 19 /bin/rm /tftpboot/.private/home/$USER/$HOSTNAME-show-tech-support.txt
- # clean up the traplog file
- nice -n 19 /bin/rm /tftpboot/.private/home/$USER/$HOSTNAME-show-traplog.txt
- # clean up the tar file
- nice -n 19 /bin/rm /tftpboot/.private/home/$USER/$HOSTNAME-show-tech-support.tar
- echo "Tech Support data collection complete - stage 2 of 2 complete"
- echo " "
- echo "File saved as /tftpboot/.private/home/$USER/$HOSTNAME-tech-support.tar.gz"
- #
- # Run this script
- # bash <scriptname>
- #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement