sybdiag

Description

sybdiag is a Java-based tool that collects comprehensive Adaptive Server configuration and environment data. Sybase Technical Support uses this information to diagnose server issues, thus expediting customer cases.

NoteYou must run sybdiag on the same machine as the monitored Adaptive Server.

Syntax

sybdiag -U username [-P password] -S [server_name | host:port]
	[-I interfaces_file] 
	[-L log_file] 
	[-N num_threads]
	[-O output_directory] 
	[-R resource_file] 
	[-T feature_list]
	[-h]
	[-m message_level] 
	[-v]

Parameters

-I interfaces_file

(optional) specifies the name of the interfaces file. If -I is specified, sybdiag uses the interfaces_file specified and displays an error if that file is not found. If -I is not specified, sybdiag first checks the LDAP server for the server entry, and if the entry is not found, sybdiag uses the default interfaces file in the directory specified by the SYBASE environment variable.

-L log_file

(optional) specifies the name of the log file that sybdiag creates. If log_file is not an absolute path, the log file is created in the directory where sybdiag is executed.

Whether you specify this parameter or not, sybdiag creates a default log file called sybdiag.log in the .zip output file.

-N num_threads

(optional) specifies the maximum number of parallel threads that sybdiag executes in parallel. The default value is 5. Do not change the default value unless you cannot execute parallel collections.

-O output_directory

(optional) specifies the name of a local directory in which to store sybdiag output. If not specified, sybdiag creates the output .zip file in the directory where the command was executed. The output file is named “sybdiag-<server name>-<datetime stamp>.zip”.

-R resource_file

(optional) specifies the resource file that sybdiag uses on start-up. Use this option only at the direction of Sybase Technical Support.

-P password

specifies your Adaptive Server password. If you do not specify the -P flag, sybdiag prompts for a password. If your password is NULL, use the -P flag without any password.

-S server_name | host:port

server_name specifies the name of the Adaptive Server to which sybdiag connects. sybdiag looks for this name in the interfaces file or the LDAP directory.

If you specify -S with no argument, sybdiag looks for a server named SYBASE. If you do not specify -S, sybdiag looks for the server specified by your DSQUERY environment variable.

host:port specifies the machine name and the port number.

-T feature_list

(optional) specifies the type of diagnostic data that sybdiag gathers, based on these feature_list values:

  • osdata – operating system data.

  • asecore – Adaptive Server configuration data.

  • aseadd – Adaptive Server monitoring data.

  • keyfile – information about Adaptive Server and operating system files.

All diagnostic data is collected if you do not specify -T. See “Viewing sybdiag output”.

-U username

specifies a case-sensitive login name.

-h

(optional) displays all help options.

-m message_level

(optional) displays different levels of error messages depending on the value of message_level:

  • 0 – no messages.

  • 1 – fatal errors only.

  • 2 – all errors.

  • 3 – warnings and all errors.

  • 4 – informational messages, warnings, and all errors.

  • 5 – debug and informational messages, warnings, and all errors.

By default, the error message display level is set to 4.

-v

(optional) displays version information.

Examples

Example 1

Collects all Adaptive Server diagnostics from /work/ASEInstall/ASE-15_0/bin, and creates an output file called sybdiag-testserver-20110312024652.zip in the same directory:

sybdiag -Usa -P -Stestserver

NoteFor readability, some lines have been omitted from this sample output.

Collecting data for "Adaptive Server Version" (ase_version) ...
Completed data collection for "Adaptive Server Version" (ase_version).
Collecting data for "Server License" (ase_license) ...
Completed data collection for "Server License" (ase_license).
Collecting data for "Adaptive Server Configuration" (ase_cfg) ...
Completed data collection for "Adaptive Server Configuration" (ase_cfg).
Collecting data for "Adaptive Server Non-default Configuration"
(ase_nondefault_cfg) ...
Completed data collection for "Adaptive Server Non-default
Configuration" (ase_nondefault_cfg).
...Lines deleted...
Collecting data for "Adaptive Server LDAP Configuration File" (ase_libtcl) ...
Completed data collection for "Adaptive Server LDAP Configuration File"
(ase_libtcl).
Collecting data for "Adaptive Server LDAP Configuration File (64bit)"
(ase_libtcl64) ...
Completed data collection for "Adaptive Server LDAP Configuration File
(64bit)" (ase_libtcl64).
Collecting data for "Virtual Memory Statistics" (os_vmstat) ...
Collecting data for "Adaptive Server General Performance Information"
(ase_sysmon) ...
Collecting data for "I/O Statistics" (os_iostat) ...
Collecting data for "CPU Statistics" (os_mpstat) ...
Completed data collection for "Virtual Memory Statistics" (os_vmstat).
Completed data collection for "I/O Statistics" (os_iostat).
Completed data collection for "CPU Statistics" (os_mpstat).
Completed data collection for "Adaptive Server General Performance
Information" (ase_sysmon).
Data collection statistics: 43 task(s) succeeded, 0 task(s) skipped, and
0 task(s) failed.
The collected data is stored as
/work/ASEInstall/ASE-15_0/bin/sybdiag-testserver-20110312024652.zip
Data collection completed.

