AuditJob - createSnapshotToLiveAuditJob
AuditJob - createSnapshotToLiveAuditJob
Description :
This command creates an Audit Job based on assets (that is, server objects) that you select. The job compares a snapshot to a live server.
You must provide an ID for the job group that will contain this Audit Job. You must also provide the name of the target server.
The templateKey argument provides a handle to the template describing the assets to be audited. The snapshotKey argument provides a handle to the snapshot result that is the master. 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. |
templateKey | DBKey | Handle to a template describing the assets to be audited. |
snapshotKey | DBKey | Handle to the snapshot result that should be used as the master for the audit. |
serverName | String | Name of the target server |
Example
The following example creates an Audit Job based on assets by comparing a snapshot to a live server. The example also shows how to obtain the various keys required in the final command.
Script
TEMPLATE_GROUP="/Template_Group"
TEMPLATE="Template_Name"
JOB_NAME="Job Name"
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"`
SNAP_TO_LIVE_AUDIT_JOB=`blcli AuditJob createSnapshotToLiveAuditJob $JOB_NAME /
$JOB_GROUP_ID $TEMPLATE_KEY $SNAPSHOT_JOB_ID $TARGET_SERVER`