5 Replies Latest reply on May 22, 2019 12:42 PM by Daniel Hudsky

    Creating an override in ADDM 11.2 for rel.dependency

    Daniel Hudsky
      Share This:

      Hello there,


      we need to create an override that makes a logical decision for BMC_Dependency relationship that sets hasImpact to No under specific conditions. Currently all relationships are set to hasImpact = Yes only because the model has been set to include impacts. We do like the impacts to be there, but the ADDM model sends in too many positively impacted relationships.


      For example when our users are running impact analysis in SRM or CM they get a result of 50 impacted CI's when there really only are 3. The report is too wide and does not make sense that way. ADDM does not give the option to control the toggle for such condition. I'd like to see about an example for an override rule that allows to introduce that logic.


      Relationship is BMC_Dependency and the classes related are BMC_SoftwareServer and BMC_Database.


      Thank you!

      Daniel Hudsky

        • 1. Re: Creating an override in ADDM 11.2 for rel.dependency
          Duncan Grisby

          To do that, you have to override the existing mapping. Make a copy of it, edit it as you require, then import the original and declare that your mapping overrides it. There is an example in the docs: Syncmapping block - BMC Discovery 11.3 - BMC Documentation 


          What logic do you want to encode there?

          1 of 1 people found this helpful
          • 2. Re: Creating an override in ADDM 11.2 for rel.dependency
            Daniel Hudsky

            We want to create logic to exclude hasImpact for specific SoftwareServer and Database relationships. We can use the Normalization engine on the CMDB side, but ADDM will either overwrite it on synch or create it new. In this case we're just trying to create logic at the data source.


            Basically something like this is what has been used to avoid the impact direction to database:



              Source  := computersystem,

              Destination  := softwareserver,


            Pseudo code:

            If SoftwareServer is related to a DB


              Impacted  := softwareserver,


              !impacted (not impacted)


            • 3. Re: Creating an override in ADDM 11.2 for rel.dependency
              Lisa Keeler

              Daniel opened case#00702815  for this question.

              The Discovery version is 11.2.


              I wrote and briefly tested an Override pattern to perform this logic.


              The logic I used is to ask Discovery if there are any related databases (instead of asking the CMDB if there are related BMC_DataBase CI's).

              I thought that asking CMDB would be more complex, and also I wasn't sure it would work in cases where the SoftwareServer CI may be created before the DataBase CI's... i.e. a timing/ordering problem.


              Attaching the pattern here.  Attachments may be removed, so including the text below.


              Below is the new pattern, SoftwareInstance_SoftwareServer_Override.

              •    New lines are commented with OVERRIDE NEW
              •    Old, removed lines are commented with OVERRIDE OLD
              •    Uncommented lines are the original lines from the SoftwareInstance_SoftwareServer syncmapping pattern.



              =============================== SoftwareInstance_SoftwareServer_Override_impact.tpl ===========================


              //tpl 1.12 module CMDB.SoftwareInstance_SoftwareServer;          //OVERRIDE OLD

              tpl 1.12 module CMDB.SoftwareInstance_SoftwareServer_Override;    //OVERRIDE NEW



                  origin := "TKU";

              //  tree_path := "BMC Discovery Operation", "CMDB Sync", "Host", "SoftwareInstance -> SoftwareServer";  //OVERRIDE OLD

                  tree_path := "Custom", "CMDB Sync", "Host", "SoftwareInstance -> SoftwareServer Override";          //OVERRIDE NEW

              end metadata;



              from CMDB.Host_ComputerSystem        import Host_ComputerSystem        2.0;

              from CMDB.MFPart_ComputerSystem      import MFPart_ComputerSystem      2.0;

              from CMDB.Cluster                    import Cluster                    3.0;

              from CMDB.CloudService_CloudInstance import CloudService_CloudInstance 1.0;


              from CMDB.SoftwareInstance_SoftwareServer import SoftwareInstance_SoftwareServer 4.2;  //OVERRIDE NEW

              from CMDB.Database import Database 2.3;  //OVERRIDE NEW


              //syncmapping SoftwareInstance_SoftwareServer 4.2            //OVERRIDE OLD

              syncmapping SoftwareInstance_SoftwareServer_override 1.0    //OVERRIDE NEW


                  First-order SoftwareInstance mapped to BMC_SoftwareServer.



                      tags CMDB, Core_Mapping;

                      datamodel 0, 1, 2, 3, 4, 5, 6;

                      overrides SoftwareInstance_SoftwareServer;             //OVERRIDE NEW

                  end overview;


                  mapping from Host_ComputerSystem.host

                          from MFPart_ComputerSystem.mfpart

                          from Cluster.cluster

                          from CloudService_CloudInstance.cloud_svc

                      as hosting_node


                      traverse Host:HostedSoftware:RunningSoftware:SoftwareInstance as softwareinstance

                          traverse Element:Maintainer:Pattern:Pattern as si_pattern

                          end traverse;


                          traverse ElementWithDetail:Detail:Detail:Database as database_node  //OVERRIDE NEW

                          end traverse;                                                      //OVERRIDE NEW


                          softwareserver -> BMC_SoftwareServer;

                      end traverse;

                  end mapping;


                      hosting_ci := Cluster.cluster_ci or

                                    Host_ComputerSystem.computersystem or

                                    CloudService_CloudInstance.cloud_svc_ci or



                      log.info("Process SoftwareInstances for %hosting_node.name%");


                      for each softwareinstance do

                          // Publisher and product come from SI itself or from pattern

                          software_server_type := 0;

                          publisher            := softwareinstance.publisher;

                          product_name        := softwareinstance.product;

                          product_category    := "BMC Discovered";


                          for each si_pattern do

                              if si_pattern.cdm_software_server_type then

                                  software_server_type := si_pattern.cdm_software_server_type[0];

                              end if;

                              if not publisher and si_pattern.publishers then

                                  publisher := si_pattern.publishers[0];

                              end if;

                              if not product_name and si_pattern.products then

                                  product_name := si_pattern.products[0];

                              end if;

                              if si_pattern.categories then

                                  product_category := si_pattern.categories[0];

                              end if;

                          end for;


                          hashed_key := text.hash(softwareinstance.key);

                          short_name := softwareinstance.short_name or softwareinstance.name;


                          softwareserver := sync.shared.BMC_SoftwareServer(

                              key                    := softwareinstance.key,

                              TokenId                := "ADDM:%hashed_key%",

                              Name                    := softwareinstance.name,

                              ShortDescription        := short_name,

                              Description            := softwareinstance.name,

                              BuildNumber            := softwareinstance.build,

                              isCloud                := softwareinstance.cloud,

                              ManufacturerName        := publisher,

                              MarketVersion          := softwareinstance.product_version,

                              Model                  := softwareinstance.type,

                              OtherSoftwareServerType := softwareinstance.type,

                              PatchNumber            := softwareinstance.patch,

                              ServicePack            := softwareinstance.service_pack,

                              SoftwareServerType      := software_server_type,

                              VersionNumber          := softwareinstance.version,

                              ComponentAliases        := softwareinstance.cdm_component_aliases,

                              Company                := hosting_ci.Company,

                              Category                := "Software",

                              Type                    := "Application",

                              Item                    := product_category



                          //OVERRIDE NEW.  Are there related BMC_DataBase ci's in CMDB or database nodes in Discovery?

                          contains_database := 0;                            //OVERRIDE NEW

                          for each database_node do                          //OVERRIDE NEW

                              contains_database := 1;                        //OVERRIDE NEW

                              break;                                          //OVERRIDE NEW

                          end for;                                            //OVERRIDE NEW

                          log.info("IMPACT OVERRIDE: Host=%hosting_node.name%  contains_database=%contains_database%.  software_server_ci=%softwareserver.Name%");        //OVERRIDE NEW


                          if contains_database then                          //OVERRIDE NEW


                                  Source          := hosting_ci,

                                  Destination    := softwareserver,

                                  Impacted        := softwareserver,

                                  Name            := "APPLICATIONSYSTEMCOMPUTER"


                          else                                                      //OVERRIDE NEW

                              sync.rel.BMC_Dependency(                              //OVERRIDE NEW

                                  Source          := hosting_ci,                    //OVERRIDE NEW

                                  Destination    := softwareserver,                //OVERRIDE NEW

                                  //Impacted        := softwareserver,              //OVERRIDE NEW

                                  Name            := "APPLICATIONSYSTEMCOMPUTER"    //OVERRIDE NEW


                          end if;                                                  //OVERRIDE NEW


                      end for;

                  end body;

              end syncmapping;



              Examples of relationships with the new pattern uploaded:


              Here is a relationship from a BMC_ComputerSystem to Apache Webserver BMC_SoftwareServer.


              For the above relationship, HasImpact = No:



              Here is a relationship from a BMC_ComputerSystem to a Maria DB BMC_SoftwareServer:



              For the above relationship, HasImpact = Yes

              2 of 2 people found this helpful
              • 4. Re: Creating an override in ADDM 11.2 for rel.dependency
                Lisa Keeler

                I added the new sample in the community:  Sample Override Syncmapping pattern:  Conditional Impact relationships for BMC_SoftwareServer.


                Find all of my sample patterns on the Community: https://goo.gl/8KUS3S

                1 of 1 people found this helpful
                • 5. Re: Creating an override in ADDM 11.2 for rel.dependency
                  Daniel Hudsky

                  Lisa this this beautiful. Exactly what we were looking for! Thank you.