Advertisement
Guest User

Untitled

a guest
May 6th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.34 KB | None | 0 0
  1. #!/bin/bash
  2. # Script for Crossbeam XOS 8.x to collect all technical support data and
  3. # prepare for uploading to Crossbeam support.  This script is a collaborative
  4. # effort between Crossbeam Systems, Jim Noble, and Paul Gower
  5. # Last updated on 7/1/2009
  6. # Last modification - addition of traplog in it's own file - corrected to remove the traplog.txt file and tar file
  7. clear
  8. echo "Tarring messages and audit files"
  9. echo " "
  10. echo " "
  11. cd /var/log #move to the log file directory
  12. # create the tar file, and put the message logs into it
  13. nice -n 19 tar cf /tftpboot/.private/home/$USER/$HOSTNAME-tech-support.tar messages*
  14. # add the audit logs to the existing tar file
  15. nice -n 19 tar rf /tftpboot/.private/home/$USER/$HOSTNAME-tech-support.tar audit*
  16. # add the audit logs to the existing tar file
  17. cd /tftpboot/.private/home/$USER/ #move back to the user home directory
  18. echo "Now saving technical data... "
  19. echo "Please wait... executing 'show tech-support...'"
  20. # disable the "more" command and generate the
  21. # show-tech data and dump to a file
  22. nice -n 19 /crossbeam/bin/cli -i "enable no more" | /crossbeam/bin/cli -i "show tech-support" > $HOSTNAME-show-tech-support.txt
  23. # dump the traplogs to a file
  24. nice -n 19 /crossbeam/bin/cli -i "show traplog" >> $HOSTNAME-show-traplog.txt
  25. #re-enable the "more command"
  26. nice -n 19 /crossbeam/bin/cli -i "enable more" > /dev/null
  27. echo "Tech support data saved - stage 1 of 2 complete..."
  28. echo " "
  29. echo " "
  30. echo "Preparing to compress the results, this may take a few minutes... "
  31. #add the techsupport.txt file to the tar file
  32. nice -n 19 tar rf $HOSTNAME-tech-support.tar $HOSTNAME-show-tech-support.txt
  33. #add the traplog.txt file to the tar file
  34. nice -n 19 tar rf $HOSTNAME-tech-support.tar $HOSTNAME-show-traplog.txt
  35. #zip up the tar file
  36. nice -n 19 gzip $HOSTNAME-tech-support.tar
  37. #clean up the tech support file
  38. nice -n 19 /bin/rm /tftpboot/.private/home/$USER/$HOSTNAME-show-tech-support.txt
  39. # clean up the traplog file
  40. nice -n 19 /bin/rm /tftpboot/.private/home/$USER/$HOSTNAME-show-traplog.txt
  41. # clean up the tar file
  42. nice -n 19 /bin/rm /tftpboot/.private/home/$USER/$HOSTNAME-show-tech-support.tar
  43. echo "Tech Support data collection complete - stage 2 of 2 complete"
  44. echo " "
  45. echo "File saved as /tftpboot/.private/home/$USER/$HOSTNAME-tech-support.tar.gz"
  46. #
  47. # Run this script
  48. # bash <scriptname>
  49. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement