How to get correct CI Class for imported Assets?

braddiamond
Giga Expert

I am importing asset data through a transform map/import set, and am setting my model category (Computer for instance), but yet, the CI that is created is not being set to the Computer class.   It keeps creating a CI with the 'Configuration Item' class.

Any suggestions on what I should be including in my transform to get the CI to create properly?   When we manually create a Computer Asset, the Ci is created correctly, so the Model Category is setup properly.

Thanks!

Brad

1 ACCEPTED SOLUTION

Ben,



I wanted to give you an update - we found the issue.   In one of my field mappings, I was asked to populate the CI name based on some other criteria.   Because we did this, the CI was then created before the AssetAndCISyncronizer could run - by then, there was already a blank shell of a CI in the CMDB.



We removed this mapping - and voila!   The CI creates the way it should.



Thanks all for the responses.


View solution in original post

10 REPLIES 10

Michael Fry1
Kilo Patron

In your transform map, your target table is probably set to cmdb_ci, which is fine. You'll need to use a transform script to push the data to the table of your choice. A script something like:


if (source.operating_system == "AIX" ||


      source.operating_system == "HP/UX" ||


      source.operating_system == "Solaris" ||


      source.operating_system == "AIX")


  target.sys_class_name = "cmdb_ci_unix_server";



if (source.operating_system == "Windows 2000 Server" ||


      source.operating_system == "Windows 2003 Server" ||


      source.operating_system == "Windows NT 4.0")


  target.sys_class_name = "cmdb_ci_win_server";


Alikutty A
Tera Sage

In your transform map, add an on before script that sets the target CI class to personal computer



target.sys_class_name = "cmdb_ci_pc_hardware";



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


braddiamond
Giga Expert

Thanks for the responses - but let me clarify some details I left out of my original post.   My primary intent is to populate Assets that we are managing, so my target table is alm_hardware.



My target CI class is cmdb_ci_computer



I can try adding an on before script - but ideally, I want this to be dynamic and pickup the relationships that exist in the model category table, then I can throw whatever data I want, and they will all get added properly.   With your script, I need to make sure I've included all potential CI classes that I might encounter.



I'm not a fan of having to hardcode the CI Classes that I'm targeting.   Calling out the specific OSes isn't an option, as that would need too much maintenance.   What happens when I encounter a printer?  



If anybody else has suggestions, please fire away!


@Ben Sweetser - Would love your opinion!  


bsweetser