Custom Probe/Sensor Windows Video Cards

doug_schulze
ServiceNow Employee
ServiceNow Employee

Have a customer that do alot of design work so they needed to track their video adapters so here you go!

Note you will need to create a custom table (I extended cmdb_ci) then on that table create a reference field back to cmdb_ci called it 'u_installed_on' and of course all your new fields below

WMI Probe... (WMI Fields)

***************

Win32_VideoController.CurrentHorizontalResolution
Win32_VideoController.InstalledDisplayDrivers
Win32_VideoController.Description
Win32_VideoController.DriverVersion
Win32_VideoController.CurrentVerticalResolution

**************

Then the sensor

**************


new DiscoverySensor({
         dataArray: [],

       process: function(result) {
               this.parseResult(result);
       },

       parseResult: function(result) {
               var dataArrayList = g_array_util.ensureArray(result.Win32_VideoController);

               for (var i = 0; i < dataArrayList.length; i++) {
                       var element = dataArrayList<i>;
                       var dataArrayDef = {};

                       dataArrayDef.name                         = element.Description;
                       dataArrayDef.driverversion       = element.DriverVersion;
                       dataArrayDef.verticalresolution = element.CurrentVerticalResolution;
                       dataArrayDef.horizontalresolution       = element.CurrentHorizontalResolution;
                       dataArrayDef.driverdate             = element.DriverDate;
                       dataArrayDef.installeddrivers         = element.InstalledDisplayDrivers;
                   

                       this.dataArray.push(dataArrayDef);
               }

               this.addToRelatedList('u_video_adapter', this.dataArray, 'u_installed_on', 'name');
       },

       type: "DiscoverySensor"
});


***********

Enjoy!

Remember sharing is caring? Doing anything cool in your environment?
5 REPLIES 5

krantimundhe
Kilo Contributor

Thanks Doug.

I have attached the snaspshot of the Application process classifier I created, as you mentioned.

Does it look ok or it still needs any modifications?