Ask a questionAsk a question
 

StickyFIM Scriptbox

All Replies

  • Thursday, November 19, 2009 2:57 PMSachin2507 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have been working with MIIS/ILM/FIM since 2004.
    While working on projects, managers/peers/other staff would come to me and ask questions such

    1. What are the attributes imported/exported from this System?
    2. Where is this attibute populated from?
    3. Which system, this attirbute is exported to?
    4. What is the business rule for this attribute?
    5. What is precedence etc

    To answer these questions to non technical staffs, I had developed an ASP.NET application.
    The solution/architecture was like this.

    1. Export the Server Configuration
    2. Run C# program to conver it into into .CSV files
    3. Run SSIS packages to import the data from .CSV file into SQL Database used by the ASP.NET Config Viewer application


    Repeat steps 1 - 3 whenever Server Confugration changes

    ASP.NET Config Viewer application would then present the information in the following format
    --------------------------------------------------------------------------------------------
    UI Looked something like this
    --------------------------------------------------------------------------------------------

    Management Agents/DS: <drop down list>    Metaverse Objects: <drop down list>    Complete Configuration


    Use Case 1: User selects MA/DS from the list

    -------------------------------------------------------------------------------------------------------
    Management Agent/DS Name  () Import Only attributes () Export Onll Attributes () Export and Import () All


    Attr1                                                                            MA/DS Name : Attr Name                               
    Attr2
    .                                         MVAttr1
    .                                         MVAttr2       
    .
    .
    Attr9
    ---------------------------------------------------------------------------------------------------------

    () Import Only attributes -> Will display only those attributes that are imported from the DS into MV
    () Expot  Only attributes -> Will display only those attributes that are exported to DS
    () Export and Import      -> Above two
    () All              -> All the attributes


    All the attribute names, MA/DS names, MV Objects names etc are displayed as hyperlinks and user call click on them to switch from one view to another any time.If the attribute mapping was advanced, Tooltip would provide details of the business rule (this was stored into the database. NOT C# code from the extension). Similar kind of UI for MV Object lever view.

    Complete configuration displays the entire configuration similar to the Excel Spreadsheet view.
    Again user can click on any attribute and move from one view to another.

    MA Name                    MV Object Name                MA Name
    attr1                           attr1                                    attr1
    ...                                ...                                       ...
    attr2                           attr2                                   attr2

    The tool also provided search functinality and present all the information in the form of tree structure.
    Hopefully this should give an idea about the kind of tool which can be developed.
    Unfortunately, I do not have any screen shots (and code) to show what I am talking about.


    - Sachin
  • 8 hours 6 minutes agoSachin2507 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    How to run the MAs in Parallel?
    -----------------------------------

    1. Create a folder structure

    C:\Jobs\Logs
    C:\Jobs\Check
    C:\Jobs\NoCheck
    C:\Jobs - Put all the scripts here

    2. ILM_RunMA.vbs - VBScript to run the Management Agent

    3. ILM_RunMA.bat -
    ---------------------------------------------------------------------------
    @Echo OFF
    echo "..." > c:\jobs\%4\%1.log
    ping -n 2 127.0.0.1 >NUL

    CScript //Nologo ILM_RunMA.vbs %1 %2 %NHSMail_DB_Server% %NHSMail_DB_Name%

    del c:\jobs\%4\%1.log

    IF %3 EQU "1" (
        exit
    )
    -----------------------------------------------------------------------------
    4. ILM_Wait.bat
    -----------------------------------------------------------------------------
    @Echo OFF

    ping -n 5 127.0.0.1 >NUL

    :Check

    SET GO=1

    FOR %%M IN ("%dir c:\jobs\%1\*.*%") DO (

        ping -n 10 127.0.0.1 >NUL

        SET GO=0

    )

    IF %GO% EQU 0 GOTO Check
    --------------------------------------------------------------------------------
    5. ILM_SetEnv.bat - Set all the env variables here
    --------------------------------------------------------------------------------
    @Echo OFF
    IF NOT EXIST Check MKDIR Check
    IF NOT EXIST Logs MKDIR Logs
    del /Q c:\jobs\Check\*.*
    -------------------------------------------------------------------------------------

    6. ILM_Your_Jobs_1.bat - Runs the MAs
    -------------------------------------------------------------------------------------

    -- Ex. Run MAs sequentially

    call ILM_RunMA.bat "MA_Nam1" "Run Profile Name" "0" NoCheck
    call ILM_RunMA.bat "MA_Nam1" "Run Profile Name" "0" NoCheck
    call ILM_RunMA.bat "MA_Nam1" "Run Profile Name" "0" NoCheck

    -- Ex. Run MAs in Parallel. No the last two parameters while calling the batch file

    call ILM_RunMA.bat "MA_Nam1" "Run Profile Name" "1" Check
    call ILM_RunMA.bat "MA_Nam1" "Run Profile Name" "1" Check
    call ILM_RunMA.bat "MA_Nam1" "Run Profile Name" "1" Check

    call ILM_Wait.bat -> Wait until all the MAs have finished running

    call ILM_RunMA.bat "MA_Nam1" "Run Profile Name" "0" NoCheck
    call ILM_RunMA.bat "MA_Nam1" "Run Profile Name" "0" NoCheck
    call ILM_RunMA.bat "MA_Nam1" "Run Profile Name" "0" NoCheck
    -------------------------------------------------------------------------------------------

    7. ILM_Your_Jobs.bat - Create a Windows Task to run this. This also creates a Continue.txt file which will make sure that jobs keep running in loop.
    If you want to stop the schedule, delete Continue.txt file.
    -------------------------------------------------------------------------------------------
    @Echo Off

    call ILM_SetEnv.bat

    echo "..." > c:\jobs\Continue.txt

    :BEGIN

    CD C:\Jobs\

    cls

    SET LogFileName=%DATE%_%TIME%
    SET LogFileName=%LogFileName:/=_%
    SET LogFileName=%LogFileName::=_%
    SET LogFileName=%LogFileName: =_%
    SET LogFileName=%LogFileName:~0,-3%

    CALL ILM_Your_Jobs_1.bat > C:\Jobs\Logs\ILM_Your_Jobs_%LogFileName%.log 2>&1

    ping -n 30 127.0.0.1 >NUL

    IF EXIST Continue.txt (

        GOTO BEGIN
    )
    ---------------------------------------------------------------------------------------------------------------------------------

    We have been using this solution in PRODUCTION for a while now and it is very flexible.

    - Sachin