Administrator's Reference

QUERY EVENT (Query Scheduled and Completed Events)

Use the QUERY EVENT command to display scheduled and completed events. The QUERY EVENT command takes two forms, depending on whether the query applies to scheduled client operations or scheduled administrative commands. The syntax and parameters for each form are defined separately.

Each scheduled client operation and administrative command is called an event. The server tracks each scheduled event and records the results of each function in the database. An event record is created whenever processing of a scheduled command is started or missed.

The QUERY EVENT command may display information about an event for which there is no event record. For example, if you request information about a scheduled future event, the QUERY EVENT command will display the status of Future for the event even though no event record has been created for this event. In addition, the QUERY EVENT command will display the status for past events whose event records have already been removed from the database. In this case, the server returns the status of Uncertain because the actual event status cannot be determined without the event records.

See the QUERY ACTLOG command for more detailed information about event messages logged by the client and server. Use the SELECT command to customize SQL queries to get additional information about the ADSM database.

Querying Events for Client Schedules: Use the QUERY EVENT command to display scheduled and completed events for selected clients. You can specify a time range to limit output to events whose scheduled start times fall within the range.

You can request one of two different types of queries: general reporting or exception reporting. To request a general report of scheduled events, specify this command with EXCEPTIONSONLY=NO (the default). For each schedule that matches the specified policy domain and schedule name, the expected startup windows are determined within the specified time range. ADSM provides output data that indicates scheduled start times, along with any actual execution information which can be obtained from existing output records.

To request an exception report, specify EXCEPTIONSONLY=YES. ADSM provides information about scheduled operations that have not executed successfully, either because they have not executed as scheduled or because they have failed during execution. This mode differs from EXCEPTIONSONLY=NO, in that output is restricted as follows:

No information is displayed for an event unless both of the following conditions are met:

Processing of this command can require intensive computations, especially if multiple startup windows must be calculated. To minimize the processing time when querying events:

Privilege Class

Any administrator can issue this command.

Syntax for Querying Events for Client Schedules

                                           .-Type--=--Client--.
>>-Query EVent--domainname--schedulename---+------------------+->
 
>---+----------------------------+------------------------------>
    |           .-,-----------.  |
    |           V             |  |
    '-Nodes--=-----nodename---+--'
 
    .-BEGINDate--=--currentdate--.
>---+----------------------------+------------------------------>
    '-BEGINDate--=--begindate----'
 
     .-BEGINTime--=--00:00-------.  .-ENDDate--=--begindate--.
>----+---------------------------+--+------------------------+-->
     '-BEGINTime--=--begintime---'  '-ENDDate--=--enddate----'
 
     .-ENDTime--=--23:59-----.  .-EXceptionsonly--=--No-------.
>----+-----------------------+--+-----------------------------+->
     '-ENDTime--=--endtime---'  '-EXceptionsonly--=--+-No--+--'
                                                     '-Yes-'
 
     .-Format--=--Standard------.
>----+--------------------------+------------------------------><
     '-Format--=--+-Standard-+--'
                  '-Detailed-'
 

Parameters for Querying Events for Client Schedules

domainname

Specifies the name of the policy domain to which the schedules belong. This parameter is required. You can use a pattern-matching expression to specify this name. All matching policy domains are queried.

schedulename

Specifies the name of the schedule for which events are displayed. This parameter is required. You can use a pattern-matching expression to specify this name. All matching schedule names are queried.

Type=Client

Specifies that this command should query events for client schedules. This parameter is optional. The default value is CLIENT. Administrative command schedule events are queried by specifying TYPE=ADMINISTRATIVE.

Nodes=nodename

Specifies the name of the client node that belongs to the specified policy domain for which events are displayed. You can specify more than one client name by separating each name with a comma, with no intervening spaces. You can use a pattern-matching expression to specify a name. All matching clients are queried. If you do not specify a client name, events for all clients matching the DOMAINNAME and SCHEDULENAME parameters are displayed.

BEGINDate=date

Specifies the beginning date of the time range for the events to be displayed. All events that were scheduled to start during this time are displayed. This parameter is optional. The default value is the current date.

Possible values are:

MM/DD/YYYY

Specifies the date for the beginning of the time range in MM/DD/YYYY format (for example, 01/31/1997).

TODAY

Specifies that the beginning of the time range is the current date.

TODAY-numdays or -numdays

