How can I see the Application Services and Business Applications that a CI supports?

Matt Jones3
Tera Expert

We've been starting to populate our CMDB, starting at the bottom (servers, routers, switches, phones, etc.), the Configure Items piece of the Manage Technical Services area of the CSDM.

 

At this point, we want to start moving "up", and start grouping these CIs in a more meaningful way.  I stared playing around with creating Business Applications and Application Services (based on dynamic CI groups).  This works OK to be able to see the underlying infrastructure that supports a Business Application.  However, the other way isn't working.  When looking at a particular CI (say, a server), I'm not seeing a way to see the Application Service that the CI is supporting.

 

I'm not 100% sure I'm modeling this correctly.  Trying to understand the CSDM...  Tried to google this, but I'm not finding anything relevant.  I gotta believe I'm just doing something simple wrong, but haven't been able to figure out what yet.

1 ACCEPTED SOLUTION

Bryan Graham1
Tera Expert

Hey Matt,

Had a similar query / requirement. We're actually setting the Business Service on the Incident form based on a selected CI. Found I had to write a script to create the CI Relationship records from the CI to the App Svc to be able to traverse the link.

HTH,

Bryan

var groupID = '1dc09f481b447910e14898e7b04bcbf0'; // The CMDB Group the Dynamic group is based on
var appSvcID = 'f5b6649e1b843190e14898e7b04bcbfc'; // The App Svc to have all the CI's related to
var ciArray = getDynamicGroupCIs(groupID);
for (i = 0; i < ciArray.length; i++) {
    var ciRel = new GlideRecord('cmdb_rel_ci');
    ciRel.initialize();
    ciRel.setValue('parent', appSvcID);
    ciRel.setValue('type', '55c95bf6c0a8010e0118ec7056ebc54d') //Contains::Contained by
    ciRel.setValue('child', ciArray[i]);
    ciRel.insert();
}

function getDynamicGroupCIs(groupSysId) {
    var parser = new JSONParser();
    var response = sn_cmdbgroup.CMDBGroupAPI.getAllCI(groupSysId, false);
    var parsed = parser.parse(response);
    if (parsed.result) {
        gs.print("Success retrieving CI list: " + parsed.idList);
        return parsed.idList;
    } else {
        gs.print("Failed to retrieve list, errors: " + JSON.stringify(parsed.errors));
        return null;
    }
}

 

View solution in original post

12 REPLIES 12

After learning more about how all of this stuff works, I think this is the right track.  How do you deal with relationships that are _removed_ though?

 

I attempted to adapt your script above to an after insert rule on the svc_ci_assoc table (with the idea of doing an after delete the clean up relationships that are removed), but for some reason I haven't yet been able to figure out, the business rule looks like it just isn't being triggered at all.

rikazharrison
Mega Contributor

It sounds like you're on the right track with using Application Services and Business Applications to group CIs in your CMDB, but the key might be in the relationships you're establishing. To see both sides of the picture, ensure you're creating relationships between CIs and the Application Services/Business Applications they support, not just dynamic CI groups. This will allow you to navigate from a specific CI (like the server) to its supporting Application Service and vice versa, providing a clear view of the infrastructure-application mapping.

 

Remember, the relationships are the crucial threads weaving your CIs together in a meaningful way within the CSDM. If you're unsure about specific relationship types, consult your CMDB documentation or seek guidance from your CMDB administrator. By establishing these relationships, you'll gain the desired visibility into how your infrastructure supports your business applications.

Yeah, we ended up automating creating the relationships on the cmdb_rel_ci table, mirroring what was created on the application service table (forgetting the table name right now).

 

...and then came along the new CMDB workspace, which shows both application and infrastructure relationships in the same place, exactly how (IMO) it should work.