AuditJob - createSnapshotToComponentAuditJob_1
AuditJob - createSnapshotToComponentAuditJob
Description :
This command creates an Audit Job based on components. The job compares a snapshot to all instances of a component on a live server. A similar command, createSnapshotToComponentAuditJob , compares a snapshot to particular component on 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 masterSnapshotKey argument provides a handle to the snapshot result that will be the master. The templateKey argument provides a handle to the template identifying the assets to be audited. 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. |
templateKey | DBKey | Handle to the template used to discover components that are the target of the audit. |
serverName | String | Name of the target server. |
Example
The following example creates a snapshot-to-live, component-based Audit Job. A server group is also added as a target:
Script
SNAP_JOB_KEY=`blcli SnapshotJob getDBKeyByGroupAndName /Snapshots snapbasefiles`
#use the first run
RUNID=1
SERVER_ID=`blcli Server getServerIdByName $TARGETSERVER`
JOB_GROUP_ID=`blcli JobGroup groupNameToId /Audits`
SNAPSHOT_KEY=`blcli Snapshot getSnapshotKeyByJobRunId $RUNID basefiles $MASTERSERVER `
TEMPLATE_KEY=`blcli Template getDBKeyByGroupAndName /filesystem basefiles`
AUDIT_JOB_KEY=`blcli AuditJob createSnapshotToComponentAuditJob basefileaudit $JOB_GROUP_ID $SNAPSHOT_KEY $TEMPLATE_KEY $TARGETSERVER`
AUDIT_JOB_KEY=`blcli Job addTargetGroup $JOB_KEY $TARGETGROUP`