Specifies that the beginning of the time range is a specific number of days before the current date. The maximum value for the number of days is 9999.

For example, to query events scheduled to start during the past 7 days, you can specify one of the following parameter combinations:

BEGINDATE=TODAY-7 ENDDATE=TODAY
                or
BEGINDATE=-7 ENDDATE=TODAY

TODAY+numdays or +numdays

Specifies that the beginning of the time range is a specific number of days after the current date. The maximum value for the number of days is 9999.

For example, to query events scheduled to start two days from now, you can specify one of the following parameters:

BEGINDATE=TODAY+2
            or
BEGINDATE=+2

BEGINTime=time

Specifies the beginning time of the range for events to be displayed, in HH:MM format. All events scheduled to start during this time are displayed. This parameter is optional. The default value is 00:00.

Possible values are:

HH:MM:SS

Specifies the beginning of the time range on the specified begin date using HH:MM:SS format (for example, 12:33:28).

NOW

Specifies that the beginning of the time range is the current time on the specified begin date.

NOW+numhours:numminutes or +numhours:numminutes

Specifies that the beginning of the time range is the current time plus a specific number of hours (and, optionally, minutes) on the specified begin date.

For example, if you issue this command at 9:00 and you want to query events scheduled to start 3 hours from now, you can specify one of the following parameters:

BEGINTIME=NOW+03:00
               or
BEGINTIME=+03:00

ADSM displays events at 12:00 on the specified begin date.

NOW-numhours:numminutes or -numhours:numminutes

Specifies that the beginning of the time range is the current time minus a specific number of hours (and, optionally, minutes) on the specified begin date.

For example, if you issue this command at 9:00 and you want to query events scheduled to start during the last 4 hours, you can specify one of the following parameters:

BEGINTIME=NOW-04:00 ENDTIME=NOW
               or
BEGINTIME=-04:00 ENDTIME=NOW

ADSM displays events at 5:00 on the specified begin date.

ENDDate=date

Specifies the ending date of the time range for events to be displayed. All events that were scheduled to start during this time are displayed. This parameter is optional. The default value is the value used for the BEGINDATE.

Possible values are:

MM/DD/YYYY

Specifies the date for the end of the time range in MM/DD/YYYY format (for example, 04/30/1997).

TODAY

Specifies that the end of the time range is the current date.

TODAY-numdays or -numdays

Specifies that the end of the time range is a specific number of days before the current date. The maximum value for the number of days is 9999.

For example, to query events scheduled to start during a one-week period that ended yesterday, you can specify one of the following parameter combinations:

BEGINDATE=TODAY-8 ENDDATE=TODAY-1
                or
BEGINDATE=-8 ENDDATE=-1

TODAY+numdays or +numdays

Specifies that the end of the time range is a specific number of days after the current date. The maximum value for the number of days is 9999.

For example, to query events scheduled to start during the next week, you can specify one of the following parameter combinations:

BEGINDATE=TODAY ENDDATE=TODAY+7
                or
BEGINDATE=TODAY ENDDATE=+7

ENDTime=time

Specifies the ending time of the range for events to be displayed, in HH:MM format. All events scheduled to start during this time are displayed. This parameter is optional. The default value is 23:59.

Possible values are:

HH:MM:SS

Specifies the ending of the time range at a specific time on the specified end date using HH:MM:SS format (for example, 12:33:28).

NOW

Specifies the ending of the time range is the current time on the specified end date.

NOW+numhours:numminutes or +numhours:numminutes

Specifies that the ending of the time range is the current time plus a specific number of hours (and, optionally, minutes) on the specified end date.

For example, if you issue this command at 9:00 and you want to query events scheduled to start 3 hours from now, you can specify one of the following parameters:

BEGINTIME=NOW ENDTIME=NOW+03:00
               or
BEGINTIME=NOW ENDTIME=+03:00

NOW-numhours:numminutes or -numhours:numminutes

Specifies that the ending of the time range is the current time minus a specific number of hours (and, optionally, minutes) on the specified end date.

For example, if you issue this command at 9:00 and you want to query events scheduled to start during the last 4 hours, you can specify one of the following parameters:

BEGINTIME=NOW-04:00 ENDTIME=NOW
               or
BEGINTIME=-04:00 ENDTIME=NOW

ADSM displays events that were scheduled to start at 5:00 on the specified end date.

EXceptionsonly=exceptionvalue

