Gathers system configuration information.
snap [-@] [ -a ] [-z "product_name=prd_name,..." | "class=myclass,.." | ALL] [-M Timeout][ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -D ] [ -f ] [ -g ] [ -G ] [ -i ] [ -k ] [ -l ] [ -L ][ -n ] [ -N ] [ -p ] [ -r ] [ -R ] [ -s ] [ -S ] [ -t ] [ -T Filename ] [ -w ] [ -X ] [ -o OutputDevice ] [ -d Dir ] [ -v Component ] [ -O FileSplitSize ] [ -P Files ] [ script1 script2 ... | All | file:filepath ]
snap [-@] [ -a ] [ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -D ] [ -f ] [ -g ] [ -G ] [ -i ] [ -k ] [ -l ] [ -L ][ -n ] [ -N ] [ -p ] [ -r ] [ -R ] [ -s ] [ -S ] [ -t ] [ -T Filename ] [ -o OutputDevice ] [ -d Dir ] [ -v Component ] [ -O FileSplitSize ] [ -P Files ] [ script1 script2 ... | All | file:filepath ]
snap -e [ -m Nodelist ] [ -d Dir ]
snap -z ADD ["product_name=prod_name" "class=myclass" "command_path=/tmp/myprod_myscript -a"]
snap -z DELETE ["product_name=prod_name" ]
Use the snap -o /dev/rfd0 command to copy the compressed image to diskette. Use the snap -o /dev/rmt0 command to copy the image to tape.
Using other formats prevents or delays IBM software support from being able to examine the contents.
The snap -g command gathers general system information, including the following:
The output of the snap -g command is written to the /tmp/ibmsupt/general/general.snap file.
The snap command checks for available space in the /tmp/ibmsupt directory, the default directory for snap command output. You can write the output to another directory by using the -d flag. If there is not enough space to hold the snap command output, you must expand the file system.
Each execution of the snap command appends information to previously created files. Use the -r flag to remove previously gathered and saved information.
Item | Description |
---|---|
-@ | Gathers the workload partition information. |
-a | Gathers all system configuration information except HACMP™ specific data. To gather HACMP specific data, run the snap -e option. Collection of registered debug data scripts for external products gets executed and their data is also included as part of system configuration and it can be limited for selected products by specifying their names with the –z flag. The -a option requires at least 8 MB of temporary disk space. |
-A | Gathers asynchronous (TTY) information. |
-b | Gathers SSA information. |
-B | Bypasses collection of SSA adapter dumps. The -B flag only works when the -b flag is also specified; otherwise, the -B flag is ignored. |
-c | Creates a compressed pax image (snap.pax.Z file)
of all files in the /tmp/ibmsupt directory tree or other named
output directory. Note: Information not gathered with this option
should be copied to the snap directory tree before using the -c flag.
If a test case is needed to demonstrate the system problem, copy the
test case to the /tmp/ibmsupt/testcase directory before compressing
the pax file.
|
-C | Retrieves all the files in the fwdump_dir directory. The files are placed in the "general" subdirectory. The -C snap option behaves the same as -P*. |
-D | Gathers dump and /unix information. The primary dump
device is used. Note:
|
-d AbsolutePath | Identifies the optional snap command output directory (/tmp/ibmsupt is the default). You must specify the absolute path. |
-e | Gathers HACMP specific
information. Note: HACMP specific
data is collected from all nodes belonging to the cluster. This flag
cannot be used with any other flags except -m and -d.
|
-f | Gathers file system information. |
-g | Gathers the output of the lslpp -hac command, which is required to recreate exact operating system environments. Writes output to the /tmp/ibmsupt/general/lslpp.hac file. Also collects general system information and writes the output to the /tmp/ibmsupt/general/general.snap file. |
-G | Includes predefined Object Data Manager (ODM) files in general information collected with the -g flag. |
-i | Gathers installation debug vital product data (VPD) information. |
-k | Gathers kernel information |
-l | Gathers programming language information. |
-L | Gathers LVM information. |
-m Nodelist | Node name list (separated by commas) to gather HACMP information. Note: Currently
this flag is only valid with the -e flag.
|
-M Timeout | Specifies the maximum time out value in seconds, that the snap frame work waits before it kills one registered external product debug data command. Default time out value is 300 seconds. |
-n | Gathers Network File System (NFS) information. |
-N | Suppresses the check for free space required. |
-o OutputDevice | Copies the compressed image onto the specified device. |
-O FileSplitSize | Used to enable splitting of the snap output files into smaller files. The size of these files is specified as a parameter to the -O option and must be specified in megabytes. This flag can only be used when the -c flag is specified. |
-p | Gathers printer information. |
-P Files | Retrieves the named Files from the fwdump_dir directory. If -P * is specified, all the files in the directory are gathered. The files are placed in the general subdirectory. The -C snap option behaves the same as -P*. |
-r | Removes snap command output from the /tmp/ibmsupt directory. |
-R | Gathers SCSI RAID information. |
-s | Gathers Systems Network Architecture (SNA) information. |
-S | Includes security files in general information collected with the -g flag. |
-t | Gathers Transmission control protocol information. |
-T Filename | Gathers all the log files for a multi-CPU trace. Only the base file, trcfile, is captured with the -g flag. |
-v Component | Displays the output of the commands executed by the snap command.
Use this flag to view the specified name or group of files. Note: Press
the Ctrl-C key sequence to interrupt the snap command. A prompt
will return with the following options: press the Enter key to return
to current operation; press the S key to stop the current operation;
press the Q key to quit the snap command completely.
|
-w | Gathers WLM information. |
-X | Gathers X.25 (Packet-based Communication Protocol) information. |
-z | Facilitates debug data collection for external
products.
When a product name is specified as parameter to the product_name attribute, a registered debug data collection command is executed. To collect data for more than one product specify the required product names in the product_name attribute. When a class name is specified as parameter to the class attribute, registered debug command of all the products in that class are executed. To collect data for more than one class specify the required class names in the class attribute. When ALL is specified as parameter, registered debug data collection command of all the products in all classes is executed. When any script gets executed, system appends the product name to the list pointed by SNAPDEBUGDATA environment variable. |
Arguments
Names of third-party scripts to be executed are specified as parameters to snap. A parameter can be a single word or a list of words enclosed in quotes. When parameters are enclosed in quotes, the first parameter in the list represents the name of the script and the subsequent words represent the arguments to pass to the script.
When All is specified as a parameter, all the scripts in the script repository are executed. No script parameters may be passed in this case.
If the file: keyword is used and is immediately followed by a path to a file, that file is read to get the scripts to execute. Each line in the file represents a script and optional parameters to the script .
snap Scripts
A third-party script must be executable in /usr/lib/ras/snapscripts, and must follow the guidelines described below. When called during pass 1, a script must return its size estimation to snap. In pass 2, it collects the data and saves it as specified by snap.
The script must read and utilize the following environment variables, SNAPDIR, PASSNO, SCRIPTSIZE and SCRIPTLOG.
The scripts or commands can also use SNAPDEBUGDATA variable to learn about the debug data collected by snap script. This variable has comma separated name of the products for which the snap command collects the data during execution.
All output files must be written to $SNAPDIR. This is the directory where the script should be saving its output. The PASSNO variable contains the snap phase during which the script is called. During the first pass, the script should calculate a size estimation for the data it will write during the second pass. It will then write that numeric estimation to the file pointed to by $SCRIPTSIZE. The value saved to the file should be in decimal. snap passes the path to a log file where all debug data for the script should be saved. Standard out and standard error should not be redirected by the script, because snap will save standard out and standard error to $SNAPDIR/ScriptName.out and $SNAPDIR/ScriptName.err, respectively.
#!/usr/bin/ksh
if [ "$PASSNO" = 1 ]
then
(( size=99999 ))
....
# this is where code to do the size estimation should go.
....
echo $size > $SCRIPTSIZE
else if [ "$PASSNO" = 2 ]
then
# debug information should go to $SCRIPTLOG
echo "Debug Data" >> $SCRIPTLOG
# .....where the work to collect the data takes place
# ...
# The data collected should be written to $SNAPDIR .
touch $SNAPDIR/foo_output1
touch $SNAPDIR/foo_output2
fi
fi
Splitting of snap Output
If it is split, snap output might look like the following:
% ls -l
total 112048
-rw-r--r-- 1 lmic adm 6291456 Nov 26 09:56 snap.hastings.112603095649.pax.Z.xaa
-rw-r--r-- 1 lmic adm 6291456 Nov 26 09:56 snap.hastings.112603095649.pax.Z.xab
-rw-r--r-- 1 lmic adm 6291456 Nov 26 09:56 snap.hastings.112603095649.pax.Z.xac
-rw-r--r-- 1 lmic adm 6291456 Nov 26 09:56 snap.hastings.112603095649.pax.Z.xad
-rw-r--r-- 1 lmic adm 6291456 Nov 26 09:56 snap.hastings.112603095649.pax.Z.xae
-rw-r--r-- 1 lmic adm 6291456 Nov 26 09:56 snap.hastings.112603095649.pax.Z.xaf
-rw-r--r-- 1 lmic adm 6291456 Nov 26 09:56 snap.hastings.112603095649.pax.Z.xag
-rw-r--r-- 1 lmic adm 6291456 Nov 26 09:56 snap.hastings.112603095649.pax.Z.xah
-rw-r--r-- 1 lmic adm 6291456 Nov 26 09:56 snap.hastings.112603095649.pax.Z.xai
-rw-r--r-- 1 lmic adm 744518 Nov 26 09:56 snap.hastings.112603095649.pax.Z.xaj
An external product debug data collection command or script is a standalone executable. The script is registered with the snap framework before it can be used to collect user defined debug data. These scripts can be de-registered as per user discretion.
Following is the ODM class defined in the system.
#define DEFAULTSIZE 256
#define DATA_VALUESIZE 1024
class snap_config {
char product_name[DEFAULTSIZE]; key
char class[DEFAULTSIZE];key
char command_path[DATA_VALUESIZE];
vchar sc_reserved1[DATA_VALUESIZE];
vchar sc_reserved2[DATA_VALUESIZE];
}
Registration of Third Party Debug Script with Snap framework
export ODMDIR=/usr/lib/objrepos
product_name=myprod
class=myclass
command_path=/usr/lib/ras/snapscripts/bin/prod_name/myscript1.sh -t 10
export ODMDIR=/usr/lib/objrepos
odmadd myfile
command_path=<path>/ls|<path>/grep myfile
Deregistration of Third party debug scripts from Snap framework
export ODMDIR=/usr/lib/objrepos
odmdelete -o snap_config -q product_name=productname
Snap –z DELETE product_name=productname
snap -a
The
output of this command is written to the /tmp/ibmsupt directory. snap -c
snap -g -o /dev/rfd0
Output
is written to the /tmp/ibmsupt/general/lslpp.hac and /tmp/ibmsupt/general/general.snap files.
This command also writes the system information to a removable diskette. snap -e -m node1,node2
Output is written to the /tmp/ibmsupt/hacmp directory.snap foo1 "foo2 -x -y 3" "foo3 6"
Output is
written to /tmp/ibmsupt/snapscripts/foo1, /tmp/ibmsupt/snapscripts/foo2 and
/tmp/ibmsupt/snapscripts/foo3 assuming
the destination directory is the default, /tmp/ibmsupt.snap All
snap file:/tmp/scriptnames
A
sample input file to execute the scripts from example 5: foo1
foo2 -x -y 3
foo6
snap -a -c -O 4
snap -e -m node1,node2
snap -c
Submit the <pax.z> file to IBM according to the instructions of the service representative.
snap -e -m node1,node2
snap -a
snap -c
Submit the <pax.z> file to IBM according to the instructions of the service representative.
snap –z ADD "product_name=abc" "class=storage" "command_path=/usr/lpp/abc/debug_abc –a"
snap –z DELETE "product_name=abc"
snap –z "product_name=abc, product_name=def"
Item | Description |
---|---|
/usr/sbin/snap | Contains the snap command. |
/tmp/ibmsupt | Contains snap command output. |
/tmp/ibmsupt/general/lslpp.hac | Contains the output of the lslpp -hac command, which is required to recreate exact operating system environments. |
/tmp/ibmsupt/general/general.snap | Contains general system information that is collected with the snap -g command. |
/tmp/ibmsupt/testcase | Contains the test case that demonstrates your system problem. |