Not Discovering MAC address nor Domain on Windows Servers

dthenderson
Kilo Contributor

I've been disabling WMI parameters in order to remove some of the routing CI's that get created, but I am no longer getting MAC address nor Domain for my Windows Servers?

I've been trying to re-enable some of the things that I've touched, but I don't seem to be having any success getting those to populate on the Windows form.

The fields are OOB os_domain and mac_address.

Anybody run into this problem?

1 ACCEPTED SOLUTION

Yep!! This is the reason ServiceNow stores Mac address in Network adapter table because a single device can have multiple MAC address. And the WMI path we have used only will pick the MAC addresses so we can not predict its physical or virtual.



You can use Powershell probe with that get-wmiobject command which you showed above in the thread. But you need to parse the result from the XML payload I feel that is complex and unnecessary. Instead, if you see the MAC address in the Network adapter table you can write a business rule based upon your condition you can copy the physical mac address into the server table mac_address field.



Regards,


Vivek



Based upon the impact hit like, helpful or correct.


View solution in original post

10 REPLIES 10

Hi Terry,



I have tried to update Mac address directly to Server table. Below are the probe and sensor



Probe: You can write WMI probe to update Mac address. Below is the WMI path of mac address



Win32_NetworkAdapterConfiguration.MACAddress



Sensor: Below is the sensor code to parse the MAC address



new DiscoverySensor({


      dataArray: [],



      process: function(result) {


              this.parseResult(result);


      },



      parseResult: function(result) {


              var dataArrayList = g_array_util.ensureArray(result.Win32_NetworkAdapterConfiguration);



              for (var i = 0; i < dataArrayList.length; i++) {


                      var element = dataArrayList[i];


                      var dataArrayDef = {};



                      dataArrayDef.mac_address                         = element.MACAddress;


                      var mac_add = dataArrayDef.mac_address;


                      var param = /^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$/;


                      if(JSUtil.notNil(mac_add) && mac_add.match(param))


                      current.mac_address = dataArrayDef.mac_address;



              }



      },



      type: "DiscoverySensor"


});



Regards,


Vivek



Based on the impact hit like, helpful or correct.


For the probe, I just created a WMI Runner and added the command in the WMI related list and correlated it to the sensor I created with the code you gave me.   Is there something else I need to do?   When I tested, my new probe was never called during discovery.



Thanks,



-Terry


Yes Terry,



You need to add the probe into Windows Classification table(discovery_classy_windows), then only after classification your custom probe will get triggered.



Create a Discovery CI classification



Regards,


Vivek



Based on the impact hit like, correct or helpful


Thanks Vivek.   My apologies for not posting, but I figured that out after posting the question here yesterday.   I'm still having an issue though.   Even though I'm returning a MAC Address to the server record now, it is not accurate.   I had the server owner verify and it was not the same.   I'm still working on it on my end, and I will post anything I figure out.



Thanks again,



-Terry


So, we found where the "inaccurate" MAC was coming from, it found a "RAS Adapter"   I will need to find a way to only pull the MAC from the physical adapter.   See Screenshot for the query:



find_real_file.png