Specifies the type of query information you want on scheduled or completed events. This parameter is optional. The default value is NO. Possible values are:

No

Specifies that information on past and projected events is displayed.

Yes

Specifies that only those events which failed or did not execute as scheduled will be displayed.

Format=formatvalue

Specifies how the information is displayed. This parameter is optional. The default value is STANDARD. Possible values are:

Standard

Specifies that partial information for events is displayed.

Detailed

Specifies that complete information for events is displayed.

Querying Events for Administrative Command Schedules: Use the QUERY EVENT command to display scheduled and completed events for selected administrative command schedules.

You can request one of two different types of queries: general reporting or exception reporting. To request a general report of scheduled events, specify this command with EXCEPTIONSONLY=NO (the default). For each schedule that matches the specified schedule name, the expected startup windows are determined within the specified time range. ADSM provides output data that indicates scheduled start times, along with any actual execution information which can be obtained from existing output records.

Processing of this command can require intensive computations, especially if multiple startup windows must be calculated. To minimize the processing time when querying events:

Syntax for Querying Events for Administrative Command Schedules

>>-Query EVent--schedulename--Type--=--Administrative----------->
 
    .-BEGINDate--=--currentdate--.
>---+----------------------------+------------------------------>
    '-BEGINDate--=--begindate----'
 
     .-BEGINTime--=--00:00-------.  .-ENDDate--=--begindate--.
>----+---------------------------+--+------------------------+-->
     '-BEGINTime--=--begintime---'  '-ENDDate--=--enddate----'
 
     .-ENDTime--=--23:59-----.  .-EXceptionsonly--=--No-------.
>----+-----------------------+--+-----------------------------+->
     '-ENDTime--=--endtime---'  '-EXceptionsonly--=--+-No--+--'
                                                     '-Yes-'
 
     .-Format--=--Standard------.
>----+--------------------------+------------------------------><
     '-Format--=--+-Standard-+--'
                  '-Detailed-'
 

Parameters for Querying Events for Administrative Command Schedules

schedulename

Specifies the name of the schedule for which events are displayed. This parameter is required. You can use a pattern-matching expression to specify this name. All matching schedule names are queried.

Type=Administrative

Specifies that you want to query events for administrative command schedules. This parameter is required for querying administrative command schedules.

BEGINDate=date

Specifies the beginning date of the time range for the events to be displayed. All events that were scheduled to start during this time are displayed. This parameter is optional. The default value is the current date.

Possible values are:

MM/DD/YYYY

Specifies the date for the beginning of the time range in MM/DD/YYYY format (for example, 04/30/1997).

TODAY

Specifies that the beginning of the time range is the current date.

TODAY-numdays or -numdays

Specifies that the beginning of the time range is a specific number of days before the current date. The maximum value for the number of days is 9999.

For example, to query events scheduled to start during the past 7 days, you can specify one of the following parameter combinations:

BEGINDATE=TODAY-7 ENDDATE=TODAY
                or
BEGINDATE=-7 ENDDATE=TODAY

TODAY+numdays or +numdays

Specifies that the beginning of the time range is a specific number of days after the current date. The maximum value for the number of days is 9999.

For example, to query events scheduled to start two days from now, you can specify one of the following parameters:

BEGINDATE=TODAY+2
            or
BEGINDATE=+2

BEGINTime=time

Specifies the beginning time of the range for events to be displayed, in HH:MM format. All events scheduled to start during this time are displayed. This parameter is optional. The default value is 00:00.

Possible values are:

HH:MM:SS

Specifies the time for the beginning of the time range on the specified begin date using HH:MM:SS format (for example, 12:33:28).

NOW

Specifies that the beginning of the time range is the current time on the specified begin date.

NOW+numhours:numminutes or +numhours:numminutes

Specifies that the beginning of the time range is the current time plus a specific number of hours (and, optionally, minutes) on the specified begin date.

For example, if you issue this command at 9:00 and you want to query events scheduled to start 3 hours from now, you can specify one of the following parameters:

BEGINTIME=NOW+03:00
               or
BEGINTIME=+03:00

ADSM displays events at 12:00 on the specified begin date.

NOW-numhours:numminutes or -numhours:numminutes

Specifies that the beginning of the time range is the current time minus a specific number of hours (and, optionally, minutes) on the specified begin date.

For example, if you issue this command at 9:00 and you want to query events scheduled to start during the last 4 hours, you can specify one of the following parameters:

