[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Understanding the Diagnostic Subsystem for AIX

Diagnostic User Interface

Diagnostics uses the AIX Screen Library (ASL) for the user interface. This is the same interface that System Management Interface Tool (SMIT) uses. All diagnostic programs should use the diag_asl_{} function calls described in Diagnostic Library section of this guide to implement this user interface.

Screen Size Assumptions

In order for Diagnostics to run in a window, a minimum screen dimension of 24 lines by 80 columns is required.

Screen Layout

Each screen that is displayed should follow the general layout shown below:

 .Title Line                                                          .  .menu# .
 .Title Line (if needed, or blank line)                                         .
 ................................................................................
 .information and command line 1                                                .
 .information and command line 2                                                .
 .information and command line 3                                                .
 .                                                                              .
 .                                                                              .
 .                                                                              .
 .                                                                              .
 .                                                                              .
 .                                                                              .
 .information, commands, and prompt lines                                       .
 .                                                                              .
 .prompt lines
 .                                                                              .
 .                                                                              .
 .                                                                              .
 .                                                                              .
 .                                                                              .
 .                                                                              .
 .                                                                              .
 ................................................................................
 .blank  line                                                                   .
 .Information Line 1
 .Information Line 2 (if needed)
    

Supported Screen Types

INFORMATIONAL SCREENS

The following screen types put informational text on the screen, and then waits for the user to press a key to continue, or exit. The function keys supported by the screen type follows in parans ().

The following screen types put informational text on the screen and then exits without waiting for any user response. These support CANCEL, and EXIT only.

DIALOG SCREENS

The following screen type is a dialog screen. This screen requires that the user be able to enter data information into selected fields. After data is entered, then a key is pressed to continue.

SINGLE SELECTION SCREENS

The following screen types put informational text on the screen and then waits for the user to make a selection. Only one selection item is permitted.

MULTIPLE SELECTION SCREENS

The following screen types put informational text on the screen and waits for the user to make one or more selections from a list.

POPUP SCREEN

The following screen type supports a popup message.

Supported Function Keys

The list of function keys below show the currently supported keys.

Programming Information

Header file /usr/include/asl.h contains the data structures used to create ASL menus. The diagnostic header file /usr/include/diag/diago.h references the asl file, and should be included in every application program. The programmer should also be familiar with the ASL_SCR_TYPE and ASL_SCR_INFO structures. They both should be instantiated at the beginning of any function that builds menus:

      ASL_SCR_INFO    *menuinfo;
      ASL_SCR_TYPE     menutype = DM_TYPE_DEFAULTS;

Normally the title is the first element in the array of text strings (struct ASL_SCR_INFO), and the instruction line is the last element. The elements in between are subject to scrolling.

The dialog and selection menus are built differently than the other menu types. Each text line or group of text lines are stored in a ASL_SCR_INFO structure. The first structure member, menuinfo[0], is normally where the title line and possibly following instructional lines are. The last structure member, menuinfo[n], contains the text that is placed just before the selection or dialogue list. All other structure members are treated as selections or dialog entries, and are also subject to scrolling.

Suggested Generic Prompts

All prompts should be generic in nature. This eases the transition of code from one interface to another, such as using a Web-based interface. The prompts below should be used where ever appropriate.

Sample Screen Types


ASL_DIAG_KEYS_ENTER_SC
ASL_DIAG_NO_KEYS_ENTER_SC
ASL_DIAG_ENTER_SC
ASL_DIAG_ENTER_HELP_SC
--------------------------------------------------------------------------------
PRODUCT TOPOLOGY SERVICE AID                                              802604

REMOVE.........the diskette, if any, from the diskette drive.
INSERT.........the Product Topology Update Diskette into the drive.

               If an EC, MES, or external device was installed, use
               the Update Diskette that was shipped with the EC, MES,
               or external device.  Otherwise, use one of the Update
               Diskettes shipped with the system and stored in the
               Service Information Binder.

When finished, use Enter to continue..











F1=Help             F3=Cancel           F10=Exit            Enter
--------------------------------------------------------------------------------

ASL_DIAG_OUTPUT_LEAVE_SC
--------------------------------------------------------------------------------
DISK MEDIA SERVICE AID                                                    802584

Device:  hdisk2 in location 00-08-00-3,0

The certify operation is in progress.

Please stand by.

1% completed.


Disk Drive Capacity................... 400 MB
Data Errors Recovered................. 0
Data Errors Not Recovered............. 0
Equipment Check Errors Recovered...... 0
Equipment Check Errors Not Recovered.. 0







F3=Cancel           F10=Exit
--------------------------------------------------------------------------------

ASL_DIAG_LEAVE_NO_KEYS_SC
--------------------------------------------------------------------------------
DISK MAINTENANCE SERVICE AID                                              802324

Disk to Disk Copy.

The certify operaCopying hdisk1 to
hdisk2.

20% Complete.

Please stand by. 














--------------------------------------------------------------------------------

ASL_DIAG_DIALOGUE_SC
--------------------------------------------------------------------------------
ALTER VPD                                                                 802033

 mem0              00-0A             8 MB Memory Card

Type or select the values in the entry field or fields.
Items with data in brackets [] may be altered.


  EC Level....................                                     00
  Device Specific.(Z0)........                                     00
  Device Specific.(Z1)........                                     00
  Device Specific.(Z2)........                                     00
  User Data...................                                    []









F1=Help             F2=Refresh          F3=Cancel           F4=List
F5=Reset            F7=Commit           F10=Exit
--------------------------------------------------------------------------------


ASL_DIAG_LIST_CANCEL_EXIT_SC
ASL_DIAG_LIST_CANCEL_EXIT_HELP_SC
Note: F1=Help key added.

ASL_DIAG_LST_PREV_EXIT_HLP_SC
ASL_DIAG_LST_SELECT_PREV_HLP_SC
ASL_DIAG_LIST_COMMIT_SC
ASL_DIAG_LIST_COMMIT_HELP_SC
ASL_DIAG_LST_SELECT_COMMIT_HLP_SC
ASL_DIAG_DIALOGUE_HELP_SC
Note: This is used by the diag_emsg and diag_asl_msg library function calls. These library functions should only be used by Tasks and Service Aids. The resultant screen is a popup similiar to:
--------------------------------------------------------------------------------
TASKS SELECTION LIST                                                      801004


From the list below, select a task by moving the cursor to
the task and pressing 'Enter'.
To list the resources for the task highlighted, press 'List'.

[MORE...15]
  Delete Res--------------------------------------------------------
  SCSI BUS A|                                                      |
  Download M|                                                      |
  Display or| The task does not require resource selection,        |
  Periodic D|                 OR,                                  |
  Backup and| no resources were found to support the task.         |
  Disk Maint|                                                      |
  Product To|                                                      |
  Add or Del|                                                      |
  Create Cus|                                                      |
  Update Dis|                                                      |
  AIX Shell |                                                      |
[MORE...6]  |                                                      |
            |                                                      |
F1=Help     | F3=Cancel        F10=Exit         Enter              |
F3=Previous --------------------------------------------------------
--------------------------------------------------------------------------------


TESTING DEVICE SCREEN
struct tm_input tm_input;
char *text_array[3];

/* initialize locale and ASL */
set_locale ( LC_ALL, 0 );
diag_asl_init("DEFAULT");

/* initialize the ODM */
init_dgodm();

/* get the DA input */
getdainput( &tm_input );

/* fill in char array with menu info */
text_array[0] = get_dev_desc ( tm_input.dname );
text_array[1] = tm_input.dname;
text_array[2] = tm_input.dnameloc;

/* display the menu */
rc = diag_display_menu( CUSTOMER_TESTING_MENU, 0x954001,          
                        text_array, 0, 0 );

Output Panel/No Response Required (Example 2)
--------------------------------------------------------------------------------
TESTING SCSI DISK DRIVE hdisk2 IN LOCATION 00-08-00-3,0                   954001
IN ADVANCED MODE

Please stand by.



















F3=Cancel           F10=Exit
--------------------------------------------------------------------------------
struct tm_input tm_input;
char *text_array[3];

/* initialize locale and ASL */
set_locale ( LC_ALL, 0 );
diag_asl_init("DEFAULT");

/* initialize the ODM */
init_dgodm();

/* get the DA input */
getdainput( &tm_input );

/* fill in char array with menu info */
text_array[0] = get_dev_desc ( tm_input.dname );
text_array[1] = tm_input.dname;
text_array[2] = tm_input.dnameloc;

/* display the menu */
rc = diag_display_menu( ADVANCED_TESTING_MENU, 0x954001,          
                        text_array, 0, 0 );

Output Panel/No Response Required (Example 3)
--------------------------------------------------------------------------------
TESTING SCSI DISK DRIVE hdisk2 IN LOCATION 00-08-00-3,0                   954001
IN ADVANCED MODE

Testing multiple times.

  2 passes completed.
  1 errors logged.

To stop the test, use 'Cancel'.














F3=Cancel           F10=Exit
--------------------------------------------------------------------------------
struct tm_input tm_input;
char *text_array[3];

/* initialize locale and ASL */
set_locale ( LC_ALL, 0 );
diag_asl_init("DEFAULT");

/* initialize the ODM */
init_dgodm();

/* get the DA input */
getdainput( &tm_input );

/* fill in char array with menu info */
text_array[0] = get_dev_desc ( tm_input.dname );
text_array[1] = tm_input.dname;
text_array[2] = tm_input.dnameloc;

/* display the menu */
rc = diag_display_menu( LOOPMODE_TESTING_MENU, 0x954001,
                        text_array, tminput.lcount,
                        tm_input.lerrors );

Output Panel/Response Required (Example 1)
--------------------------------------------------------------------------------
SERIAL DISK ADAPTER OPERATIONAL MICROCODE IS MISSING                      870001

The Serial disk adapter operational microcode is either missing
or not accessable.

This microcode is necessary in order to use the Serial disk adapter
in normal system operations. 

Use Enter to continue. 














F3=Cancel           F10=Exit             Enter
--------------------------------------------------------------------------------
===========================================================
CATALOG FILE

set SET1
MSG1
"SERIAL DISK ADAPTER 
MSG2
"Serial Disk adapter
===========================================================

nl_catd fdes;
struct tm_input tm_input;
char *text_array[3];

/* initialize locale and ASL */
set_locale ( LC_ALL, 0 );
diag_asl_init("DEFAULT");

/* open the catalog file */
fdes = diag_catopen(CATALOG_FILE_NAME, 0);

/* initialize the ODM */
init_dgodm();

/* get the DA input */
getdainput( &tm_input );

/* fill in char array with menu info */
text_array[0] = diag_cat_gets ( fdes, SET1, MSG1 );
text_array[1] = diag_cat_gets ( fdes, SET1, MSG2 );
text_array[2] = diag_cat_gets ( fdes, SET1, MSG2 );

/* display the menu */
rc = diag_display_menu( NO_MICROCODE_MENU, 0x870001, 
                        text_array, 0, 0 );

Output Panel/Response Required (Example 2)
--------------------------------------------------------------------------------
SERIAL DISK ADAPTER DIAGNOSTIC MICROCODE IS MISSING                       870001

The Serial disk adapter diagnostic microcode is either missing
or not accessable.

This microcode is necessary in order to run diagnostics 
on the Serial disk adapter

Use Enter to continue. 














F3=Cancel           F10=Exit             Enter
--------------------------------------------------------------------------------
===========================================================
CATALOG FILE

set SET1
MSG1
"SERIAL DISK ADAPTER 
MSG2
"Serial Disk adapter
===========================================================

nl_catd fdes;
struct tm_input tm_input;
char *text_array[3];

/* initialize locale and ASL */
set_locale ( LC_ALL, 0 );
diag_asl_init("DEFAULT");

/* open the catalog file */
fdes = diag_catopen(CATALOG_FILE_NAME, 0);

/* initialize the ODM */
init_dgodm();

/* get the DA input */
getdainput( &tm_input );

/* fill in char array with menu info */
text_array[0] = diag_cat_gets ( fdes, SET1, MSG1 );
text_array[1] = diag_cat_gets ( fdes, SET1, MSG2 );
text_array[2] = diag_cat_gets ( fdes, SET1, MSG2 );

/* display the menu */
rc = diag_display_menu( NO_DIAGMICROCODE_MENU, 0x870001,
                        text_array, 0, 0 );

Output Panel/Response Required (Example 3)
--------------------------------------------------------------------------------
SERIAL DISK ADAPTER DEVICE DRIVER IS MISSING                              870001

The Serial disk adapter device driver is either missing
or not accessable.

This device driver is necessary in order to use the Serial disk adapter
in normal system operations. 

Use Enter to continue. 














F3=Cancel           F10=Exit             Enter
--------------------------------------------------------------------------------
===========================================================
CATALOG FILE

set SET1
MSG1
"SERIAL DISK ADAPTER 
MSG2
"Serial Disk adapter
===========================================================

nl_catd fdes;
struct tm_input tm_input;
char *text_array[3];

/* initialize locale and ASL */
set_locale ( LC_ALL, 0 );
diag_asl_init("DEFAULT");

/* open the catalog file */
fdes = diag_catopen(CATALOG_FILE_NAME, 0);

/* initialize the ODM */
init_dgodm();

/* get the DA input */
getdainput( &tm_input );

/* fill in char array with menu info */
text_array[0] = diag_cat_gets ( fdes, SET1, MSG1 );
text_array[1] = diag_cat_gets ( fdes, SET1, MSG2 );
text_array[2] = diag_cat_gets ( fdes, SET1, MSG2 );

/* display the menu */
rc = diag_display_menu( NO_DDFILE_MENU, 0x870001, 
                        text_array, 0, 0 );

MenuGoal
--------------------------------------------------------------------------------
TESTING SCSI DISK DRIVE hdisk0 IN LOCATION 00-08-00-3,0                   891001


A number of attributes are found to be missing from the Data Base. 
Unexpected results may occur due to this problem. 
  
 
















F3=Cancel           F10=Exit
--------------------------------------------------------------------------------
===========================================================
CATALOG FILE

set DHF_SET1
MISSING_ATTRIBUTES "%1$6X \
TESTING SCSI DISK DRIVE %2$s IN LOCATION %3$s\n\n\n\
A number of attributes are found to be missing from the Data 
Base.\n\
Unexpected results may occur due to this problem."
$
$ This menu goal is used when ODM attributes cannot be
$ obtained.
===========================================================

nl_catd fdes;
struct tm_input tm_input;
long menu_nmbr;
char msgstr[1024];

/* initialize locale and ASL */
set_locale ( LC_ALL, 0 );
diag_asl_init("DEFAULT");

/* open the catalog file */
fdes = diag_catopen(CATALOG_FILE_NAME, 0);

/* initialize the ODM */
init_dgodm();

/* get the DA input */
getdainput( &tm_input );

/* The menu number MUST be the first item in the character 
buffer. The menu goal title follows the menu number with a single 
space between. Everything after the first carriage return is 
considered menu text. */

menu_nmbr = 0x891001;
sprintf( msgstr, (char *) diag_cat_gets(fdes,
          DHF_SET1, MISSING_ATTRIBUTES), menu_nmbr,
          tm_input.dname, tm_input.dnameloc);
menugoal(msgstr);

[ Previous | Next | Contents | Home | Search ]