Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to create Service Mapping discovery schedule

antalpetter
Tera Contributor

How do I create a discovery schedule for business services which have entry points defined? I do not want to run horizontal host or application discovery but the top-down discovery of service mapping.

Currently the only option I see is to reuse the script from Run Discovery UI action and create my own schedule record:

var bsManager = new SNC.BusinessServiceManager();

bsManager.startDiscovery(current.sys_id);

1 ACCEPTED SOLUTION

Antal,


Your business services need to be set to in operation status for the scheduled job to run. It only runs them on a schedule if they have been marked as operational on the business service form. This should get you past this .


View solution in original post

14 REPLIES 14

patrickdeca
ServiceNow Employee

Antal,



Application discovery is the top down discovery. Check out Create a discovery schedule for an application CI


What is the reason for not going with OOTB process to keep your maps up to date?



If you want to run a custom schedule, you can go to "Scheduled Jobs" and create a custom job to run below code



var map = new GlideRecord('cmdb_ci_service_discovered'); //Query the business services


map.addQuery('');   // Need to update query


map.query();


while (map.next()) {




      var bsManager = new SNC.BusinessServiceManager();


      bsManager.startDiscovery(map.sys_id);


}


Hi Patrick,


Although I have 20 services, the All applications schedule does not do anything when I run it.



What process are you referring to please?


What do you mean it doesn't do anything? When the discovery runs what do you get back in the ecc?


Like I say, it is empty, it completes instantly


find_real_file.png