BEGINTIME=NOW-04:00 ENDTIME=NOW
               or
BEGINTIME=-04:00 ENDTIME=NOW

ADSM displays events at 5:00 on the specified begin date.

ENDDate=date

Specifies the ending date of the time range for events to be displayed. All events that were scheduled to start during this time are displayed. This parameter is optional. The default value is the value used for the BEGINDATE parameter.

Possible values are:

MM/DD/YYYY

Specifies the date for the end of the time range in MM/DD/YYYY format (for example, 04/30/1997).

TODAY

Specifies that the end of the time range is the current date.

TODAY-numdays or -numdays

Specifies that the end of the time range is a specific number of days before the current date. The maximum value for the number of days is 9999.

For example, to query events scheduled to start during a one-week period that ended yesterday, you can specify one of the following parameter combinations:

BEGINDATE=TODAY-8 ENDDATE=TODAY-1
                or
BEGINDATE=-8 ENDDATE=-1

TODAY+numdays or +numdays

Specifies that the end of the time range is a specific number of days after the current date. The maximum value for the number of days is 9999.

For example, to query events scheduled to start during the next week, you can specify one of the following parameter combinations:

BEGINDATE=TODAY ENDDATE=TODAY+7
                or
BEGINDATE=TODAY ENDDATE=+7

ENDTime=time

Specifies the ending time of the range for events to be displayed, in HH:MM format. All events scheduled to start during this time are displayed. This parameter is optional. The default value is 23:59.

Possible values are:

HH:MM:SS

Specifies the time for the ending of the time range on the specified end date using HH:MM:SS format (for example, 12:33:28).

NOW

Specifies that the ending of the time range is the current time on the specified end date.

NOW+numhours:numminutes or +numhours:numminutes

Specifies that the ending of the time range is the current time plus a specific number of hours (and, optionally, minutes) on the specified end date.

For example, if you issue this command at 9:00 and you want to query events scheduled to start 3 hours from now, you can specify one of the following parameters:

BEGINTIME=NOW ENDTIME=NOW+03:00
               or
BEGINTIME=NOW ENDTIME=+03:00

NOW-numhours:numminutes or -numhours:numminutes

Specifies that the ending of the time range is the current time minus a specific number of hours (and, optionally, minutes) on the specified end date.

For example, if you issue this command at 9:00 and you want to query events scheduled to start during the last 4 hours, you can specify one of the following parameters:

BEGINTIME=NOW-04:00 ENDTIME=NOW
               or
BEGINTIME=-04:00 ENDTIME=NOW

ADSM displays events that were scheduled to start at 5:00 on the specified end date.

EXceptionsonly=exceptionvalue

Specifies the type of query information you want on scheduled or completed events. This parameter is optional. The default value is NO. Possible values are:

No

Specifies that information on past and projected events is displayed.

Yes

Specifies that only those events which failed or did not execute as scheduled will be displayed.

Format=formatvalue

Specifies how the information is displayed. This parameter is optional. The default value is STANDARD. Possible values are:

Standard

Specifies that partial information for events is displayed.

Detailed

Specifies that complete information for events is displayed.

Examples

Task 1

Display partial information for all events scheduled for DOMAIN1 that did not execute successfully. Limit the search to the client named JOE. Limit the events displayed to those scheduled to occur from February 11, 1997 (02/11/1997) to February 12, 1997 (02/12/1997).

Command:
query event domain1 * nodes=joe begindate=02/11/1997 enddate=02/12/1997 exceptionsonly=yes

Output:
 

+--------------------------------------------------------------------------------+
|Scheduled Start      Actual Start          Schedule  Node    Status             |
|                                            Name     Name                       |
|-------------------- --------------------  --------- ----   ---------           |
|02/11/1997 01:00:00  02/11/1997 01:13:55   BACK1      JOE   Completed           |
|02/12/1997 01:00:00                        DAILYBKP   JOE   Missed              |
|                                                                                |
+--------------------------------------------------------------------------------+

where:

Scheduled Start

Specifies the scheduled start date and time for the event. The scheduled start time displayed by this command does not include any randomization that can occur through the use of the SET RANDOMIZE command.

Actual Start

Specifies the actual date and time at which the client began execution of the scheduled command. No information is displayed if the scheduled has not started executing.

Schedule Name

Specifies the name of the schedule that initiated the command.

