
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 11-21-2018 04:34 AM
ServiceNow Discovery is a powerful mechanism that makes great contribution into reducing cost and saving time for CMDB management and therefore bringing vital value to Business.
Here, in this article, we would like to demonstrate just a small example (one among thousand) how Discovery could be applied for a Business Need.
Imagine you need to track whether certain process is running on all employee’s PCs (security or any other that you need to make sure is present or absent). Therefore you need to implement scanning and triggering mechanism for a specific process. Of course, this can be done using the discovery pattern. (The instruction of this solution is given as a link: https://docs.servicenow.com/bundle/london-it-operations-management/page/product/service-mapping/task...). Pattern-based approach is more comprehensive and takes time to learn how patterns work.
Thus, below is simple solution based on Business Rule for table “Running Processes” [cmdb_running_proceses]. After discovery updates the table “Running Processes” [cmdb_running_proceses] - system contains information on all services that are started or stopped at a specific PC based on updated attribute “Absent”.
For demo purposes we used “Adobe Acrobat Service” process and Quick Discovery UI Action. When the process stops and Quick Discovery completed – system changes “Absent” attribute to “true”.
Running Processes [cmdb_running_process] table:
After running Adobe process (service) again and executing Quick Discovery – Business Rule will scan “Absent” attribute and create an Incident.
The script for this BR is presented below:
(function executeRule(current, previous /*null when async*/) {
var grComputer = new GlideRecord("cmdb_ci_computer");
grComputer.get('name', current.getDisplayValue('computer'));
if (grComputer) {
var gr = new GlideRecord("incident");
gr.initialize();
gr.short_description = 'Warning: "Adobe Acrobat" process is disabled';
gr.cmdb_ci = current.computer;
gr.assigned_to = grComputer.getValue('owned_by');
gr.caller_id = grComputer.getValue('owned_by');
gr.insert();
}
})(current, previous);
As the resulting part of this article below is the created incident:
- 4,110 Views