[asterisk-commits] kmoore: branch 1.8 r349504 - /branches/1.8/contrib/scripts/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 4 14:00:37 CST 2012


Author: kmoore
Date: Wed Jan  4 14:00:33 2012
New Revision: 349504

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=349504
Log:
Update autosupport script and man page

Added information collection from the output of the utilities: top, free, uptime, ifconfig
Added information collection from the output of the Asterisk command 'dahdi show status'
Added option / flag '-n, --non-interactive'
Updated man page to reflect new option / flag '-n, --non-interactive'

Patch-by: John Bigelow (itzanger)
(closes issue AST-749)

Modified:
    branches/1.8/contrib/scripts/autosupport
    branches/1.8/contrib/scripts/autosupport.8

Modified: branches/1.8/contrib/scripts/autosupport
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/contrib/scripts/autosupport?view=diff&rev=349504&r1=349503&r2=349504
==============================================================================
--- branches/1.8/contrib/scripts/autosupport (original)
+++ branches/1.8/contrib/scripts/autosupport Wed Jan  4 14:00:33 2012
@@ -1,9 +1,9 @@
 #!/bin/sh
 #
-# Autosupport Version 2.0.15
+# Autosupport Version 2.0.18
 # Collect support information
 #
-# Copyright (C) 2005-2010, Digium, Inc.
+# Copyright (C) 2005-2011, Digium, Inc.
 #
 # Written by John Bigelow (support at digium.com)
 #            Charles Moye (cmoye at digium.com)
@@ -28,6 +28,7 @@
 FILE_PREFIX=
 FOLDER_PREFIX="${HOME}/"
 files="n";
+NONINTERACTIVE=0
 
 # If a prefix is specified on command-line, add it.
 if (set -u; : $1) 2> /dev/null
@@ -40,9 +41,10 @@
     echo
     echo "usage: autosupport [prefix]"
     echo "Valid Options:"
-    echo "   [prefix]		Prefix to apply to output files"
-    echo "			May be your existing Digium Technical Support Ticket ID"
-    echo "   -h, --help		Show help about options"
+    echo "   [prefix]			Prefix to apply to output files"
+    echo "				May be your existing Digium Technical Support Ticket ID"
+    echo "   -n, --non-interactive	Run without requiring user input"
+    echo "   -h, --help			Show help about options"
     echo
     echo "Example:"
     echo "    autosupport XXXXXXXX"
@@ -51,8 +53,12 @@
     echo "    XXXXXXXX_${TARBALL_OUTPUT_FILE}"
     echo
     exit
-  fi
-  FILE_PREFIX="${FILE_PREFIX}${1}_";
+  elif [ $1 == "-n" ] || [ $1 == "--non-interactive" ]; then
+    FILE_PREFIX=
+    NONINTERACTIVE=1
+  else
+    FILE_PREFIX="${FILE_PREFIX}${1}_";
+  fi
 fi
 
 MYUID=$(id -u);
@@ -102,6 +108,22 @@
 echo -n "Working";
 
 echo "------------------" >> $OUTPUT;
+echo "UPTIME : uptime" >> $OUTPUT;
+echo "------------------" >> $OUTPUT;
+uptime >> $OUTPUT;
+echo >> $OUTPUT;
+echo >> $OUTPUT;
+echo -n "."
+
+echo "------------------" >> $OUTPUT;
+echo "MEMORY : free" >> $OUTPUT;
+echo "------------------" >> $OUTPUT;
+free >> $OUTPUT;
+echo >> $OUTPUT;
+echo >> $OUTPUT;
+echo -n "."
+
+echo "------------------" >> $OUTPUT;
 echo "KERNEL VERSION : uname -a" >> $OUTPUT;
 echo "------------------" >> $OUTPUT;
 uname -a >> $OUTPUT;
@@ -162,9 +184,10 @@
 # Add check to see if asterisk is running.
 if [ -e /var/run/asterisk.ctl ] || [ -e /var/run/asterisk/asterisk.ctl ]; then
   for command in "show version" "core show version" "pri show version" "dahdi show version" "transcoder show" \
-      "core show uptime" "pri show spans" "misdn show stacks" "zap show channels" "dahdi show channels" \
+      "core show uptime" "pri show spans" "misdn show stacks" "zap show channels" "dahdi show status" "dahdi show channels" \
       "dahdi show channel 1" "core show channels" "skype show version" "skype show licenses" "skype show users" \
-      "show g729" "g729 show version" "g729 show licenses" "fax show version" "fax show licenses" "fax show stats" ; do
+      "skype show hostid" "show g729" "g729 show version" "g729 show licenses" "g729 show hostid" "fax show version" \
+      "fax show licenses" "fax show hostid" "fax show stats"; do
     echo "asterisk -rx \"$command\"" >> $OUTPUT;
     asterisk -rx "$command" >> $OUTPUT;
     echo >> $OUTPUT;
