Skip to content

Instantly share code, notes, and snippets.

@johntdyer
Created October 1, 2014 17:59
Show Gist options
  • Select an option

  • Save johntdyer/44062b1f6001028a7f78 to your computer and use it in GitHub Desktop.

Select an option

Save johntdyer/44062b1f6001028a7f78 to your computer and use it in GitHub Desktop.
support_data_collector
#!/bin/bash
# create working dir
mkdir /tmp/report
# archive some basic files
for h in /proc/cpuinfo /etc/redhat-release /opt/voxeo/prism/conf/version.xml /opt/voxeo/prism/conf/capacity.json; do
cat h > /tmp/report/$h.report
done
# get some system data
ps aux > /tmp/report/ps.report
df -h > /tmp/report/df.report
free -h > /tmp/report/free.report
rpm -qa > /tmp/report/rpm.report
# Archive version manifests
find /opt/voxeo/prism/ -type f -iname "MANIFEST.MF" -exec tar -rf /tmp/report/MANIFESTS.tar {} \;
# Backup and delete working space
tar czvf /tmp/report-`date +"%m-%d-%Y"`.tgz /tmp/report
rm -rf /tmp/report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment