AuditJob - createComponentToSnapshotAuditJob


AuditJob - createComponentToSnapshotAuditJob

Description :

This command creates an Audit Job based on components. The job compares a live server to a snapshot.

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

The masterComponentKey argument provides a handle for the component that functions as the master. The targetSnapshotKey argument provides a handle identifying the snapshot result that is the target for 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 that 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.

masterComponentKey

DBKey

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

targetSnapshotKey

DBKey

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

Example

The following example creates an Audit Job based on components by comparing a live server to a snapshot. 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"

TEMPLATE_KEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE`

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

MASTER_SERVER_ID=`blcli Server getServerIdByName $MASTER_SERVER`

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

JOB_GROUP_ID=`blcli JobGroup groupNameToId "/BLCLI_Job_Group"`

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

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

COMP_SNAP_AUDIT_JOB=`blcli -v myProfile AuditJob createComponentToSnapshotAuditJob  /
"audit_job_name" $JOB_GROUP_ID $MASTER_COMPONENT_KEY $SNAPSHOT_JOB_ID`

 

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

BMC Server Automation Command Line Interface 8.7