Forum Discussion
Sure. Normally the TS discovers the relationships by querying the device and asking "who is your neighbor" or something along those lines. For VMWare, the TS talks to the vCenter server to get the relationships. This is why ERIs are needed. When you talk to a system that knows about the nodes on the map, that system may have its own way of identifying those objects. The ERIs previously added serve as the multiple ways that third party systems might refer to those objects. Some, like the cam table in a router, refer to neighbors using MAC addresses. Some, like vCenter, may use a FQDN or some other ID. As long as the third party system responds with relationships between objects, and refers to those objects using an ERI that is on the device, the relationship can be mapped in LM.
Think of it this way, if I (as a TopologySource) am telling you that Bob (parent) has 3 sons, Andy (child), Stuart (child), and John (child), then you would need to make sure you know who those four people are, especially if you only know those four people by email address. You would need an external resource identifier (ERI) that maps Bob to Bob's email, Andy to Andy's email, etc. That way, when I tell you about Bob's children, you can know who I'm talking about, definitively.
So, for a TS, you have two options: 1) query some system that knows which parents have which children or 2) manually hard code the relationship in the code. #1 is not likely an option, so you'll probably have to do #2, but let's discuss it anyway:
If you have some system that identifies parental relationships to children, we have to make sure the ERIs we've set on each device in LM match the IDs that the system will use to identify the devices. So, if your third party system identifies things by FQDN, you'll need to write an ERISource that adds FQDN as an ERI. If your third party system identifies things by IP address, you'll need to write an ERISource that adds the IP address(es) as ERI(s).
Then, it's just a matter of writing the TS that asks the system to list out the relationships. Your script would contact the system, make the request, then format the output. The output would be in this format:
{ "edges": [ { "type": "Depends On", "from": "LMID_2", "to": "LMID_1" }, { "type": "Depends On", "from": "LMID_3", "to": "LMID_1" } ] }
You may want to parse through the data and make the relationship bidirectional, adding "Supports" relationships from the parent nodes to the children nodes, but it's not strictly required.
If you're going to hard code the relationships in the code, it's just a simple print statement, outputting the mapping shown above. It might be a much longer print statement in your case.
Related Content
- 6 years ago
- 6 years ago