Administer > Log files > Extract session data

Extract session data

SA saves context and other information about jobs, also known as “way sessions” or simply “sessions.” By default, this session data is kept for seven days before being garbage-collected to reuse space. This data can be useful for troubleshooting job and session problems. You also may want to save valid session data for comparison with problematic cases.

You can use the dump_session tool to extract and save this information. The dump_session tool generates a tarball file containing the session data in a file named Session<job_ID>.pkl.gz.

This section describes the dump_session tool and how to use it to extract session data.

To capture session data for an SA job, perform the following steps:

  1. Determine the numeric job ID of the problematic job or command. For jobs, select the Jobs and Sessions tab in the SA Client and locate the desired job. The job ID is listed in the Job ID column.

  2. Log into the SA core server.

  3. Run the dump_session tool, and provide the job ID as the first argument. For example:

    # /opt/opsware/bin/dump_session <job_ID>

  4. Save the session output, which is a tarball in the current working directory named Session<ID>.pkl.gz.

  5. If requested by HPE Support, attach the tarball to the support incident for the problem.

Listing recent sessions

You can list the most recent set of jobs by running dump_session with the -l option and specifying the number of jobs you want to see. For example, the following command lists the most recent 25 jobs:

# /opt/opsware/bin/dump_session -l 25

The default number of jobs listed with -l is ten.

The following is sample output for five sessions:

# /opt/opsware/bin/dump_session -l 5

Session ID | Start Date | Session Desc

26000001 | 20100902T12:00:01 | 'Automated Communications Test for core 1'

25980001 | 20100902T15:00:00 | 'opsware.patch_compliance'

26030001 | 20100902T17:51:57 | 'Communication Test'

25990001 | 20100903T00:00:00 | 'Automated Hypervisor Scan for core: 1'

26010001 | 20100903T00:00:01 | 'Automated Communications Test for core 1'

Sample output

The following shows a sample dump_session command and sample output for SA job ID 1870001:

# /opt/opsware/bin/dump_session 1870001

Dumping session to 'Session1870001.pkl.gz'

Session:1870001

MegaServiceInstance:20001

WayScriptVersion:1830001

SecurityUser:60001

Realm:0

Device:10001

WayScript:1830001

dump_session command reference

This describes the dump_session command syntax and options. The dump_session command is at /opt/opsware/bin/dump_session. It extracts and formats SA sessions and related commands from the SA database.

Syntax

dump_session [<session_id> ...] [<session_file> ...] [-h] [-l <num>] [-d<num>]

Options

The following table lists the options to the dump_session command.

dump_session options

Option

Description

<session_id>

Specifies one or more SA job IDs. Information about these jobs will be copied from the SA database to a gzipped, multi-pickle file named “<session_id>.pkl.gz” in the current working directory.

<session_file>

Specifies one or more previously saved<session_id>.pkl.gz files. These files will be processed and converted into a static HTML directory structure resembling the waybot’s backend web UI.

-h

Displays help information.

-l <num>

Displays to stdout the last <num> number of SA jobs executed on each core in the mesh. If <num> is omitted, then 10 is assumed. <num> can only be omitted when -l is the last argument on the command line.

-d<num>

Sets the debug level to the specified number.