UretzkyZvi / Database-Query-Result-Monitoring-Management-Pack-for-SCOM

IMPORTANT NOTE: The latest version of the management pack is now available for free download at
https://www.savision.com/free-management-packs/
MIT License
9 stars 6 forks source link

Monitor not changing state #12

Closed Lucvdberg closed 7 years ago

Lucvdberg commented 7 years ago

Hi Zvi, Here my question that I also posted in the community of squaredup.

Hi,

Has anyone experience with the SQL Query MP. I did some testing with a count query that returns values around 58 and set the monitor at ‘greater than 55’. I do the monitoring every 5 minutes and will give an alert by 2 samples. The monitor stays on the OK status. I need to do a recalculate to get this in error and after a refresh health it stays on OK.

Has anyone a solution for that?

Thanks,

Luc

UretzkyZvi commented 7 years ago

I have done some changes. Sorry but you would not to delete the current MPs in your SCOM environment and import new MPs version 2.1.0.8 to keep it more easy to maintain I change library mp to version 2.1.0.8

QueryOleDbMonitorTemplate.mpb

QueryOleDbMonitorLibrary.mp

I hope this will help.

If not, I will keep looking for the root cause of this problem

snazy2000 commented 7 years ago

Have just updated to 2.1.0.8, now trying to set this up again, performance is working as expected but as Monitors / Alerts dont seem to be working :(

I have it set to check every 5 minutes and if greater than 0 then raise an alert (For 1 sample) but no alerts are generated

UretzkyZvi commented 7 years ago

I fixed the issue with the monitor not change state

QueryOleDbMonitorLibrary.mp QueryOleDbMonitorTemplate.mpb

I will wait for your feedback before I will close the issue. thanks

snazy2000 commented 7 years ago

Have installed the pack and now gone to edit and save and now get this :(

Note: The following information was gathered when the operation was attempted. The information may appear cryptic but provides context for the error. The application will continue to run.

: Processing the template failed. See inner exception for details. Verification failed with 1 errors:

Error 1: Found error in 2|UnknowMP|1.0.0.0|UnknowMP|| with message: XSD verification failed for the management pack. [Line: 0, Position: 0] System.Xml.Schema.XmlSchemaValidationException: The 'AlertParameter7' element is invalid - The value 'Provider=SQLOLEDB;Server=SERVER;Initial Catalog=DB;User Id=$RunAs[Name="OleDb.f32b5c9916d5482cbe098bc48fe21b48.SimpleAuthenticationAccount"]/UserName$;Password=$RunAs[Name="OleDb.f32b5c9916d5482cbe098bc48fe21b48.SimpleAuthenticationAccount"]/Password$' is invalid according to its datatype 'ManagementPackString' - The actual length is greater than the MaxLength value. ---> System.Xml.Schema.XmlSchemaException: The actual length is greater than the MaxLength value. --- End of inner exception stack trace --- at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(XmlSchemaValidationException e, XmlSeverityType severity) at System.Xml.Schema.XmlSchemaValidator.CheckElementValue(String stringValue) at System.Xml.Schema.XmlSchemaValidator.ValidateAtomicValue(String stringValue, XmlSchemaSimpleType& memberType) at System.Xml.Schema.XmlSchemaValidator.InternalValidateEndElement(XmlSchemaInfo schemaInfo, Object typedValue) at System.Xml.XsdValidatingReader.ProcessEndElementEvent() at System.Xml.XsdValidatingReader.Read() at Microsoft.EnterpriseManagement.Configuration.XSDVerification.ValidateManagementPack(TextReader mpcontents, ManagementPack mp, Boolean throwError)

XSD verification failed for the management pack. [Line: 0, Position: 0] : Verification failed with 1 errors:

Error 1: Found error in 2|UnknowMP|1.0.0.0|UnknowMP|| with message: XSD verification failed for the management pack. [Line: 0, Position: 0] System.Xml.Schema.XmlSchemaValidationException: The 'AlertParameter7' element is invalid - The value 'Provider=SQLOLEDB;Server=SERVER;Initial Catalog=DB;User Id=$RunAs[Name="OleDb.f32b5c9916d5482cbe098bc48fe21b48.SimpleAuthenticationAccount"]/UserName$;Password=$RunAs[Name="OleDb.f32b5c9916d5482cbe098bc48fe21b48.SimpleAuthenticationAccount"]/Password$' is invalid according to its datatype 'ManagementPackString' - The actual length is greater than the MaxLength value. ---> System.Xml.Schema.XmlSchemaException: The actual length is greater than the MaxLength value. --- End of inner exception stack trace --- at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(XmlSchemaValidationException e, XmlSeverityType severity) at System.Xml.Schema.XmlSchemaValidator.CheckElementValue(String stringValue) at System.Xml.Schema.XmlSchemaValidator.ValidateAtomicValue(String stringValue, XmlSchemaSimpleType& memberType) at System.Xml.Schema.XmlSchemaValidator.InternalValidateEndElement(XmlSchemaInfo schemaInfo, Object typedValue) at System.Xml.XsdValidatingReader.ProcessEndElementEvent() at System.Xml.XsdValidatingReader.Read() at Microsoft.EnterpriseManagement.Configuration.XSDVerification.ValidateManagementPack(TextReader mpcontents, ManagementPack mp, Boolean throwError)

: XSD verification failed for the management pack. [Line: 0, Position: 0]

UretzkyZvi commented 7 years ago

I did not know but it turns out that the AlertParameter value has a max size of 256 characters. which means I will have to remove the connection string and query string from an alert description.

Thanks

UretzkyZvi commented 7 years ago

DONE! current alert example image

QueryOleDbMonitorLibrary

QueryOleDbMonitorTemplate

snazy2000 commented 7 years ago

Seems to be working as expected now ! :)

UretzkyZvi commented 7 years ago

Great !!