Web Application Availability Monitor
I am working on setting up a Web Application Availability Monitor for a specific website on a few servers. I am attempting to configure the monitor to alert on anything other than status code 200. When I run the test on the monitor from scom I am getting a 401 error.
When I run the powershell $statuscode = (Invoke-WebRequest -Timeoutsec 3 -UseDefaultCredentials -Uri http://url).StatusCode Write-Host $statuscode it returns a code 200
Any thoughts on what I am missing?
Comments
Review you SCOM service account permisisons on the web app. The 401 returns as unauthorized where I guess the powershell are running under your user credentials.
I logged into the scom server as the run as account and ran the powershell script as the runas account and it returned the status code 200.
I also added an external resource (microsoft.com) and that returns a status code 200 from the Web Application Availability Monitor
That sounds like the monitor is configured for anonymous connections, that you need to configure it to connect via the service account.
When I switch to Web Application Transaction Monitoring type and set up the test to specify creds I get the below error...
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.
Microsoft.EnterpriseManagement.Common.ObjectNotFoundException: An object of class ManagementPackSecureReference with ID 2187f67a-1efd-c90c-bf2a-9f07ada58740 was not found.
at Microsoft.EnterpriseManagement.Common.Internal.ServiceProxy.HandleFault(String methodName, Message message)
at Microsoft.EnterpriseManagement.Runtime.TaskRuntimeServiceProxy.SubmitTasks(IList`1 jobDefinitions, Guid batchId, JobCategory category, Boolean registerCallback)
at Microsoft.EnterpriseManagement.Runtime.TaskRuntimeManagement.SubmitTaskInternal(ICollection`1 targetIds, Guid taskId, TaskConfiguration configuration, TaskStatusChangeCallback callback)
at Microsoft.EnterpriseManagement.Runtime.TaskRuntimeManagement.SubmitTaskInternal[T](IEnumerable`1 targets, Guid taskId, TaskConfiguration configuration, TaskStatusChangeCallback callback)
at Microsoft.EnterpriseManagement.Runtime.TaskRuntimeManagement.BeginExecuteTaskInternal[T](IEnumerable`1 targets, Guid taskId, TaskConfiguration configuration, AsyncCallback callback, Object state)
at Microsoft.EnterpriseManagement.Runtime.TaskRuntimeManagement.BeginExecuteTask[T](IEnumerable`1 targets, ManagementPackTask task, TaskConfiguration configuration, AsyncCallback callback, Object state)
at Microsoft.EnterpriseManagement.Internal.UI.Authoring.WebApp.WebApplicationEditorForm.<>c__DisplayClasse.<StartRunNowTask>b__d(Object param0, ConsoleJobEventArgs param1)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.ConsoleJobExceptionHandler.ExecuteJob(IComponent component, EventHandler`1 job, Object sender, ConsoleJobEventArgs args)
Interesting development on this issue.. I switch the monitor to using a proxy of an internal URL using port 80 and now I get a status code of 200.... even with the server off....