Connector CMDB Rules – Network Printers
We decided to use Network Discovery for our Network Printers. This was our first time meddling with this and I found some very interesting things I could do with Connector and CMDB rules.
When we ran the initial Network Discovery the assets were discovered no problem. Then we ran the Inventory Collection Policy for Network Devices (in 6.5, View > Tasks > Asset and Inventory > Inventory Collection Policy). The left hand pane of Resource Manager of one of our discovered printers is below.
This returned all of the data classes expected for the printers, plus some others. However, the SNMP Printer was not returning the Serial Number as it states it should and the SNMP Chassis was returning the Serial Number, with a dash and 2 extra characters appended to it.
I found that this was because it was pointing to an HP Printer MIB file. After searching I found the MIB file for Lexmark printers (as that is what we are using). Once I found that I went to "Inventory Data Mapping" (in 6.5, View > Tasks > Asset and Inventory > Inventory data Mapping). This is where all of the Object IDs are defined. I imported the MIB file using the "Import MIB" button and then associated the Serial Number, and other fields.
I then ran the Inventory Collection Policy for Network Devices (in 6.5, View > Tasks > Asset and Inventory > Inventory Collection Policy) again. This time the SNMP Printer data classes returned the correct Serial Number.
After reviewing the fields to ensure that I had all of the data I wanted, I ran the Inventory to Asset Synchronization (in 6.5, View > Configuration > Solution Settings > CMDB Solution > Inventory To Asset Synchronization). After completing that, I checked the asset data (right clicking the network printer and choosing Edit). I found that the Serial Number was that from the SNMP Chassis data class and was returning the Serial Number, with a dash and 2 extra characters appended to it. Come to find out (from Support) that is the default from where it grabs this data.
No problem! With the help of Support (this time around) I went into Reports and created a report that returned all of the printers with where the SNMP Chassis Serial Number did not match that of the SNMP Printer Serial Number. After that was completed I went into the Connector and the CMDB Rules within there (in 6.5, View > Configuration > Solution Settings > Connectors > CMDB Rules) and created a new rule that used that Report.
SQL for Report
SELECT isp._ResourceGuid, i.Name, va.[serial number] [CMDB Serial Number], isp.[serial number] [Network Printer Serial Number], isc.[serial number] [Chassis Serial Number] FROM Inv_snmp_Printer isp JOIN Item i ON isp._ResourceGuid = i.guid JOIN inv_snmp_chassis isc ON isp._ResourceGuid = isc._ResourceGuid AND isp.[serial number] != isc.[serial number] JOIN vAsset va ON isp._ResourceGuid = va._ResourceGuid WHERE va._ResourceTypeGuid = '8E4F62F4-948C-4071-87A0-F39EDFFA9795' --network printer and isp.[serial number] != ''
I could not attach the rule that I created, so the picture link is below. Please remember to create the report first to ensure that it references it correctly. I named my report "_Network Printers with non-matching CDMB and Chassis serial numbers" and placed it under the Reports > CMDB folder.
Once I completed that I knew I could do anything!
So, I spoke with my Asset Management Team and found that they needed the following fields to auto-populate as well: Barcode, Network Printer ID, System Number, Manufacturer and Model. Since I had all of this data I built CMDB rules for each.
For these I used the "Logic Expression" option within the CMDB Rule Configuration. I chose the field under SNMP Printer that I needed to populate and then either entered a "Value" or created an "Expression" for the field that I wanted populated.
For example: We use the hostname of the printer as the Network Printer ID Name. So, assigning the Network Printer ID was just as simple as telling Altiris NS to copy the hostname to the Network Printer ID Name field. I needed to use an "Expression" to return the proper data. Below is the rule that I created:
Once you have selected the target using, Expression and selected Expression to populate the ID Network Printer Name (or any other field that you need), click on the Edit... button to create your expression.
- You will have to select "Add column(s) from NS..." to get to the field you want to copy over.
- The Attribute Picker will popup allowing you to select your data class. (I used SNMP Identification.Hostname.)
- Click Ok and return to the Edit Expression box.
- Your expression should read "IsNull([FIELD YOU SELECT HERE], 'null')".
- Click Test if you would like or click OK to return to your rule.
- Name your Rule and then "Test Rule" before putting into production.
- Login or register to post comments
- 761 reads
- Printer-friendly version

















