ComplianceJob - createRemediationJobFromComplianceResultByServer


ComplianceJob - createRemediationJobFromComplianceResultByServer

Description :

This command creates a Remediation Job based on all the information collected from a Compliance Job result.

The compliance target(s) will be picked from a Compliance Job run based on server, template, component, and rule in that order. If you do not provide any information on server/template/component/rule, then the Remediation Job will be based on all the server/template/component/rule information in the Compliance Job result. If you give only server information("" for template/component/rule), then the Remediation Job will be based on all the component/rules on this server. If you give both server, template and component information("" for rule), then the Remediation Job will be based on all the rules under the given component on this server. If you provide all server, template, rule, and component information, then the Remediation Job will be based on only the rule of the component on this server. This command returns a handle to the newly created job. This handle can be used as input to commands that need a handle to the job.

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

remediationName

String

Name of the package.

jobGroupName

String

Name of the group that should contain the new Remediation Job(s).

depotGroupName

String

Name of the group that should contain the new package(s).

compJobKey

DBKey

Handle to the Compliance Job whose job run result you want to package.

compJobRunId

Integer

ID of the Compliance Job run whose result you want to package. This ID is the numeric portion of the job run key.

targetServer

String

Name of the target server.

templateGroupName

String

Group name of the template used in the Compliance Job run.

templateName

String

Name of the template used in the Compliance Job run.

targetComponent

String

Name of the target component.

ruleGrpName

String

Name of the template rule group used in the Compliance Job run.

ruleName

String

Name of the template rule used in the Compliance Job run.

Example

This example shows how to create a Remediation Job from a Compliance Job run result. It assumes that a Compliance Job (compliance1) has been run:

Script

# Get Compliance Job DBKey by job group name and job name.

COMP_JOB_DBKEY=`blcli ComplianceJob getDBKeyByGroupAndName /jobgroup1 compliance1`

# Job Run Id of the compliance job run we are intending to remediate.

COMP_JOB_RUN_ID="2000132"

# Name of the Remediation Job.

REMEDIATION_JOB_NAME="remediationJob1"

# Name of the job group where the new job is going to be saved.

JOB_GROUP_NAME="/job_group_name"

# Name of the depot group where the new package is going to be saved.

DEPOT_GROUP_NAME="/depotGroup"

# Name of the template group.

TEMPLATE_GROUP_NAME="/templateGroup1"

# Name of the template.

TEMPLATE_NAME="template1"

# Name of the template rule group.

RULE_GROUP_NAME="ruleGroupNo1"

# Name of the template rule.

RULE_NAME="ruleNo1"

# Name of the target server.

TARGET_SERVER="engwin2kagt1"

# Name of the target component.

TARGET_COMPONENT="tstTemplate [Inst1] (engwin2kagt1)"

# Now create the new package.

PACKAGE1_DBKEY=`blcli ComplianceJob createRemediationJobFromComplianceResultByServer $REMEDIATION_JOB_NAME $JOB_GROUP_NAME $DEPOT_GROUP_NAME $COMP_JOB_DBKEY $COMP_JOB_RUN_ID $TARGET_SERVER $TEMPLATE_GROUP_NAME $TEMPLATE_NAME $TARGET_COMPONENT $RULE_GROUP_NAME $RULE_NAME`

 

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

BMC Server Automation Command Line Interface 8.7