Answered by:
Unable to collect SQL Data - sms_def.mof

Question
-
Hi ,
1. I added the following classe to sms_def.mof :
[ SMS_Report (TRUE),
SMS_Group_Name ("SQL2008 Server Network Protocol Property"),
SMS_Class_ID ("MICROSOFT|MS_SQL2008_ServerNetworkProtocolProperty|1.0"),
Namespace ("\\\\\\\\.\\\\root\\\\Microsoft\\\\SqlServer\\\\ComputerManagement10")]
class ServerNetworkProtocolProperty : SMS_Class_Template
{
[SMS_Report (TRUE), key ]
string InstanceName;
[SMS_Report (TRUE) ]
string IPAddressName;
[SMS_Report (TRUE), key ]
string PropertyName;
[SMS_Report (TRUE) ]
string PropertyStrVal;
[SMS_Report (TRUE) ]
uint32 PropertyType;
[SMS_Report (TRUE) ]
uint32 PropertyValType;
[SMS_Report (TRUE), key ]
string ProtocolName;
};2. After downloading the policy to a client, and running a full inventory , I see the following lines in the client InventoryAgent.log :
Collection: Namespace = \\.\root\Microsoft\SqlServer\ComputerManagement; Query = SELECT __CLASS, __PATH, __RELPATH, InstanceName, IPAddressName, PropertyName, PropertyStrVal, PropertyType, PropertyValType, ProtocolName FROM ServerNetworkProtocolProperty; Timeout = 600 secs. InventoryAgent 3/14/2012 2:41:50 PM 10556 (0x293C)
Unknown error encountered processing an instance of class ServerNetworkProtocolProperty: 80070002 InventoryAgent 3/14/2012 2:41:50 PM 10556 (0x293C)
3. Looking through the "SCCM Client Center" \ Inventory Actions \ Inventory \ SCCM Invemtory I see the class and all of its instances
4. The data dosn't get to the DataBase , Any Idea's ?
Wednesday, March 14, 2012 1:03 PM
Answers
-
I'm out of things to try; I don't have any sql05 in my lab, only sql08; and when I modified your snippets above for sql08, it worked fine... so I don't have a failure, locally, to help figure out why you are getting that 'file not found' returned info.
Maybe we turn this around--is whatever it is you are looking for... is it a 'true/false' type of question? I'm wondering (hoping) that whatever you are looking for could instead be a DCM Configuration Item, instead of inventory.
fyi, here's what I put in configuration.mof/sms_def.mof in my lab for server08, in case you are interested:
[Union, ViewSources{"select InstanceName,ProtocolName,IPAddressName,PropertyName,PropertyStrVal,PropertyType,PropertyValType from ServerNetworkProtocolProperty where ipaddressname='IPall'"},ViewSpaces{"\\\\.\\root\\microsoft\\sqlserver\\computermanagement10"}, dynamic,Provider("MS_VIEW_INSTANCE_PROVIDER")]
class sql08_Network
{
[PropertySources{"InstanceName"}, key] string InstanceName;
[PropertySources{"IPAddressName"},key] string IPAddressName;
[PropertySources{"PropertyName"}, key] string PropertyName;
[PropertySources{"PropertyStrVal"} ] string PropertyStrVal;
[PropertySources{"PropertyType"}, key] uint32 PropertyType;
[PropertySources{"PropertyValType"} ] uint32 PropertyValType;
[PropertySources{"ProtocolName"}, key] string ProtocolName;
};//sms_def.mof
[dynamic, provider("MS_VIEW_INSTANCE_PROVIDER"),
SMS_Report(TRUE),
SMS_Group_Name("SQL08 Network"),
SMS_Class_ID("CUSTOM|SQL08_Network|1.0")]
class sql08_Network : SMS_Class_Template
{
[SMS_Report (TRUE), key] string InstanceName;
[SMS_Report (TRUE), key] string IPAddressName;
[SMS_Report (TRUE), key] string PropertyName;
[SMS_Report (TRUE) ] string PropertyStrVal;
[SMS_Report (TRUE), key] uint32 PropertyType;
[SMS_Report (TRUE) ] uint32 PropertyValType;
[SMS_Report (TRUE), key] string ProtocolName;
};Standardize. Simplify. Automate.
- Proposed as answer by Garth JonesMVP Saturday, March 31, 2012 12:51 PM
- Marked as answer by Garth JonesMVP Thursday, November 8, 2012 2:59 AM
Thursday, March 15, 2012 4:59 PM
All replies
-
Forget that.
Start here, and see how I did it for SQLServiceAdvancedProperty: http://myitforum.com/myitforumwp/2012/02/21/installed-sql-05-sql08-and-sql12-version-information-via-configmgr-hardware-inventory/
Using that as a template; make your own configuration.mof/sms_def.mof edits for ServerNetworkProtocolProperty
Oh... and if you get it working, please share!
Standardize. Simplify. Automate.
- Edited by Sherry Kissinger Wednesday, March 14, 2012 1:46 PM
Wednesday, March 14, 2012 1:44 PM -
Thanks for that !!
Still can't get it to work , I think its somthing to do with the class or with the number of instances (80...)
Here is what I have done :
sms_def.mof
[dynamic, provider("MS_VIEW_INSTANCE_PROVIDER"),
[Union, ViewSources{"select InstanceName,ProtocolName,IPAddressName,PropertyName,PropertyStrVal,PropertyType,PropertyValType from ServerNetworkProtocolProperty"},ViewSpaces{"\\\\.\\root\\microsoft\\sqlserver\\computermanagement"}, dynamic,Provider("MS_VIEW_INSTANCE_PROVIDER")]
SMS_Report(TRUE),
SMS_Group_Name("SQL Network Legacy"),
SMS_Class_ID("CUSTOM|SQL_Network_Legacy|1.0")]
class sql2kand05_Network : SMS_Class_Template
{
[SMS_Report (TRUE), key] string InstanceName;
[SMS_Report (TRUE), key] string IPAddressName;
[SMS_Report (TRUE), key] string PropertyName;
[SMS_Report (TRUE) ] string PropertyStrVal;
[SMS_Report (TRUE), key] uint32 PropertyType;
[SMS_Report (TRUE) ] uint32 PropertyValType;
[SMS_Report (TRUE), key] string ProtocolName;
};
Configuration.mof :
class sql2kand05_Network
{
[PropertySources{"InstanceName"},key ] string InstanceName;
[PropertySources{"ProtocolName"},key ] string ProtocolName;
[PropertySources{"IPAddressName"},key ] string IPAddressName;
[PropertySources{"PropertyName"},key ] string PropertyName;
[PropertySources{"PropertyStrVal"} ] string PropertyStrVal;
[PropertySources{"PropertyType"},key ] uint32 PropertyType;
[PropertySources{"PropertyValType"} ] uint32 PropertyValType;
};
On the client side I can browse to \\root\cimv2 and open sql2kand05_Network class, but the data dosn't get into the DB. No tables are created
BTW, I did add the ServerNetworkProtocolProperty class from your article and it works fine ...
- Edited by Daniel Yehezkel Wednesday, March 14, 2012 3:43 PM
Wednesday, March 14, 2012 3:43 PM -
does inventoryagent.log say 'does not exist out', or does it get past that?
If it doesn't say "does not exist out", have you tried capturing a full inventory file locally on a client; to see if the data is in the xml file to be transmitted?
http://myitforum.com/cs2/blogs/rickym61/archive/2009/01/09/sms-2003-logging.aspx
Standardize. Simplify. Automate.
Wednesday, March 14, 2012 5:47 PM -
Client's inventoryagent.log :
Collection: Namespace = \\.\root\cimv2; Query = SELECT __CLASS, __PATH, __RELPATH, InstanceName, IPAddressName, PropertyName, PropertyStrVal, PropertyType, PropertyValType, ProtocolName FROM sql2kand05_Network; Timeout = 600 secs. InventoryAgent 3/15/2012 10:17:35 AM 8240 (0x2030)
Unknown error encountered processing an instance of class sql2kand05_Network: 80070002 InventoryAgent 3/15/2012 10:17:35 AM 8240 (0x2030)
XML Inventory File : Doesn't contain the sql2kand05_Network class
Tried limiting the number of instances down 4 instances by adding 'where IPAddressName = 'IPAll'' to the class defenition in configuration.mof - But it didn't help the class is not reported by the client.
Any Ideas ?
Thursday, March 15, 2012 9:05 AM -
some new news ...
Part of the clients where successful in reporting this class to the SCCM server , but most of them were not.
Does that fail have this error in inventoryagent.log
"Unknown error encountered processing an instance of class sql2kand05_Network: 80070002"
??
Thursday, March 15, 2012 11:13 AM -
Well, 80070002 I think means "file not found". Seems out of context with querying a wmi class; but that's what a search for what that error means tells me.
On a machine that works vs. a machine that fails.. if you take the query that is in configuration.mof; does it behave differently on a working one vs. a failing one? Maybe one of the attributes doesn't exist on a failing one. If it works the same on both--you're likely running the wbemtest query as you. what if you run the query as SYSTEM?
Standardize. Simplify. Automate.
Thursday, March 15, 2012 11:41 AM -
Hey sherry ,
Tried running the query as system user on both clients - but there where no errors nor differences between the failed machine and the working one.
No empty values too. Also tried removing some collected properties but with no success.
Is there a way for verbose logging on the clients Hardware Inventory agent ?
Any other ideas?
Thanks !
- Edited by Daniel Yehezkel Thursday, March 15, 2012 3:14 PM
Thursday, March 15, 2012 3:13 PM -
I'm out of things to try; I don't have any sql05 in my lab, only sql08; and when I modified your snippets above for sql08, it worked fine... so I don't have a failure, locally, to help figure out why you are getting that 'file not found' returned info.
Maybe we turn this around--is whatever it is you are looking for... is it a 'true/false' type of question? I'm wondering (hoping) that whatever you are looking for could instead be a DCM Configuration Item, instead of inventory.
fyi, here's what I put in configuration.mof/sms_def.mof in my lab for server08, in case you are interested:
[Union, ViewSources{"select InstanceName,ProtocolName,IPAddressName,PropertyName,PropertyStrVal,PropertyType,PropertyValType from ServerNetworkProtocolProperty where ipaddressname='IPall'"},ViewSpaces{"\\\\.\\root\\microsoft\\sqlserver\\computermanagement10"}, dynamic,Provider("MS_VIEW_INSTANCE_PROVIDER")]
class sql08_Network
{
[PropertySources{"InstanceName"}, key] string InstanceName;
[PropertySources{"IPAddressName"},key] string IPAddressName;
[PropertySources{"PropertyName"}, key] string PropertyName;
[PropertySources{"PropertyStrVal"} ] string PropertyStrVal;
[PropertySources{"PropertyType"}, key] uint32 PropertyType;
[PropertySources{"PropertyValType"} ] uint32 PropertyValType;
[PropertySources{"ProtocolName"}, key] string ProtocolName;
};//sms_def.mof
[dynamic, provider("MS_VIEW_INSTANCE_PROVIDER"),
SMS_Report(TRUE),
SMS_Group_Name("SQL08 Network"),
SMS_Class_ID("CUSTOM|SQL08_Network|1.0")]
class sql08_Network : SMS_Class_Template
{
[SMS_Report (TRUE), key] string InstanceName;
[SMS_Report (TRUE), key] string IPAddressName;
[SMS_Report (TRUE), key] string PropertyName;
[SMS_Report (TRUE) ] string PropertyStrVal;
[SMS_Report (TRUE), key] uint32 PropertyType;
[SMS_Report (TRUE) ] uint32 PropertyValType;
[SMS_Report (TRUE), key] string ProtocolName;
};Standardize. Simplify. Automate.
- Proposed as answer by Garth JonesMVP Saturday, March 31, 2012 12:51 PM
- Marked as answer by Garth JonesMVP Thursday, November 8, 2012 2:59 AM
Thursday, March 15, 2012 4:59 PM