ARTICLE: CMDB common Issues and Fixes

RiteshSwarnakar
Giga Guru
1) For Asset creation, please verify if Manufacturer, Model ID & Serial Number is populated for that CI.

 

2) For SNMP devices (mostly Printers, Switches etc), it often happens that the SNMP OID is not present, hence the Manufacturer and Model ID will be empty or unknown incase a CI is created.
So create the SNMP OID entry in "discovery_snmp_oid" table (you will mostly find the model and OID in the CI description field if CI is created) and then rerun the discovery it will populate the Manufacturer and Model ID
 
3) Use SNMP walk to get attribute's OID and its value: snmpwalk Examples & Commands (Windows & Linux) Step-by-Step Guide

 

4) If Manufacturer, Model ID & Serial Number are present still Asset is not created then use script:
var list = new GlideRecord("cmdb_ci");
list.addEncodedQuery("assetISEMPTY^install_status!7"); // add query as per requirement
list.query();
while (list.next()){
var a= new AssetandCI;
a.createAsset(list);
list.update();
}



5) Create CI from Asset:
var list = new GlideRecord("alm_hardware");
list.addEncodedQuery("ciISEMPTY^install_status!=7"); // add query as per requirement
list.query();
while (list.next()){
var a= new AssetandCI;
a.createCI(list);
list.update();
}



6) Link CI with existing Asset or vice versa:
var assetSysID='13235be51bfe5910af93ea40604bcb88'; // replace
var cisysID='13235be51bfe5910af93ea40604bcb88'; // replace

var ci = new GlideRecord("cmdb_ci");
if (ci.get(cisysID)){
ci.asset=assetSysID;
ci.update();
}
var asset = new GlideRecord("alm_hardware");
if (asset.get(assetSysID)){
asset.ci=cisysID;
asset.update();
}

 

 

7) Create Deduplication Task for Duplicate CIs:

var sysIDs = '<sys-id1>,<sys-id2>';
var dupTaskUtil = new CMDBDuplicateTaskUtils();
var deDupTaskID = dupTaskUtil.createDuplicateTask(sysIDs);
gs.info(deDupTaskID);

 

 

😎 Table Transform Map Script to populate Manufacturer and Model ID in CMDB:

var make="Cisco";
var model="Room Kit";

var makeModel= MakeAndModelJS.fromNames(make,model,"hardware");
target.model_id=makeModel.getModelNameSysID();
target.manufacturer=makeModel.getManufacturerSysID();

 

9) Issue: In new Discovery Pattern, Debug fails showing "Scanning host running".

Resolution: While creating a new Discovery Pattern which uses API/HTTP Calls

First create a pattern with only one step using "Transform Table" and publish it. Then run Quick Discovery to create a record in CMDB table, after that only the discovery patten debug will work.

0 REPLIES 0