When you run disocvery on printers, the description field on "discovery_printer_supplies" records have hex values instead of a string.


Applicable to all releases


The printer supplies information is queried at the OID "" from the SNMP - Printing probe. 

If we are getting back a hex value from this probe, we are directly parsing this value from the payload and updating the description field on discovery_printer_supplies records. So you might see hex values in place of a string.


Create an update/insert business rule on discovery_printer_supplies table. Make the business rule advanced and paste the following code:


(function executeRule(current, previous /*null when async*/) { 

var input = current.description 
var nospace = input.replace(/\s/g, ''); //remove spaces from the hex value we have 

regexp = /^[0-9a-fA-F]+$/; 
var res = regexp.test(nospace); //validate if the value we have is hex 

if (res == true){ //convert to string only if the value we have is hex 
var string = ''; 
for (var i = 0; i < nospace.length; i += 2) { 
string += String.fromCharCode(parseInt(nospace.substr(i, 2), 16)); 

current.description = string; 

})(current, previous); 


Save the business rule and run discovery on the affected printers.

Article Information

Last Updated:2019-05-21 11:45:45