Status

Specifies whether the startup of the event has been completed. Possible values are:

Completed

Specifies that the scheduled event has been completed.

Missed

Specifies that the scheduled startup window for this event has passed and the schedule has not begun.

Failed

Specifies that the client reports a failure in executing the scheduled operation and successive retries have not succeeded.

Started

Specifies that the event has begun execution.

Restarted

Specifies that the client has retried execution of the scheduled operation.

Severed

Specifies that communications with the client were severed before the event could complete.

Future

Specifies that the beginning of the startup window for the event is in the future.

Pending

Specifies that the QUERY EVENT command was issued during the startup window for the event, but execution of the scheduled operation has not yet begun.

Uncertain

Specifies that the state of the event cannot be determined. The server specifies Uncertain if the QUERY EVENT command does not find an event record. An event record will not be found if the record was deleted or if the server was unavailable during the scheduled startup window (the schedule was never started). Records with Uncertain status do not reside in the database. If you do not want these records to be displayed, either specify EXCEPTIONSONLY=YES or delete the schedule if it is no longer needed.

Task 2

Display complete information for all events scheduled for execution by client JOE in DOMAIN1 any time from January 16, 1997 (01/16/1997) through January 17, 1997 (01/17/1997).

+--------------------------------------------------------------------------------+
|Policy Domain Name: DOMAIN1                                                     |
|     Schedule Name: DAILY_BACKUP                                                |
|         Node Name: JOE                                                         |
|   Scheduled Start: 01/16/1997 01:00:00                                         |
|      Actual Start:                                                             |
|         Completed:                                                             |
|            Status: Missed                                                      |
|            Result: 0                                                           |
|                                                                                |
|Policy Domain Name: DOMAIN1                                                     |
|     Schedule Name: DAILY_BACKUP                                                |
|         Node Name: JOE                                                         |
|   Scheduled Start: 01/16/1997 01:00:00                                         |
|      Actual Start: 01/16/1997 01:13:55                                         |
|         Completed: 01/16/1997 01:18:27                                         |
|            Status: Completed                                                   |
|            Result: 0                                                           |
+--------------------------------------------------------------------------------+

where:

Policy Domain Name

Specifies the name of the policy domain to which the schedule is assigned.

Schedule Name

Specifies the name of the schedule that has initiated this event.

Node Name

Specifies the client scheduled to perform the operation.

Scheduled Start

Specifies the scheduled starting date and time for the event. The scheduled start time displayed does not include any randomization that can occur through the use of the SET RANDOMIZE command.

Actual Start

Specifies the actual date and time at which the client began execution of the scheduled operation. No information is displayed if the schedule has not started executing.

Completed

Specifies the date and time the scheduled event is completed.

Status

Specifies whether the startup of the event has been completed. Possible values are:

Completed

Specifies that the scheduled event has been completed.

Missed

Specifies that the scheduled startup window for this event has passed and the schedule has not begun.

Failed

Specifies that the client reports a failure in executing the scheduled operation and successive retries have not succeeded.

Started

Specifies that the event has begun execution.

Restarted

Specifies that the client has retried execution of the scheduled operation.

Severed

Specifies that communications with the client is severed before the event can complete.

Future

Specifies that the beginning of the startup window for the event is in the future.

Pending

Specifies that the QUERY EVENT command was issued during the startup window for the event, but execution of the scheduled operation has not yet begun.

Uncertain

Specifies that the state of the event cannot be determined. The server specifies Uncertain if the QUERY EVENT command does not find an event record. An event record will not be found if the record was deleted or if the server was unavailable during the scheduled startup window (the schedule was never started). Records with Uncertain status do not reside in the database. If you do not want these records to be displayed, either specify EXCEPTIONSONLY=YES or delete the schedule if it is no longer needed.

Result

Specifies the return code from the client that identifies whether the schedule has executed successfully. If the return code is something other than a zero, examine the option string you specified using the OPTIONS parameter or the object string you specified using the OBJECTS parameter in the DEFINE SCHEDULE command.

Related Commands

Table 135. Commands Related to QUERY EVENT
Command Description
QUERY ACTLOG Searches for and displays messages from the server activity log.
DELETE EVENT Deletes event records prior to a specified date and time.
SET EVENTRETENTION Specifies the number of days to retain event records.
SET RANDOMIZE Specifies the randomization of start times within a window for schedules in client-polling mode.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]