- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 08:17 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2023 12:12 AM
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;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 10:41 AM
Maybe I'm mis-interpreting, but what you're describing sounds very manual, making sure that relationships have been created between individual CIs and application services. My goal was to automate this once it was setup, hence the reliance on the dynamic Ci group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 02:57 AM
Hi Matt,
You should look into the relationships to find out which service they are part of. For example, I am sharing a pic of load balancer CI. If you look it will tell you it is part of mapped application service (Ticket Moster is my service name)
Now, when you are manually creating these make sure you also add the correct relations. You can also look at the various OOB-related list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 10:43 AM
Yeah, a view like the above is definitely what I'm after...but I was looking to automate, not manually build the relationships. That's why I was trying to use an Application Services based on a dynamic CI group. My hope was when new servers are added or removed from the environment, they relationships would be built automatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2023 12:12 AM
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;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 04:51 AM
Huh, I would have thought something like this would just work OOTB... Since it's a dynamic CI group, did you just set this up to run daily or something so that the relationships would stay up to date?