Video Screencast Help
Protect Your POS Environment Against Retail Data Breaches. Learn More.

I have created a custom data

Created: 22 Mar 2011 • Updated: 23 Mar 2011 | 5 comments
This issue has been solved. See solution.

I have created a custom data class and populated through a script. I can go Manage, Computers, right-click a computer name, Resource Manager, click View Inventory, and under the Data Classes/Inventory/Custom node, there is my nifty custom data class. It has two attributes, and they are populated correctly.

Hooray!

But how do I create a report that lists the attributes of that class for all managed computers? I have spent most of today in frustration trying to find ANYTHING that shows how to do this. On the Status tab of the Resource Manager, I can see the Guid for my custom class, its name, database table name (mine is Inv_DandS_Plugin_Version), etc. In SQL Management Studio, I can see that table and it looks great. But how do I surface this info in a custom report?

Comments 5 CommentsJump to latest comment

mclemson's picture

I've created a new thread for you.  Original thread here, regarding creating and populating a custom data class based on information from Lenovo mainboards: https://www-secure.symantec.com/connect/forums/lenovos-asset-tag-bios

If I understand correctly, you've created a custom data class, its own table, and have populated fields.  If the name of the table is Inv_DandS_Plugin_Version, and you go to All Reports and then right-click and choose New > Computer Report, then click the Fields tab, you should be able to click Add to add a field, then type Inv_DandS to narrow the results and choose what you want to see from this table.

What happens if you try this method?

Mike Clemson, Senior Systems Engineer, ASC
Intuitive Technology Group -- Symantec Platinum Partner
intuitivetech.com

Leigh Webber's picture

When I click Add to add a field, I get a list of that looks like this:

[ ODBC Windows ].[API Level]
[ ODBC Windows ].[Driver ODBC Version]
...
[Inventory Results].[Agent]
[Inventory Results].[Class Count]

If I try to type Inv_DandS, there are no matches at all. I have examined every last row in the drop-down, and NONE start with Inv_ or have Inv_ anywhere in them.

I don't understand -- does your list look different? Can you see your custom data class tables in this drop-down? I sure can't.

mclemson's picture

I guess not.  I think you'd have to search for DandS anyway, or Version for Plugin Version, but in either case I don't see my custom data classes in the report builder after all.

You'll have to create the query you want, then convert it to a SQL query and join your custom table to your primary query.  The type of join you use is based on what data you'd like to see, but you can easily join it on _ResourceGuid.

For example, if I had a custom data class containing Field One and Field Two (sounds like Dr. Suess Teaches SQL), and I wanted Computer Name plus contents of field one and field two, I'd create a new Computer report, which already has Name, then convert it to a SQL query, and within parameterised query, I'd add the following just above the WHERE statement:

LEFT OUTER JOIN Inv_Example_Custom_Data_Class ex ON ex._ResourceGuid=vComputer.Guid

If I called the custom data class Example Custom Data Class, then the name would be Inv_Example_Custom_Data_Class.  vComputer.Guid gets replaced with whatever table and Guid column name we're working with.  The LEFT OUTER JOIN shows me all computers, and the example custom data class if they have it.  If it's null, I include them anyway.

Obviously you would add a line or two to your SELECT statement, such as ex.[Field One], and ex.[Field Two]

Does this help?

Mike Clemson, Senior Systems Engineer, ASC
Intuitive Technology Group -- Symantec Platinum Partner
intuitivetech.com

Leigh Webber's picture

Yes -- that's pretty much the approach I took. I put the details in a response to a different thread:

https://www-secure.symantec.com/connect/articles/readycustom-inventory-pulling-values-registry

If you're looking for a detailed example of exactly how to do this, have a look at my response in that thread.

SOLUTION
mclemson's picture

The scoping piece you left out is important if anyone else will be using the SMC and they have anything less than full access.  If you leave this out, they receive results to all resources.  Feel free to remove it temporarily when validating in SQL, but I always put it back in the SMC.

Mike Clemson, Senior Systems Engineer, ASC
Intuitive Technology Group -- Symantec Platinum Partner
intuitivetech.com