1 Reply Latest reply on Oct 5, 2012 9:30 AM by Lazar NameToUpdate

    Purpose of NSHScriptJob getNshOutputPropertyName/getNshErrorPropertyName

      I was curious if anyone knows or has used some newer (as of 8.1, it looks like) blcli commands in the NSHScriptJob namespace.  The commands in question are:








      I can't seem to find anything in the documentation that explains what they do.  The blcli help states the obvious and that's about it.  I'm curious as to what the Output/Error property name do.


      If I had to guess, I would say these would point to the name of a string/text property on the script job that would store the script's standard and error output from the latest run, but that is complete guess work. 


      Anybody know anything for sure about this?  This is more out of curiosity than anything else.  I could see some applications for this but didn't want to spend a lot of time playing around with it until I had some sort of expecation of what it should do.



        • 1. Re: Purpose of NSHScriptJob getNshOutputPropertyName/getNshErrorPropertyName
          Lazar NameToUpdate

          The properties are meant to store and retrieve the output and errors of an NSH Script Job for every individual target that the Job runs against.


          Here is the sequence of events of a practical example utilizing of these properties:

          1. Need to enable the feature first, and you will also get a new wizard windows for your Jobs to enter these properties.
          blasadmin set JobInfraManager enableJobOutput true

          2. Create two Server Properties that will be used to store the information:
          NSH_OUT – this is output property
          NSH_ERR – this is error property

          3. Set these properties for your NSH Script Job
          blcli_execute NSHScriptJob getDBKeyByGroupAndName $GroupName $JobName
          blcli_storeenv JobKey
          blcli_execute NSHScriptJob setNshErrorPropertyName $JobKey NSH_ERR
          blcli_storeenv JobKey
          blcli_execute NSHScriptJob setNshOutputPropertyName $JobKey NSH_OUT
          blcli_storeenv JobKey

          4. Run your NSH Script Job (feel free to make some syntax errors)
          This will populate those properties with some values based on the run.

          5. Retrieve the property names from the job and get the values from those properties from one target that the job ran against (getting target names not scripted, that's off-topic here):
          blcli_execute NSHScriptJob getDBKeyByGroupAndName $GroupName $JobName
          blcli_storeenv JobKey
          blcli_execute NSHScriptJob getNshErrorPropertyName $JobKey
          blcli_storeenv ErrorPropertyName
          blcli_execute NSHScriptJob getNshOutputPropertyName $JobKey
          blcli_storeenv OutputPropertyName
          blcli_execute Server getFullyResolvedPropertyValue $Target $OutputPropertyName
          blcli_storeenv ValueOut
          blcli_execute Server getFullyResolvedPropertyValue $Target $ErrorPropertyName
          blcli_storeenv ValueErr


          echo $ValueOut     # contains the output of the script pertaining to that target
          echo $ValueErr     # contains the errors of the script pertaining that target