AuditJob - createSnapshotToComponentAuditJob


AuditJob - createSnapshotToComponentAuditJob

Description :

This command creates an Audit Job based on components. The job compares a snapshot to a particular component on a live server. A similar command, createSnapshotToComponentAuditJob , compares a snapshot to all instances of a component on a live server.

You must provide an ID for the job group that will contain this Audit Job.

The masterSnapshotKey argument provides a handle to the snapshot result that will be the master. The targetComponentKey argument provides a handle to the component that will be the target of the audit. This command returns a handle to the newly created Audit Job. This handle can be used in other commands that need to reference the Audit Job you have created.

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

jobName

String

Name of the Audit Job to be created.

groupId

Integer

ID of the job group to which the Audit Job will be added.

masterSnapshotKey

DBKey

Handle to the snapshot result that should be used as the master for the audit.

targetComponentKey

DBKey

Handle to the component that should be used as the target of the audit.

Example

The following example creates an Audit Job based on components by comparing a snapshot to a particular component on a live server. The example also shows how to obtain the various keys required in the final command.

Script

MASTER_SERVER="Server1"

TEMPLATE_GROUP="/Template_Group"

TEMPLATE="Template_Name"

JOB_NAME="Job Name"

INDEX="Index" //Index means if template has only 1 component

JOB_GROUP_ID=`blcli JobGroup groupNameToId "/BLCLI_Job_Group"`

TEMPLATE_KEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE`

SNAPSHOT_KEY=`blcli  SnapshotJob getDBKeyByGroupAndName "/BLCLI_Job_Group" "BLCLI_Snapshot_Job"`

SNAPSHOT_JOB_ID=`blcli Snapshot getSnapshotKeyByJobRunId $SNAPSHOT_KEY /
"Template_Name" "Target_Name"`

MASTER_SERVER_ID=`blcli Server getServerIdByName $MASTER_SERVER`

TARGET_COMPONENT_KEY=`blcli Component getComponentKeyByTemplateKeyAndServerId /
 $TEMPLATE_KEY $MASTER_SERVER_ID $INDEX`

SNAP_TO_COMP_AUDIT_JOB=`blcli AuditJob createSnapshotToComponentAuditJob /
 $JOB_NAME $JOB_GROUP_ID $SNAPSHOT_JOB_ID $TARGET_COMPONENT_KEY`

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

TrueSight Server Automation Command Line Interface 24.2