Constantly getting the alert on multiple servers
Alert: MSSQL 2014: Always On monitoring script failed
Date and Time: 12/18/2017 6:31:40 PM
Log Name: Operations Manager
Source: Health Service Script
Event Number: 4202
Logging Computer: XXXXXXXXXXX
Management Group: XXXXXXX. Script: Main Module: AvailabilityGroupMonitoring.ps1 Version: 18.104.22.168 : Error occurred during Always On monitoring. Computer:XXXXXX Reason: Out of memory Position:572 Offset:22 Detailed error output: Out of memory
There is a known bug in the 7.0 MP’s for SQL that cause WMI to show out of memory errors when monitoring randomly. I have a case open with MS on this and they have confirmed the issue and it has been escalated to the product team. I would watch for an update to the MP coming out in the next few weeks.
“Out of memory” errors indicate that SQL Server WMI Provider can’t cope with the current load using the default configuration. You can try a solution described here: https://social.technet.microsoft.com/Forums/en-US/03c5b2e5-efdb-4e9b-bf98-8f86f93ec2c2/mssql-monitoring-failed-with-event-id-4001-out-of-memory?forum=operationsmanagermgmtpacks. This solution has solved the “out of memory” issue in any known environment which had it before.
In the most recent release, SQL MP team presented a change to reduce the number of WMI request established by the MP, but it didn’t solve the “out of memory” problem in all environments where it had existed. It looks like the problem can’t be solved from the MP side.