InstructorSean Absent Member.
Absent Member.
6682 views

UCMDB 9.0x Enrichment to add relationship to existing non-related CI

Hello everyone,

 

Is it possible with an enrichment to add a relationship into a pattern to an existing CI that does not have an existing relationship to anything in the pattern?

 

For example the attached image is what I am trying to do.

 

I have 12 workstations within a specific IP range, and an existing "FunctionalGroup" called "Students" that I would like to add with a "Usage" relationship over those computers.  We are taught to just "add a new" functional group with the same parameters as the existing one but that seems kludgy.

 

One workaround is to add a dummy relationship to anything in the graph (for example to the subnet) so that I could add it in query mode, and then add the new usage relationship in enrichment mode to the computers themselves.  This works, but there should be a way to just specify a specific CI that I want to add a relationship to in enrichment mode without having to try to recreate it.

 

Attached is the example of what I'm trying to do.  The "Usage(1)" relationship upper left is the dummy one required to make it work.  Is there any other way?

 

Thanks for your help!

0 Likes
14 Replies
Micro Focus Expert
Micro Focus Expert

Re: UCMDB 9.0x Enrichment to add relationship to existing non-related CI

Hi,

Do you mean 1 CI os Students to be linked to all the 12 Computers?

 

I have tried enrichment for this

In the query mode add your TQL with your filters to select your worksations

In the enrichment mode add your FunctionalGroup CIT and create a relation to the Workstation CIT, this will defininitly create  a NEW CIs for each one, to prevent this behavior Edit your FunctionalGroup CIT and add in the mandatory attributes the same values in your Students CI.

 

The system will try to create a new CI and when I fails because of existance, it will link

