BSA: NSH Script Job: How to set or modify parameters via blcli?

Version 3
    Share This:

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    BMC Server Automation


    APPLIES TO:

    BMC Server Automation



    QUESTION:

    How to set parameters of a BMC BladeLogic Server Automation (BSA) NSH Script Job using the BLCLI?
     


    ANSWER:

     

    Legacy ID:KA375605

      

    The way we do it is clear all the values of the Job, and then apply the new values to it.
    So, if your script contains 5 parameters, and you only want to change 1 of them, you need to clear all, and then set all 5 values again, where only one value would be different and the rest will be the same.

    Here is the example of the script with 2 parameters, where you only want to modify the value of second parameter:

    JOB_GROUP="/SandBox"
    JOB_NAME="TestNSHJob"

    VALUE1=ExistingValue1
    VALUE2=NewValue2

    blcli_execute NSHScriptJob clearNSHScriptParameterValuesByGroupAndName "$JOB_GROUP" "$JOB_NAME"
    blcli_execute NSHScriptJob addNSHScriptParameterValueByGroupAndName "$JOB_GROUP" "$JOB_NAME" 0 "$VALUE1"
    blcli_execute NSHScriptJob addNSHScriptParameterValueByGroupAndName "$JOB_GROUP" "$JOB_NAME" 1 "$VALUE2"

    NOTE: parameter1 is specified as 0, parameter2 is specified as 1, and so on.

     


    Article Number:

    000022389


    Article Type:

    FAQ/Procedural



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles