Blade ZipKit – Rename Invalid Components

Version 1

    Blade ZipKit Package Info

    Name: Rename Invalid Components

    Type: NSH Script

    BSA Compatible Version: 8.3.x

    Version: 1.0

    More Info: n/a

    Created by:

    Tested version on: AppServer version 8.3.03

    Tested against host running: n/a


    Brief Description:

    This NSH Script loops through all components that were generated by a discovery job based on a component template and checks whether the Component.Name property has the proper target listed in the name. The need for this script was born out of servers being renamed within BladeLogic after previous discoveries were carried out. Renaming a server in BladeLogic does not update the name of associated component objects unless the object is deleted and discovery is re-run. We required a method to maintain the history of those objects as we've come across cases where new servers were added using names that existed previously (now renamed) but the component names still existed and discovery would fail to create new objects because of the existing component.

    This script accepts two input parameters: (1) Path to the component template (2) Name of the component template.


    The script will grab the necessary information use NSH & BLCLI and loop through each component for the path and name provided, it will parse out servernames from the Component.Name and Component.Target properties, test for a non-match, if the condition is true, we update the Component.Name property with the Component.Target servername. If the condition is false, we validate the component as current.

    Instructions for importing the package:

    1. Download the attached zip file to your PC.
    2. Extract the zip file (will only contain an NSH script)
    3. Add the NSH Script to your depot as a Type 1 NSH Script
    4. Add two parameters as follows
      • Name: pathToTemplate
      • Description: Provide the path to the component template
      • Accepts value – Ensure this is checked
      • Value required at runtime – Ensure this is checked
      • Editable – Ensure this is checked
      • Name: templateName
      • Description: Provide the component template name
      • Accepts value – Ensure this is checked
      • Value required at runtime – Ensure this is checked
      • Editable – Ensure this is checked
    5. Save the depot item 
    6. Create an NSH Script Job out of the depot item (suggestion: set the name of the NSH Script Job to include the name of the component template you’re targeting)
    7. Set the Target to one of your AppServers
    8. In the parameters tab add your path and name as follows (example)
      1. pathToTemplate: /Workspace/path/to/template
      2. templateName: some_component template
    9. Execute at will

    *Note: This is a community-supported package.