#!/bin/bash REPORT="$HOME/.hpc-problem.tmp" RECIPS="hpc-support@uci.edu" #"hmangala@uci.edu" #"hpc-support@uci.edu" clear while [ "xx$SUBJECT" == "xx" ] ; do echo -n " If this is the 1st time you've used this script, please read this HOWTO before continuing. (Intelligent terminals (konsole, gnome-terminal) will try to open a local browser with that link).. http://goo.gl/oXgE4V The short version: you'll provide us a Subject: line below, then edit the auto-generated email that provides a lot of the info we need. At any point you can hit ^C to quit this process. Provide a brief (<50chars), descriptive Subject line and then hit [Enter]. [The script will take a few seconds to collect all the info we need.] ........50 chars ends about .....................| then [Enter] to continue " read SUBJECT SSZ=${#SUBJECT} if [[ "$SSZ" -lt "5" ]]; then echo "That's a pretty short subject; could you expand a bit, please??" SUBJECT="" fi sleep 1; clear done echo "This may take a few secs to collect the info we need." sleep 1 PWD=`pwd` HOSTNAME=`hostname` DATE=`date` LOADAVG=`cat /proc/loadavg` FREERAM=`free -g` MODULES=$(module list 2>&1 >/dev/null) QJOBS=`qstat -u $USER` NUMQJOBS=`echo $QJOBS | wc -c` if [[ "$NUMQJOBS" -gt "1" ]]; then QJOBS=`qstat -u $USER | nc termbin.com 9999` else QJOBS="No Queued Jobs" fi echo "User: $USER Working Dir: $PWD Hostname: $HOSTNAME Load Average: $LOADAVG RAM in use: \"$FREERAM\" Modules: \"$MODULES\" Queued Jobs: \"$QJOBS\" ========================================================= == Please leave the stanza above intact. == == Expand on your problem as much as you'd like below: == == This is freeform text; just type in as much extra == == info as you can and then exit this editor normally. == ========================================================= == What email address you'd prefer us to use, if not [$USER@uci.edu] == What OS are you connecting from? (Windows,Mac,Linux) == What application are you using to connect with? (Terminal, putty, x2go, etc) == Overall Problem: == Specific programs or files causing the problem: (if the files aren't in this dir, please provide their full path) == EXACT Program execution line causing the problem or error: == EXACT Error Output: (Please paste in the error output if short, or provide a 'termbin' link to it as described in the HOWTO ) " > $REPORT sync export TERM=xterm if [[ "xx$EDITOR" = "xx" ]] ; then export EDITOR=nano; nano +22 $REPORT; else $EDITOR +22 $REPORT fi LOOP=1 while [ "$LOOP" == "1" ]; do clear echo " OK, ALMOST DONE! To SEND this email to HPC-Support, hit [S, then Enter]. To RE-EDIT your 'Problem Report', press [Enter] alone. To kill the author of this script, take a number. Your current 'Bug Report File' is still in [$REPORT]. where you can re-edit it and send it to us via regular email. or by typing this at the commandline: mail -s \"$SUBJECT\" < $REPORT $RECIPS " read SS; YN=`echo $SS | tr '[:upper:]' '[:lower:]'` #echo "[ debug: YN = $YN ]" #sleep 1 if [[ "$YN" =~ "s" ]]; then mail -r ${USER}@uci.edu -c ${USER}@uci.edu -s "$SUBJECT" < $REPORT $RECIPS echo " Thanks for sending us this report. We should get back to you within an hour usually; if it's the evening or weekends it will be longer. If the cluster is on fire .. well, you wouldn't be able to use this script. " exit LOOP=0 else $EDITOR +15 $REPORT sync fi done