AuditJob - createLiveToSnapshotAuditJob
AuditJob - createLiveToSnapshotAuditJob
Description :
This command creates an Audit Job based on assets (that is, server objects) that you select. 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 templateKey argument provides a handle identifying the template describing the assets on which the audit is based. The snapshotKey argument provides a handle to the snapshot result that is 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. |
templateKey | DBKey | Handle to a template describing the assets to be audited. |
serverName | String | Name of the server to be used as the master for the audit. |
snapshotKey | DBKey | Handle to the snapshot result to be used as the target of the audit. |
Example
The following example creates an Audit Job based on assets by comparing a live server to a snapshot. The example also shows how to obtain the various keys required in the final command.
Script
TEMPLATE_GROUP="/Template_Group"
TEMPLATE="Template_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 -v myProfile Snapshot getSnapshotKeyByJobRunId $SNAPSHOT_KEY /
"Template_Name" "Target_Name"`
LIVE_SNAP_AUDIT_JOB=`blcli -v myProfile AuditJob createLiveToSnapshotAuditJob /
"audit_job_name" $JOB_GROUP_ID $TEMPLATE_KEY $MASTER_SERVER $SNAPSHOT_JOB_ID`