Skip to content

Commit 679e77b

Browse files
authored
Create README.md
readme details
1 parent 077ce0b commit 679e77b

File tree

1 file changed

+47
-0
lines changed
  • Specialized Areas/CMDB/CMDB CI Deduplication Task Generator

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# CI Deduplication Task Generator
2+
3+
This script rechecks the cmdb_ci_hardware table for duplicates by serial number and creates a De-Duplication Task if needed (for records that didn't run through the IRE).
4+
5+
### How It Works
6+
7+
1. Finds all serial numbers that are used on more than one hardware CI.
8+
9+
2. For each group of duplicates, it checks if any of the CIs are already part of an open de-duplication task.
10+
11+
3. If no open task exists, it creates a new one linking all CIs in the group.
12+
13+
4. Logs a summary of actions taken (tasks created, groups skipped).
14+
15+
### Dependencies
16+
17+
This script requires the `global.CMDBDuplicateTaskUtils` Script Include to be active in your instance.
18+
19+
### Configuration & Use
20+
21+
This script is meant to be run as a **Scheduled Job** or as a **Background Script**.
22+
23+
Before you run it, you must set the target table.
24+
25+
```
26+
// Change this line in the script!
27+
var ciTable = "cmdb_ci_hardware"
28+
29+
30+
```
31+
32+
Change `"cmdb_ci_hardware"` to the table you want to run the script against.
33+
34+
### Example Log Output
35+
36+
```
37+
Starting check for duplicate CIs by serial number...
38+
==> Successfully created task RITM0010123 for Serial Number "VMW-50-81-7A-C9-23-44".
39+
--> Skipping Serial Number "SGH814X025". It is already part of an open task.
40+
--- Re-check Complete ---
41+
Total Duplicate Groups Found: 2
42+
New Remediation Tasks Created: 1
43+
Groups Skipped (Already in an open task): 1
44+
--------------------------
45+
46+
47+
```

0 commit comments

Comments
 (0)