BladeZipKit: Create a Static Server Group from a list of Servers in a Depot File

Version 2

    Blade ZipKit Package Info

    Name: Create a Static Server Group from a list of Servers in a Depot File

    Type: NSH Script Job

    BSA Compatible Version: 8.5.x

    Version: 1.0

    Created by: Richard McLeod

    Tested version on:

    Tested against host running: NA


    So I didn't want to have to write this as I think it should already be BSA functionality but alas, Santa doesn't always get us what we want. I recently received a request for this functionality so here is how I built it for our environment


    What is it:

    • This script will allow you to take a list of existing servers from a text file and create a static server group within BladeLogic.
    • This is a Type 2 NSH script which should be executed without any targets.
    • For Inputs, it requires a Depot Path and a target Static Group Path
    • My suggested method of execution is via execution task with overridden NSH parameters


    Follow the below steps to import the NSH Script Job

    1. Download the attached Zip File

    2. Navigate to the Jobs space within BladeLogic and choose the folder where you would like the NSH Script Job to reside

    3. Right click the folder, choose Import, point the dialog to the downloaded zip file

    4. Step through the import steps to complete the import


    Now that the script and the job are imported, step through the following instructions to setup an execution of the job



    1. Upload a file that contains servernames (1 per line) to a depot location (Right click depot folder, Choose New -> File)

    2. After the file is uploaded, right click the file in the depot and choose copy

    3. Open up a text editor on your computer and paste your buffer

    3.a This is the logical path to your file within BladeLogic

    3.b Sample: [/BladeLogic/Depot/Workspace/richard/server_list-20150512.txt]

    3.c Chop off the bracket characters [ ]

    3.d. Chop off the /BladeLogic/Depot string as its not needed

    3.e You should be left with this (put this on the side we'll need it later): /Workspace/richard/server_list-20150512.txt

    4. Identify where you want to create the Static Server Group in the Server space

    4.a Either create the static server group now or just copy the parent folder and paste it to your text editor

    4.b Sample: [/BladeLogic/Servers/Workspace/richard]

    4.c In my example I am going to allow the script to create the static group, so this will just be the parent folder right now

    4.d Chop off the bracket characters [ ]

    4.e Chop off the /BladeLogic/Servers string as its not needed

    4.f You should be left with this (put this on the side, we'll need it later): /Workspace/richard


    Do Not Proceed to the following steps unless the above is completed


    Job Setup:

    1. Navigate to the script job

    2. Right click the script job and choose "Create Execution Task"

    3. Give the Execution Task a name and location, choose Next

    4. DO NOT SET ANY TARGETS, choose Next

    5. You can skip the overridden properties dialog

    6. On the NSH Script Parameters page, choose "Override the following NSH script parameters"

    7. You will be shown an input box for DEPOT_FILE_PATH, enter the path we gathered in the pre-requisites (/Workspace/richard/server_list-20150512.txt)

    8. Click the + sign to add the other parameter STATIC_SERVER_GROUP

    9. Enter the path we gathered in the pre-requisites AND the name of the static server group you want (/Workspace/richard/server_list-20150512) -- here I decided to call the group server_list-20150512

    Here is an example of the NSH Parameters screennsh_parms.PNG

    10. Click Finish

    11. Navigate to the execution task and simply execute it once to create the static server group.

    12. After the script job runs successfully, you should be able to navigate to the server group path you provided to the execution task and see the servers that were fed in through the file