Syncmappings to sync the SupportDetail EOL data to BMC_Product and/or BMC_SoftwareServer

Version 3
    Share This:

    ============================================================================================================================

    How to get Started creating CMDB Syncmapping Extension patterns:  Getting Started creating a CMDB Syncmapping Extension pattern

    Info about custom patterns and syncmappings, how to test, etc:  Helix Support: Discovery custom patterns discussion

    Sample syncmapping 'stubs' / starting points :  Helix Support: Discovery: Sharing my library of syncmapping extension stubs

    Sample patterns and syncmappings posted by Lisa:  https://goo.gl/8KUS3S

    ============================================================================================================================

     

    This is the 3rd in a series of postings about EOL data.

     

    There are 3 types of EOL data:

    1) HardwareDetail for Hardware EOL data   :  https://communities.bmc.com/docs/DOC-127200

    2) OSDetail for the O/S EOL data                 :  https://communities.bmc.com/docs/DOC-127150

    3) SupportDetail for the Software EOL data  :  this posting, Syncmappings to sync the SupportDetail EOL data to BMC_Product and/or BMC_SoftwareServer

     

     

    Attached are 2 syncmappings to move the SupportDetail End-of-Life data from the Discovery SoftwareInstance SoftwareDetail nodes

    to the BMC_Product and/or to BMC_SoftwareServer CI's in the CMDB.

     

    SupportDetail exists on SoftwareInstance nodes in Discovery.

     

    The data can be moved to the BMC_Product class, or the BMC_SoftwareServer class, or both.  Your choice.  It just depends on how you want to use the data in the CMDB.

     

     

    WARNING: Adding additional data to the CMDB may adversely affect the AR Server and CMDB performance.

                       Swim at your own risk.

     

    The syncmappings require 3 custom attributes be added to the BMC_Product and/or BMC_SoftwareServer class as follows:

                 Name                                        Type

               EOLRetirementDate                           DateTime

               EOSDate                                     DateTime

               EOESDate                                    DateTime

     

    STEPS FOR TESTING:

    1) Add the required attributes to the BMC_Product and/or BMC_SoftwareServer classes in the CMDB

    2) Restart the Discovery services

    3) Upload 1 or both patterns, depending on your desired usage

    4) Scan or Sync some Hosts which contain SI's with SupportDetail EOL data.

    5) Check the data in the CMDB to see if the new attributes are populated on the BMC_ComputerSystem

     

    TROUBLESHOOTING:

    Notice the log.debug statements in the syncmappings below such as line 28:

        log.debug("CUSTOM_SI_Product_Detail_EOL: 1. SI=%node.name% SS=%ci.Name%");    

     

    If having trouble with the pattern, put CMDB Sync logging into DEBUG mode (so that those debug statements get written to the logs), and then Sync some Hosts/Devices.

    Next, check the tw_svc_cmdbsync_transformer.log files on the cluster coordinator.

     

    To see those debug statements from the coordinator command-line, the following command is very useful:

                grep "CUSTOM_SI" /usr/tideway/*cmdbsync*.log

     

    Customers can also open a BMC Support case to request help with implementation / testing of the syncmapping.

    Include the transformer logs on the support case, and include the results of the grep.

     

     

    Syncmapping#1: BMC_Product CI's

    ==========================================================================================

    //Community pattern, posted March 2020 by Lisa Keeler

     

    tpl 1.14 module CMDB.Extension.SI_Product_Detail_EOL;

     

    metadata

        origin := "Communities";

        tree_path := "Custom", "CMDB Sync", "Host", "SoftwareInstace -> Product EOL";

    end metadata;

     

    from CMDB.SoftwareInstance_Product import SoftwareInstance_Product 1.5;

     

    syncmapping SI_Product_Detail_EOL 1.0

        """

        Add the SupportDetail EOL data to the BMC_Product CIs.

        """

        overview

            tags CMDB, Extension;

        end overview;

     

        mapping from SoftwareInstance_Product.softwareinstance as node

            traverse ElementWithDetail:SupportDetail:SoftwareDetail:SupportDetail as detail

            end traverse;

        end mapping;

     

        body

            ci := SoftwareInstance_Product.product;

     

            log.debug("CUSTOM_SI_Product_Detail_EOL: 1. SI=%node.name% SS=%ci.Name%");

     

            for each detail do

     

                if detail.type <> 'SI Support Detail' then

                    log.debug("CUSTOM_SI_Product_Detail_EOL: Wrong detail type=%detail.type%");

                    continue;

                end if;

     

                log.debug("CUSTOM_SI_Product_Detail_EOL: 2. Discovery values:  retirementdate=%detail.retirement_date%  EOS=%detail.end_support_date%  EOES=%detail.end_ext_support_date%");

     

                log.debug("CUSTOM_SI_Product_Detail_EOL: 3. Previous CMDB values:  EOLRetirementDate=%ci.EOLRetirementDate%  EOSDate=%ci.EOSDate%  EOESDate=%ci.EOESDate%");

     

                if detail.retirement_date then

                    ci.EOLRetirementDate := detail.retirement_date;

                end if;

                if detail.end_support_date then

                    ci.EOSDate           := detail.end_support_date;

                end if;

                if detail.end_ext_support_date then

                    ci.EOESDate          := detail.end_ext_support_date;

                end if;

     

                log.debug("CUSTOM_SI_Product_Detail_EOL: 3. Final CMDB values:  EOLRetirementDate=%ci.EOLRetirementDate%  EOSDate=%ci.EOSDate%  EOESDate=%ci.EOESDate%");

     

            end for;

        end body;

    end syncmapping;

     

     

     

    Syncmapping#2: BMC_SoftwareServer CI's

    ==========================================================================================

    //Community pattern, posted March 2020 by Lisa Keeler

     

    tpl 1.14 module CMDB.Extension.SI_SS_Detail_EOL;

     

    metadata

        origin := "Communities";

        tree_path := "Custom", "CMDB Sync", "Host", "SoftwareInstance -> SoftwareServer EOL";

    end metadata;

     

    from CMDB.SoftwareInstance_SoftwareServer import SoftwareInstance_SoftwareServer 4.3;

     

    syncmapping SI_SS_Detail_EOL 1.0

        """

        Add the SupportDetail EOL data to the BMC_SoftwareServer CIs.

        """

        overview

            tags CMDB, Extension;

        end overview;

     

        mapping from SoftwareInstance_SoftwareServer.softwareinstance as node

            traverse ElementWithDetail:SupportDetail:SoftwareDetail:SupportDetail as detail

            end traverse;

        end mapping;

     

        body

            ci := SoftwareInstance_SoftwareServer.softwareserver;

     

            log.debug("CUSTOM_SI_SS_Detail_EOL: 1. SI=%node.name% SS=%ci.Name%");

     

            for each detail do

     

                if detail.type <> 'SI Support Detail' then

                    log.debug("CUSTOM_SI_SS_Detail_EOL: Wrong detail type=%detail.type%");

                    continue;

                end if;

     

                log.debug("CUSTOM_SI_SS_Detail_EOL: 2. Discovery values:  retirementdate=%detail.retirement_date%  EOS=%detail.end_support_date%  EOES=%detail.end_ext_support_date%");

     

                log.debug("CUSTOM_SI_SS_Detail_EOL: 3. Previous CMDB values:  EOLRetirementDate=%ci.EOLRetirementDate%  EOSDate=%ci.EOSDate%  EOESDate=%ci.EOESDate%");

     

                if detail.retirement_date then

                    ci.EOLRetirementDate := detail.retirement_date;

                end if;

                if detail.end_support_date then

                    ci.EOSDate           := detail.end_support_date;

                end if;

                if detail.end_ext_support_date then

                    ci.EOESDate          := detail.end_ext_support_date;

                end if;

     

                log.debug("CUSTOM_SI_SS_Detail_EOL: 3. Final CMDB values:  EOLRetirementDate=%ci.EOLRetirementDate%  EOSDate=%ci.EOSDate%  EOESDate=%ci.EOESDate%");

     

            end for;

        end body;

    end syncmapping;