How to Successfully Set Up SNMP Discovery for Zebra Printers to Populate the Serial Numbers
New article articles in ServiceNow Community
·
Sep 19, 2024
·
article
Issue / Use Case: I recently faced the challenge of ensuring that the serial numbers of Zebra Printers were accurately fetched and populated in our CMDB, which were missing or not being populated every time the discovery ran. In this article, I’ll share the steps I took to successfully set up SNMP discovery for Zebra Printers with aid of ServiceNow Support Team.
Step 1: Install MIB Files:
First, we need to install the appropriate Management Information Base (MIB) files into the MID Server’s SNMP file table. This step is essential for properly interpreting the Object Identifiers (OIDs) related to our Zebra Printers. Please check source link where I downloaded the MIB file-https://www.zebra.com/ap/en/support-downloads/printers/print-servers/print-server-2.html
Step 2: Fetch the OID:
Next, we’ll use the **SnmpWalk** tool to retrieve the OIDs associated with our printers. Run the following command in your command prompt:
C:\Tools>SnmpWalk.exe -r:10.34.XXX.XXX -c:public
Make sure to replace `10.34.XXX.XXX ` with the IP address of your Zebra Printer. This command allows us to connect to the device and collect the necessary information below.
OID=.1.3.6.1.4.1.10642.2.3.27.0, Type=OctetString, Value=31422GCI4143RHH
Step 3: Create a Custom SNMP Probe: we need to create a custom SNMP probe on discovery_probes table. This probe will define how to collect and process SNMP data from the Zebra Printers.
Step 4: Create a Custom/ new SNMP Field: Under SNMP Fields tab and click on new.
By selecting scalar as command and add the OID and save the record.
Step 5: Create a Custom Sensor Script: After setting up the probe, create a custom sensor script by clicking on sensors tab and click on New. Please copy the script below and change the OIDText enterprise value for different printers (Brothers and others)- var serialNum =snmp.getOIDText('iso.org.dod.internet.private.enterprises.unk_10642.unk_2.unk_3.unk_27');
new DiscoverySensor({
process: function(result){
this.parseOutput(result);
},
parseOutput: function(document){
var snmp = new SNMPResponse(document);
var serialNum = snmp.getOIDText('iso.org.dod.internet.private.enterprises.unk_10642.unk_2.unk_3.unk_27');
current.serial_number = serialNum;
},
type: 'DiscoverySensor'
});
This script will extract the serial number of the Zebra Printer, ensuring this vital information is captured accurately.
Step 5: Create a Classifier Probe: Go to discovery_classifier_probe table, click on New, select the newly created probe, select the Standard Network Printer as classifier, condition script as values.get("sysdescr").indexOf('Zebra') > -1 and save the record.
This step will help us identify Zebra Printers within our network.
Step 6: Test / Link the newly created Classifier Probe: Now it’s time to check if the newly created classifier probe is linked to Standard Network Printer by going to Triggers probes.
Step 7: Run the Quick Discovery: Finally, we are ready to run the discovery process! This will help us identify the Zebra Printers on the network and populate the CMDB with their serial numbers.
Conclusion:
By following these steps, you can successfully set up SNMP discovery for Zebra Printers and ensure that your CMDB is populated with accurate serial numbers. This not only enhances asset management but also improves visibility into your hardware inventory. Please follow this process for other printer models as well (Brother, Canon, and others). According to the ServiceNow Support Team, this is a customization for the instance, and we should reach out to our SAM (Account Manager) for any questions or queries related to this kind of customization.
If you have any questions or need further assistance, feel free to reach out! Let’s keep our asset management practices sharp and effective.
https://www.servicenow.com/community/itom-articles/how-to-successfully-set-up-snmp-discovery-for-zebra-printers-to/ta-p/3050532