Issue with Script Based Discovery

Has anyone been successful with creating script based discovery using MPAuthor?

I have created a very basic discovery script in PowerShell following the logic provided by Brian Wren in his training videos. It looks for a few folders in a directory and adds the name and path as property values.

The script executes without error on natively in Powershell and returns the desired properties within the XML generated. The agent will also execute the workflow without error after the management pack has been imported.

My issue is that nothing is discovered and the management server generates an error when it receives the discovery data from the agent in the operations manager event log:

Microsoft.EnterpriseManagement.Common.DiscoveryDataInvalidClassPropertyValueException,The class property value specified in the discovery data item is not valid. The value needs to adhere to the class.

Class property name: MPElement[Name=’MPAuthor.Classname’]/FolderPath$

Class property value: C:\foldername\childfolder

If I’m being honest I don’t really understand what this error means and google, so far hasn’t returned anything helpful.

Any help would be appreciated.

Thanks

It looks like SCOM is expecting "FolderPath" to be something other than a string (for example, maybe it's expecting a number), so the value of "C:\foldername\childfolder" is not valid.

In MPAuthor, you specify the property types when you create the discovery, like this string property:

Once you have created the discovery, you can check the property types by browsing to Targets, choosing the appropriate class and then viewing the XML. Here the XML confirms that it is a string:

Try checking the FolderPath property of your class and confirm that its type is set to be a string.

1 Like

Can you show the XML of the class type you’ve defined?

I had a typo in my discovery script, that’s all it was. I used the word principle instead of principal.

Thanks

1 Like

I’m not an MP dev, but this does sound as though there’s a mismatch between how the data is saved on the client and how the management pack tells SCOM to read it.

Have you confirmed that the XML that is saved is exactly as expected by the MP? i.e. if the class saved by the discovery on the client is DATA1, is SCOM expecting DATA2?

[Moderation: moved answer by JohnnyK 22 Jun, 2016 to comment]
Thanks for your input.

The properties I’ve specified are all string values which is the default value within MPAuthor. My interpretation of the error is that the properties which have been returned are not valid for the custom class I’ve specified. The class is created as part of the script discovery wizard. I suspect there is something obvious I’ve missed.