Sun Management Center Change Manager 1.0 Administration Guide

Chapter 7 Monitoring Jobs (Tasks)

Use the Change Manager to initiate jobs to run on managed hosts, such as installation or audit. Also, use the Change Manager to initiate jobs to run on the Change Manager server, such as import or export. Then, use the job log and job queue to get status about jobs that you created from the Hosts and Files sections.

The following topics are described in this chapter:

Job Queue and Logs

A job is described by a job name and a unique job ID that the Change Manager generates.

You can perform the following actions on jobs:

Job Queue

From the Jobs page, view the job queue to monitor current and recent pending, running, and completed jobs. Jobs are initiated on the Change Manager server to perform several tasks, such as installing a managed host. Initiate the jobs from the Hosts section. Then, check the status of the jobs from the Jobs section. There are several job status values:

Canceled

Job that has been terminated.

Cancelling

Job that is in the process of being terminated.

Complete

Job that successfully completed.

Failed

Job that failed to complete successfully. See the job log for failure details.

Pending

Job that is scheduled to run, but the start time has not arrived.

Running

Job that is currently running.

Job queue entries include the following information:

Job ID

The unique generated ID of the job.

Job Name

User-supplied name for the job.

User

The user who initiated the command.

Start Time

The time the job started.

End Time

The time the job completed.

Status

The status of the job.

Job Log

From the Logs page, view the job log to see detailed information about the progress of jobs. A log entry is created to show each change to the job status. The entry includes the following information:

Date/Time

Time the job starts or completes.

Job ID

The unique generated ID of the job.

Command

The command being run.

Host

The managed host on which the job is initiated.

Status

The status of the job, which indicates whether the job has started or completed.

Message

The status of the job. This field indicates that the job has been submitted or dispatched. If the job fails, this field shows the failure message.

Transaction Log

From the Logs page, view the transaction log. The transaction log shows the actions that have been initiated from the Change Manager server. This log shows all actions, not just the long-running jobs included in the job log. Each log entry includes the following information:

Date/Time

Time the job starts or completes.

User

The user who initiated the command.

Operation

The operation being run.

Object Type

The type of object being used by the operation.

Message

Status of the job. This field indicates that the job succeeded or failed. If the job fails, an error message is included with the status.

Monitoring Jobs by Using the Browser Interface (Task Map)

The following table identifies the procedures you need to monitor jobs by using the web browser.

Task 

Description 

For Instructions 

View the job queue. 

View the job queue to monitor current and recent pending jobs, running jobs, and completed jobs. 

See How to View the Job Queue (Web Browser).

Cancel jobs. 

Cancel running jobs and pending jobs that appear in the job queue. 

See How to Cancel Jobs (Web Browser).

Reschedule running jobs. 

Reschedule a running job to run at a different time. 

See How to Reschedule a Running Job (Web Browser).

Purge completed jobs from the job queue. 

Purge completed jobs from the job queue. Running jobs and pending jobs are not affected. 

See How to Purge Completed Jobs From the Job Queue (Web Browser).

View the job log. 

View the job log to see detailed information about the progress of jobs. 

See How to View the Job Log (Web Browser).

View the transaction log. 

View the transaction log to see the Change Manager transactions. 

See How to View the Transaction Log (Web Browser).

Monitoring Jobs by Using the Browser Interface

The following procedures describe how to monitor jobs by using the job queue. In addition to viewing the job queue, you can purge completed jobs from the queue and cancel jobs from the queue. Other procedures describe how to view the job log and the transaction log.

How to View the Job Queue (Web Browser)

  1. Click the Jobs tab to view the job queue.

  2. Click the job ID to view job details and possible error messages.

How to Cancel Jobs (Web Browser)

Some Change Manager operations are interrupted when you cancel them and some are not.

When a cancel is issued for an interruptable job, the operation currently running on the managed hosts is immediately terminated. The job is canceled for any managed hosts waiting to run the job. The following operations can be interrupted:

When a cancel is issued for an uninterruptable job, the operation currently running on the managed hosts completes. The job is canceled for any managed hosts waiting to run the job. The following operations cannot be interrupted:

  1. Click the Jobs tab to go to the Jobs section.

  2. Click the checkbox next to the job entries of pending jobs or running jobs to cancel.

  3. Click Cancel Job.

    The Cancel Jobs page shows the list of the selected jobs.

  4. Click Yes, Cancel the Job to cancel the selected jobs and return to the job queue.

    An alert appears above the table of job entries, indicating the success or failure of the cancel action.

    Click No, Do Not Cancel Job to return to the job queue.

    The selected jobs are not canceled.

How to Reschedule a Running Job (Web Browser)

  1. Click the Jobs tab to go to the Jobs section.

  2. Select the entry of the running job to reschedule.

  3. Click Cancel Job, then click Yes, Cancel the Job on the Cancel Jobs page.

  4. Click the Hosts tab to go to the Hosts section.

  5. Drill down to the host group where the host groups or managed hosts exist.

  6. Select the host groups or managed hosts on which to schedule the job.

  7. Choose the action from the Host Actions drop-down menu.

    Supply any input information or output information, as well as the date and time to run the job.

  8. Click Submit to schedule the job.

    An alert appears above the table of host groups and managed hosts, indicating the success or failure of the action initiation.

    Click Cancel to return to the host group page.

    The job is not initiated.