@@ -187,6 +210,14 @@
   fi
 done
 echo >> $OUTPUT;
+
+echo "------------------" >> $OUTPUT;
+echo "TOP : top -bn1" >> $OUTPUT;
+echo "------------------" >> $OUTPUT;
+top -bn1 >> $OUTPUT;
+echo >> $OUTPUT;
+echo >> $OUTPUT;
+echo -n "."
 
 echo "------------------" >> $OUTPUT;
 echo "RUNNING PROCESSES : ps aux" >> $OUTPUT;
@@ -322,7 +353,7 @@
 echo -n "."
 
 echo "------------------" >> $OUTPUT;
-echo "NETWORK INFO : route -n; iptables -L; ifconfig" >> $OUTPUT;
+echo "NETWORK INFO : route -n; iptables -L; ifconfig -a" >> $OUTPUT;
 echo "------------------" >> $OUTPUT;
 route -n 2> /dev/null >> $OUTPUT;
 echo >> $OUTPUT;
@@ -330,7 +361,7 @@
 iptables -L 2> /dev/null >> $OUTPUT;
 echo >> $OUTPUT;
 echo "------------------" >> $OUTPUT;
-ifconfig 2> /dev/null >> $OUTPUT;
+ifconfig -a 2> /dev/null >> $OUTPUT;
 echo >> $OUTPUT;
 echo >> $OUTPUT;
 echo -n "."
@@ -457,23 +488,8 @@
   gzip $TARBALL_OUTPUT
 }
 
-clear;
-
-echo
-echo "This script will try to collect the following pieces of"
-echo "information from your system."
-echo
-echo "1. Information about your system such as:"
-echo "pci listing, dmesg, running processes, and kernel version"
-echo
-echo "2. A backup of elements of your configuration such as:"
-echo "asterisk config files, license files, loaded dahdi/zaptel module"
-echo "parameters, and other asterisk/dahdi/zaptel related files."
-echo
-echo "Collect this information [y/n] ? "
-read files;
-
-if [ "$files" = "y" ] || [ "$files" = "yes" ]; then
+collect()
+{
   echo "This may take up to half a minute to run. Please be patient."
   collect_digiuminfo;
   collect_config_backup;
@@ -496,9 +512,33 @@
     echo "Please investigate your system, and send the output"
     echo "above to your Digium Technical Support Ticket."
   fi
+}
+
+clear;
+
+if [ $NONINTERACTIVE -eq 1 ]; then
+  collect;
 else
-  clear;
-  echo;
-  echo "User selected not to continue."
+  echo
+  echo "This script will try to collect the following pieces of"
+  echo "information from your system."
+  echo
+  echo "1. Information about your system such as:"
+  echo "pci listing, dmesg, running processes, and kernel version"
+  echo
+  echo "2. A backup of elements of your configuration such as:"
+  echo "asterisk config files, license files, loaded dahdi/zaptel module"
+  echo "parameters, and other asterisk/dahdi/zaptel related files."
+  echo
+  echo "Collect this information [y/n] ? "
+  read files;
+
+  if [ "$files" = "y" ] || [ "$files" = "yes" ]; then
+    collect;
+  else
+    clear;
+    echo;
+    echo "User selected not to continue."
+  fi
 fi
 exit

Modified: branches/1.8/contrib/scripts/autosupport.8
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/contrib/scripts/autosupport.8?view=diff&rev=349504&r1=349503&r2=349504
==============================================================================
--- branches/1.8/contrib/scripts/autosupport.8 (original)
+++ branches/1.8/contrib/scripts/autosupport.8 Wed Jan  4 14:00:33 2012
@@ -1,10 +1,10 @@
-.TH AUTOSUPPORT 8 "Aug 8th, 2010" "Asterisk" "Linux Programmer's Manual"
+.TH AUTOSUPPORT 8 "Dec 14th, 2011" "autosupport" "Linux Programmer's Manual"
 .SH NAME
 .B autosupport
 \(em interactive script to provide Digium[tm]'s support with information
 .SH SYNOPSIS
 .PP 
-.B autosupport [-h] [prefix]
+.B autosupport [OPTION] [prefix]
 
 .SH DESCRIPTION
 \fBautosupport\fR is a script that is normally run by a user contacting Digium's Technical
@@ -30,7 +30,10 @@
 \fBprefix\fR
 Used to prefix the file names. Typically a Digium Technical Support Ticket ID
 .SS Options:
-.TP 15
+.TP 25
+\fB\-n, \-\-non-interactive\fR
+Run without requiring user input
+.TP 25
 \fB\-h, \-\-help\fR
 Show help about options
 .SH FILES




More information about the asterisk-commits mailing list