AWS Cloud Discovery: Reporting on Discovered CIs

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2022 10:35 AM
We recently configured Cloud Discovery for AWS via API. The data comes in without issue, however I'm having a tough time finding a way to report on all AWS CIs that have been created.
1. The discovery schedule field is blank on most of the CIs. Why does this happen? Only 76 of the 2500 CI records have the AWS Discovery Schedule field populated.
2. Cloud discovery is using all of our MID servers to run the discovery schedule. So trying to filter on created/updated by is ineffective because I can't seem to isolate the schedule to one MID. I've tried specifying a MID for the schedule and that does not work. I've even tried removing the "AWS" capability on all MIDs but one and that did not work either.
3. We aren't currently using a field to specify environment/platform (AWS, Azure, etc.) - Has anyone out there done something like this? Could we use Category/Subcategory for this detail?
If any of the brilliant minds in this community could offer some tips or tricks for reporting on AWS Cloud Discovery, I would appreciate it. Ideally, I'd like all of the CIs discovered by that schedule to have the discovery schedule field populated.
Thanks in advance!
Stacey P

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2022 08:06 PM
Please confirm - You are referring here Horizontal Discovery run on resources hosted on AWS Cloud?
As Plain Cloud Discovery will Put AWS Objects in some specific Tables.
If you do not have Key Value pair at data layer or at Schedule level then i see few awakward way to do it.
(1) Stop all Mid Server except 1 and then run the Cloud Discovery schedule. It will only updated CIs of your Interest.
(2) Here is a KB for similar scenario-
How To: Customize Cloud Discovery MID server selection
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0829840
Regards
RP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 05:17 AM
Thank you for your reply!
This is for Cloud Discovery. The schedule also kicks off a VM instance schedule after it is complete. I'm familiar with the CI classes the Cloud Discovery is bringing in.
I paused all of the MID servers except the one I prefer the Cloud Discovery to run through. Unfortunately, the Discovery Schedule field did not update on the CI.
I found something else though while digging and thought this could related:
We have a BEFORE BR active upon insert or update - the BR has the discovery_device_history table set. I'm wondering if there are some permissions for the mid user role that are missing when trying to write to a table before insert. I've read a couple articles that hint at that.
(This rule was added by a vendor over two years ago and just stumbled upon it yesterday when trying to troubleshoot this issue)
______________________________________________________________________________
Here is the script, running on the discovery_device_history table:
Before Insert/Update:
(function executeRule(current, previous /*null when async*/) {
var ci = new GlideRecord('cmdb_ci');
ci.get(current.cmdb_ci);
var disco = current.status.dscheduler;
if (ci.u_discovery_schedule != disco && !disco.nil()) {
ci.u_discovery_schedule = disco;
ci.update();
}
})(current, previous);
______________________________________________________________________________
Do you have any suggestions on what to do here? I did deactivate this rule yesterday -- ran discovery, reactivated this rule to verify that it's not fully working.
I also noticed that the classes that are being updated from AWS Cloud Discovery with the Discovery Schedule are:
-DNS Name
-AWS Data Center
-Cloud Service Account
No other classes (for this AWS Cloud Discovery) are populating this field. Not sure if that is helpful or not.
Thanks for any help you can provide!