Want to get CMDB CI field which shows up under the device tab under discovery schedule on the INC form

Utkarsha Saxena
Giga Contributor

Hi Guys,

Please guide me how to get the CMDB CI field which shows up on the Device page when a discovery is ran on the Incident form. Which table does that device field under discovery schedule come and how to get it on the incident form.. Please guide me through the whole process.. Thanks..

find_real_file.png

find_real_file.png

9 REPLIES 9

HugoFirst
Kilo Sage

What you want is a reference type field on the incident table and have it point to the cmdb_ci table.


This will accomplish what you asked for.



But I feel compelled to anticipate that you may need something a little more specific than cmdb_ci.


That table represented virtually everything in the CMDB.   Servers, computers, software, printers, etc.


But it also represents virtual machine instances, running processes, DNS names, IP addresses, and more.



Our CMDB has over 3 million entries, and most of it we will never associate to an incident.   Users are often confused too, when they enter a system name and see several CI's show up.


They aren't sure which may apply, the virtual machine,   the virtual machine instance ( of which there may be many ), the DNS name or the server name,   So often the field is left blank.


We are talking about changing it to point to the cmdb_ci_computer table since that will cover 99% of the cases for us.   While this may not be the right table for you, you may find some other table is more appropriate.   So look at the tables and table structure before you choose.


Ashutosh Munot1
Kilo Patron
Kilo Patron

HI Utkarsha,



You will have to see which sensor/Probe running. In that you will have to write multi sensor script and in that you will get CiData. You can get all CI info there and then you can directly map it to incident table.



If you want script i have it.



Thank you,


Yes please I need the script. Kindly help me with that.



Thanks,


Utkarsha


HI Utkarsha,



Please Open a probe which you use and in that you will find Multi-Probe And Multi Sensor Scrip.



Write in Multi Sensor and you will get all Data:



See below Script:


In Below Script CI DATA Contains all device info.



function(result, ciData, debug, sensor) {


  var output = result.output;


  gs.log('Output '+output,'Snow Sensor');



  if (output === null || gs.nil(output))


  return;



  run(output, ciData, debug);




  function run(output, ciData, debug) {


  var ci_data = ciData.getData();


  gs.log('Data Output '+ci_data.name,'Snow Sensor');


}


}



Mark Helpful or Correct.



Thanks ,