Regards,
Mahmoud Ibrahim
https://www.itmthoughts.com
New version of Mahmoudthoughts witten by other IT experts
  • Say thanks by clicking the "Kudos! Star" which is on the left.

  • Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.
  • Absent Member.. robbav Absent Member..
    Absent Member..

    Re: UCMDB 9.0x Enrichment to add relationship to existing non-related CI

    Hi

     

    This is great - someone else trying to use uCMDB the same way we are:

    We are trying to do a very similar thing with enrichment - but was told its not possible to create a relationship between CIs using enrichment?

     

    We are trying to relate nodes to a location.  Each node has the name of the location as an attribute, so I thought it would be a simple thing to create that relationship from the node to the location using enrichment.

    Do you know if it is possible in uCMDB8 or CMS9?

     

    __Update__

    Mahmoud, i took a look at your site, and i see you have an example of almost exactly what I am after.. I followed your steps, but on saving the TQL in enrichment manager - I get "class not in class model".

     

    I have included all the required attributes in Location for creating a new location, so I'm a bit stumped.

     

    Cheers for your input.

    Rob.

     

     

     

    0 Likes
    InstructorSean Absent Member.
    Absent Member.

    Re: UCMDB 9.0x Enrichment to add relationship to existing non-related CI

    It is possible - you just need to create a "new" CI and make sure that enough of the attribute values are exactly the same as the existing CI.  You also need to make sure that the CIT that you're relating to (Location in your example) has one of these attributes set to "unique" or "key" so that it won't make duplicated CIs.

     

    For example using Location make sure to change the CIT so that "Name" is a key value.  Once that is set then all you need to do is to create a "new" Location in Enrichment Mode and using Update Query Mode set the Name value to the same as the existing one.

     

    This is the hack way of doing it though. I don't know why we can't identify an enriched CI as being "existing".

    Absent Member.. robbav Absent Member..
    Absent Member..

    Re: UCMDB 9.0x Enrichment to add relationship to existing non-related CI

    THANK YOU!

     

    I tried your suggestion and - it works.  The issue we had with the "class not in class model" is a uCMDB error not related to this method of creating relationships, I tried it on another system (9.04) and it worked perfectly fine. Wheres that kudos button.

     

     

    0 Likes
    Absent Member.. robbav Absent Member..
    Absent Member..

    Re: UCMDB 9.0x Enrichment to add relationship to existing non-related CI

    Hi

    In terms of keeping this clean over time;

     

    Any ideas on how to remove a relationship if the attribute of Location on a Node no longer matches the related Location (ie the Location attribute has been updated on the Node, so now there are two relationships to separate locations) ?

     

    I can't seem to find the "if Location attribute != Location CI Name then delete relationship" option in enrichment 😎

     

    Thanks,

    Rob.

     

    0 Likes
    InstructorSean Absent Member.
    Absent Member.

    Re: UCMDB 9.0x Enrichment to add relationship to existing non-related CI

    Just use a "Join Relationship" between the CITs in the Query Mode:

     

    Example of using a Join relationship with `Not Equal` criteria

     

    This is an example between Node and Location; now that I see the screenshot the relationship direction is probably backwards.  The point is that you can set a relationship that is dependant on relationship criteria between the two CIs.  On the assumption that the `Location` attribute of Node will hold the same value as the Location CI's `Name` attribute then you can set this to only create a result if they do not match.  Once that is set then you can switch to `Enrichment Mode` and delete the relationship.

     

    If this helped you please pass along your `Kudos` 🙂

    Absent Member.. robbav Absent Member..
    Absent Member..

    Re: UCMDB 9.0x Enrichment to add relationship to existing non-related CI

    Thanks for your help - thats exactly what i was after.

    if I could click more kudos i would 😎

     

    Edit: So I have created that Join in query mode, which works, however on setting this to Enrichment mode, and selecting to delete the relationship, on save i get: ERROR: Enrichment Definition link is virtual.

     

    I am not sure I would want to do this enrichment in this fashion now that i have seen the results before saving anyway.  The number of relationships that are created between nodes and locations to delete looks enormous.  Given 10 nodes only and 20 locations only, it looks like this (i think i would have a black screen with thousands of nodes and hundreds of locations, and probably kill the enrichment model for uCMDB:

     

    I have come up with a different approach: remove any relationships where the number of locations for a node is >1 using the cardinality rule, and set the location to "empty" for those nodes, then when the import happens again, the location attribute is updated to the correct location, and a new location relationship created.  Seems more friendly to the uCMDB engine 

     

    Cheers

    Rob.

     

    0 Likes
    InstructorSean Absent Member.
    Absent Member.

    Re: UCMDB 9.0x Enrichment to add relationship to existing non-related CI

    Well hang on - why are there so many location relationships in the first place? From your graph it appears that every Node has a relationship to every Location - why is this?

     

    You may be better to delete all location relationships and then recreate the proper ones.

    0 Likes
    Absent Member.. robbav Absent Member..
    Absent Member..

    Re: UCMDB 9.0x Enrichment to add relationship to existing non-related CI

    Hi

     

    Those location relationships don't actually exist. It looks like uCMDB creates the virtual relationship to see if it should delete it for real. Following the logic, delete any relationship where the Location name doesnt equal the Node attribute for location - thats all relationships that are wrong bar the one that is right. If you create that enrichment, and click on the report button to see what it will be doing before you save it, I'm pretty sure you will see the same enrichment relationships that ucmdb intends to delete (if they exist).

     

    cheers

    Rob.

     

    0 Likes
    Absent Member.. elconas Absent Member..
    Absent Member..

    Re: UCMDB 9.0x Enrichment to add relationship to existing non-related CI

    Actually I try to do the same thing.

     

    1) we have a collection of business services defined in ucmdb, They have a property called "LSNumber" which is unique. This property is NOT a "exclusive" key.

     

    2) we have nodes, which have a attribute assigned to them called "LSNumber". This attribute is read via a flag file on the node, read during custom discovery (shell.safecat(filename) + parsing).

     

    I want to create a enrichment, which maps the business service to the node, based on this attribute. For this I did the following:

     

    a) Create a new Enrichment Rule

    b) Added a Query containing Node and Bussiness Service connected with a virtual join of "Node.LSNumber = BusinessService.LSNumber"

    c) In Enrichment View I just add a relationship of "Contains"

     

    Attached the resulting enrichment rule. The number of results is correct.

     

    This works the first time I create the enrichment. It maps the service to the node (Business Service "Contains" the Node). However for subsequent discovery jobs the relationship is not created, altought the preview does show the creation.

     

    I already sheduled the enrichment rule every 5 minutes, however connection is not created.

     

    What do I miss ?? (UCMDB is 9.05)

     

    How can I debug this ?

     

    Regards,

    Robert

    0 Likes
    Absent Member.. elconas Absent Member..
    Absent Member..

    Re: UCMDB 9.0x Enrichment to add relationship to existing non-related CI

    Missed the correct Screenshot

    0 Likes
    The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.