Trying to add MAC Address to Network Printer Discovery

Russ Hancock
Tera Expert

Hello,

I am trying to use Discovery (Helsinki) to discover Network Printers (using SNMP), but am not currently able to update the mac_address field on the cmdb.ci table.   I have added the following SNMP field to the "SNMP - Printing" probe and sensor, and the MAC Address is now being retrieved, but is still not being updated in the CMDB!   Can someone help?

Thanks

find_real_file.png

7 REPLIES 7

Ryan,



Here is my business rule that gets executed when the MAC Address changes.   Although I can clearly see that the MAC Address is being discovered by ServiceNow, that field does not appear to be getting updated anywhere that I can find in the CMDB.   The field I am expecting to see updates on is "mac_address" on the cmdb_ci table, which the cmdb_ci_printer table extends.   All other fields appear to be getting updated correctly.



Thanks!


Russ



Note that under the "When to run" tab, I also currently have the following settings:


When:   before


Order:   100


Insert:   unchecked


Update:   checked


Delete:   unchecked


Query:   unchecked


Filter Conditions:   MAC Address changes



find_real_file.png


Hi Russell,



I think you are overcomplicating this BR a bit - this is what mine looks like, and it works when discovering the windows server my mid server is running on (i don't have a printer hand to test with).



Name:: <insert something descriptive here>


Table:: Network Adapter [cmdb_ci_network_adapter]



When to Run tab


When:: After


Order:: 500



Insert (checked)


Update (checked)


Delete (unchecked)


Query (unchecked)



No Filter Conditions



Advanced Tab


Condition:: (current.ip_address.changes() || current.mac_address.changes()) && !current.cmdb_ci.nil()



Script::



if(current.ip_address == current.cmdb_ci.ip_address && current.mac_address != current.cmdb_ci.mac_address){


  current.cmdb_ci.mac_address = current.mac_address;


  current.updateWithReferences();


}




Let me know if this helps...



Thanks,


-Ryan


Thanks Ryan!   The reason my BR wasn't doing anything was that I was that I had it on the cmdb_ci_printer table.   It appears that Discovery only updates the MAC Address on the cmdb_ci_network_adapter table.   I do see that a small handful of MAC Addresses (30 or so out of 5000+ printers in the IP range I ran Discovery for) actually DID get updated in the Network Adapter table, but that was all unfortunately.



In looking at the XML being returned from the "SNMP - Classify" sensor, I do see that the MAC Address is almost always being discovered and returned from the printers (see below). It just isn't being inserted or updated in the Network Adapter table for some reason (with the exception of a very small subset).



find_real_file.png



Does anyone have any ideas as to why Discovery might be having such a poor success rate in updating the cmdb_ci_network_adapter table with the MAC Address?



Thanks!


Russ