Using Events

If an SMS service or component encounters an error while processing a job, it reports an SMS system event to both the Windows NT event log and the SMS event database. You should frequently check the SMS Administrator Events window for errors or warnings. If possible, fix conditions that are generating warnings as well as those generating error conditions. Periodically delete old or duplicate events (if appropriate) to minimize the number of events in the event log. The following dialog box shows the Events window in the SMS Administrator:

Event Attributes

Event attributes are reported in the Event Detail window for each event. The Event Detail window for event number 225 follows:

Events in the Event Detail window have the following attributes:

SMSID

The SMS ID for the computer where the event occurred.

MachineName

The network name of the computer where the event occurred.

Time

The date and time when the event occurred. Time is displayed according to the date and time settings on the computer where the error occurred.

EventID

The identification number that specifies the type of event.

WarningLevel

A number that specifies the severity of the event:

WarningLevel

Severity

0

Success

1

Informational

2

Warning

3

Error


EventModule

The source of the event. This is the text displayed as the Source for the event in the Windows NT Application Log. For most SMS events, the source is SMS. It is also the registry key used to find the location of the DLL that contains the message strings used to display the event's details within the Windows NT Event Viewer.

EventType

A string that identifies the type of event.

Component

The name of the service or program that logged the event. For the SMS Executive service, Component may display the SMS Executive thread that logged the event.

Note

For Run Command On Workstation jobs, if the job fails to run at a client, the failing component is reported as the Despooler, not as Package Command Manager.

Depending on the type of event and the component that reported the event, the event may also display one of the following attributes:

JobID

If an event affects the processing of a job, this attribute specifies the job ID of the job that was affected.

JobDestination

If an event affects the processing of a job, this attribute is the specific destination site (within the Job Target for the job) that was affected.

PackageID

If an event affects the processing of a job, this attribute is the package ID for the job's package.

RequestID

If an event affects the sending of a job, this attribute specifies the send request that was affected.

Viewing Events

By default, the Events window displays the main attributes for each event. You can also choose how the events and attributes are displayed in the Events window:

You can also change the attributes that are displayed in the Events windows by modifying the default query result format for the SMSEvents architecture, which is used to determine the attributes displayed in the Events window.

You can view events individually by opening the Event Detail dialog box for the event whose details you want to view. The Event Detail dialog box displays the main attributes of the event and provides a full description of the event.

Using Events in Queries and Alerts

Events logged as event MIF files are stored as objects with the Event architecture in the database. As with other objects stored in the database (such as computers and user groups), you can create and run queries against the Event architecture to find the events you want to view. You can also run an Ad Hoc query from the Events window by double-clicking the window panel on the Events window.

As with any other query, you can use a query on events to trigger an alert. For example, you could have a query that searches for events with a value of 3 for WarningLevel. You could then specify that query in an alert. When the alert condition evaluates to true, the alert action is triggered. The alert can send a message, run a command, or log an SMS event.

To use queries to find events that are related to a specific job

    1. In the SMS Administrator, open the Jobs window and find the job ID for the job you want to query.

    2. Open the Queries window and, from the File menu, choose New to create a new query.

    3. In the Query Name and Comment boxes, type a query name and comment, respectively.

    4. In the Architecture box, select the SMSEvent.

    5. Choose Add And.

    6. In the Query Expression Properties dialog box, select the line with attribute JobID.

    7. Enter the value of the job ID for the job. (Make sure that the Expression Operator is set to is.)

    8. Save the query.

    9. Run the query.

The events relating to the job are displayed in the Query Results window.

Using this query, you could also create an alert that triggers an action when any events containing the job ID are found in the SMS Event database.

For more information about using events and alerts, see the SMS version 1.2 Administrator's Guide.