How to Purge Completed Jobs From the Job Queue (Web Browser)

  1. Click the Jobs tab to go to the Jobs section.

  2. Click the checkbox next to the job entries of completed jobs to purge from the job queue.

    Completed jobs have status of Canceled, Complete, or Failed.

  3. Click Purge Completed Jobs.

    The Cancel Jobs page shows the list of completed jobs to purge from the job queue.

  4. Click Purge to purge the selected jobs and return to the job queue.

    An alert appears above the table of job entries, indicating the success or failure of the purge action.

    Click Cancel to return to the job queue.

    The selected jobs are not purged from the job queue.

How to View the Job Log (Web Browser)

  1. Click the Logs tab to go to the Logs section.

  2. From the View menu, choose Job Log.

How to View the Transaction Log (Web Browser)

  1. Click the Logs tab to go to the Logs section.

  2. From the View menu, choose Transaction Log.

Monitoring Jobs by Using the Command-Line Interface (Task Map)

The following table identifies the procedures you need to monitor jobs by using the command-line interface. See the changemgr(1MCM) man page.

Task 

Description 

For Instructions 

View the job queue. 

View the job queue to monitor current and recent pending jobs, running jobs, and completed jobs. 

See How to View the Status of Jobs (Command Line).

Cancel jobs. 

Cancel running jobs and pending jobs that appear in the job queue. 

See How to Cancel Jobs (Command Line).

Purge completed jobs from the job queue. 

Purge completed jobs from the job queue. Running jobs and pending jobs are not affected. 

See How to Purge Completed Jobs From the Job Queue (Command Line).

Monitoring Jobs by Using the Command-Line Interface

The following procedures describe how to monitor jobs by using the job queue. In addition to viewing the job queue, you can purge completed jobs from the queue and cancel jobs from the queue.

How to View the Status of Jobs (Command Line)

  1. Determine whether to view the status of particular jobs or all jobs.

    To specify one or more jobs, use the associated job ID. Otherwise, information is provided for all running jobs.

  2. View the status of jobs.


    $ changemgr jobs [ -u username ] [ -p file ] [ -l ] [ -o format ] [ id ... ]
    -u username

    Specify the user name to authenticate. If this option is not specified, the user is the current UNIX user.

    -p file

    file consists of a single line, which contains the password. If file is -, then the user can supply the password as standard input.

    If the -p option is not supplied, then the changemgr command prompts the user for his password.

    -l

    Present more detailed information about the jobs.

    -o format

    format is a blank-separated list or comma-separated list of property names. If you separate the property names with spaces, make sure that you surround the list of property names with quotes. The specified property values are displayed in a name-value format. If format is specified as all, then all properties are displayed. The output is suitable for programmatic parsing.

    id

    Specifies particular job IDs. The job ID number is automatically assigned when the operation is initiated.

Example-Viewing the Status of All Jobs

Pat wants to see the status of all jobs: those started from the browser interface and those started from the command-line interface.


$ changemgr jobs

Example-Viewing the Job Details

Pat wants to see the job details for all jobs.


$ changemgr jobs -l

Example-Viewing the Status of Specified Jobs

Pat wants to see the status of job IC_1234.


$ changemgr jobs IC_1234

Example-Viewing the Properties of a Specific Job

Pat wants to see all the properties of job IC_1234.


$ changemgr jobs -o all IC_1234

How to Cancel Jobs (Command Line)

Some Change Manager operations are interrupted when you cancel them and some are not.

When a cancel is issued for an interruptable job, the operation currently running on the managed hosts is immediately terminated. The job is canceled for any managed hosts waiting to run the job. The following operations can be interrupted:

When a cancel is issued for an uninterruptable job, the operation currently running on the managed hosts completes. The job is canceled for any managed hosts waiting to run the job. The following operations cannot be interrupted:

  1. Determine which jobs to cancel.

    You can cancel pending jobs and running jobs.

    To specify one or more jobs, use the associated job ID.

  2. Cancel selected jobs.


    $ changemgr kill [ -u username ] [ -p file ] id ...

    For descriptions of the options, see How to View the Status of Jobs (Command Line).

Example-Canceling a Job

Pat wants to cancel jobs IC_12345 and IC_12346.


$ changemgr kill IC_12345 IC_12346

How to Purge Completed Jobs From the Job Queue (Command Line)

  1. Determine which completed jobs to purge from the job queue.

    You can purge only completed jobs.

    To specify one or more jobs, use the associated job ID.

  2. Purge completed jobs from the job queue.


    $ changemgr ack [ -u username ] [ -p file ] id ...

    For descriptions of the options, see How to View the Status of Jobs (Command Line).

Example-Purging Completed Jobs From the Job Queue

Pat wants to purge the completed jobs, IC_12347 and IC_12348, from the job queue.


$ changemgr ack IC_12347 IC_12348