Example 2

Collects basic Adaptive Server configuration data from /work/ASEInstall/ASE-15_0/bin, and creates an output file called sybdiag-smmdi_9966-20110502202909.zip in the same directory:

sybdiag -Usa -P -Ssmmdi:9966 -Tasecore
Collecting data for "Adaptive Server Version" (ase_version) ...
Completed data collection for "Adaptive Server Version" (ase_version).
Collecting data for "Server License" (ase_license) ...
Completed data collection for "Server License" (ase_license).
Collecting data for "Adaptive Server Configuration" (ase_cfg) ...
Completed data collection for "Adaptive Server Configuration" (ase_cfg).
Collecting data for "Adaptive Server Non-default Configuration" 
(ase_nondefault_cfg) ...
Completed data collection for "Adaptive Server Non-default Configuration"
(ase_nondefault_cfg).
Collecting data for "Remote Server Configuration" (ase_remote_server)...
Completed data collection for "Remote Server Configuration" (ase_remote_server).
Collecting data for "Adaptive Server Script Version" (ase_script_version) ...
Completed data collection for "Adaptive Server Script Version" (ase_script_version).
Collecting data for "Adaptive Server Configuration Monitor" (ase_mon_cfg) ...
Completed data collection for "Adaptive Server Configuration Monitor" (ase_mon_cfg).
Collecting data for "Adaptive Server Cache Configuration" (ase_cache_cfg) ...
Completed data collection for "Adaptive Server Cache Configuration" (ase_cache_cfg).
Collecting data for "Adaptive Server Pool Configuration" (ase_pool_cfg) ...
Completed data collection for "Adaptive Server Pool Configuration" (ase_pool_cfg).
Collecting data for "Adaptive Server Shared Memory Dump Configuration"
(ase_shmdumpconfig) ...
Completed data collection for "Adaptive Server Shared Memory Dump
Configuration" (ase_shmdumpconfig).
Collecting data for "Adaptive Server Traceflags and Switches" (ase_switches) ...
Completed data collection for "Adaptive Server Traceflags and Switches"
(ase_switches).
Data collection statistics: 11 task(s) succeeded, 0 task(s) skipped, and
0 task(s) failed.
The collected data is stored as /work/ASEInstall/ASE-15_0/bin/sybdiag
smmdi_9966-20110502202909.zip
Data collection completed.

Usage

sybdiag connects to an Adaptive Server and executes stored procedures such as sp_configure, and queries to tables like monLicense. It collects operating system and platform diagnostic information by executing commands such as ps, vmstat, and netstat.

The output of sybdiag is a compressed ZIP file containing HTML and data files that can be uncompressed and viewed in a Web browser. The information collected includes operating system and environment data, Adaptive Server configuration and monitoring data, and Adaptive Server files and scripts.

sybdiag does not collect Adaptive Server or operating system data for logins, passwords, or user lists, and does not collect information from application database tables.


Configuring options for sybdiag

To generate certain reports, you must enable corresponding configuration options using sp_configure, or by editing the server configuration file. If configuration options are set incorrectly, sybdiag skips the related reports.

Option

Value

sybdiag Reports

enable monitoring

1

Adaptive Server Wait Events

Adaptive Server Locks

Adaptive Server Deadlock History

wait event timing

1

Adaptive Server Wait Events

deadlock pipe active

1

Adaptive Server Deadlock History

deadlock pipe max messages

Nonzero value; must be large enough to capture all relevant deadlock rows

Adaptive Server Deadlock History


Viewing sybdiag output

The sybdiag output is in a compressed file in this format: sybdiag-servername-datetime_stamp.zip. To generate individual output files, uncompress the zip file.The ZIP file contains these HTML, data, and log files:

Permissions

NoteIf you do not have the required permissions on a file, sybdiag displays an error message does not process that file.