setting url monitor to pass on multiple status codes in SCOM

Brian W 121 Reputation points
2020-09-03T17:07:14.667+00:00

I have a URL that I want to set up a test that passes on multiple status codes. The authoring UI only allows one status code, but I want to generate an error if it does not equal 200,429, OR 473. i would hope there is a way to hack the xml of my MP to do this because the web application I'm trying to monitor will return any one of these 3 status codes when healthy so I can't use the default of greater than or equal to 400.

Operations Manager
Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
1,420 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Leon Laude 85,686 Reputation points
    2020-09-23T12:37:57.93+00:00

    Hi @Brian W ,

    This is unfortunately not possible do do in the Operations Console, not sure if modifying the XML will work either.
    I had a quick look at the URLGenie management pack and by quickly looking there it doesn't seem that it accepts multiple status codes either, however you could always request the authors to add this.

    Or you can simply author your own management pack for this.

    ----------

    (If the reply was helpful please don't forget to upvote or accept as answer, thank you)

    Best regards,
    Leon

    0 comments No comments

  2. SChalakov 10,271 Reputation points MVP
    2020-09-23T12:58:18.68+00:00

    Hi Brian,

    I just want to confirm what Leon stated: This is currently not possible with any of the existing MPs, but should be "doable" with some Authoring.
    I still think that you will have to re-write the condition detection logic though, which can be somewhat complex.


    (If the reply was helpful please don't forget to upvote or accept as answer, thank you)
    Regards,
    Stoyan


  3. CyrAz 5,181 Reputation points
    2020-09-23T15:25:57.01+00:00

    I'm not so sure it would be that easy actually.

    Both native web availability monitoring and URLGenie rely on the native Microsoft.SystemCenter.WebApplication.UrlProbe probe.
    It is a pretty complexe probe, you'll find all details here : https://learn.microsoft.com/en-us/system-center/scom/url-probe-schema?view=sc-om-2019
    But basically, the Status Code is evaluated here :

                       <BasePageEvaluationCriteria>  
                         <WarningCriteria />  
                         <ErrorCriteria>  
                           <NumericCriteriaExpressions>  
                             <NumericCriteriaExpression>  
                               <NumericRequestMetric>BasePageData/StatusCode</NumericRequestMetric>  
                               <Operator>GreaterEqual</Operator>  
                               <Value>400</Value>  
                             </NumericCriteriaExpression>  
                           </NumericCriteriaExpressions>  
                         </ErrorCriteria>  
                       </BasePageEvaluationCriteria>  
    

    And as the doc explains :

    The Operator element is of type CriteriaCompareType, which consists of one of the following: Equal, NotEqual, Greater, Less, GreaterEqual, or LessEqual.

    So it's not possible to use a regex here.

    However, it is possible to pass multiple <NumericCriteriaExpression> blocks as shown in the implementation used by UrlGenie :

                      <ErrorCriteria>  
                        <NumericCriteriaExpressions>  
                          <NumericCriteriaExpression>  
                            <NumericRequestMetric>BasePageData/StatusCode</NumericRequestMetric>  
                            <Operator>Greater</Operator>  
                            <Value>$Config/StatusThreshold$</Value>  
                          </NumericCriteriaExpression>  
                          <NumericCriteriaExpression>  
                            <NumericRequestMetric>BasePageData/TotalResponseTime</NumericRequestMetric>  
                            <Operator>GreaterEqual</Operator>  
                            <Value>$Config/ErrorTime$</Value>  
                          </NumericCriteriaExpression>  
                        </NumericCriteriaExpressions>  
                        <ContentMatchCriteria>  
                          <RegExOperator>$Config/ContentMatchRegExOperator$</RegExOperator>  
                          <Value>$Config/ContentMatch$</Value>  
                        </ContentMatchCriteria>  
                      </ErrorCriteria>  
    

    So you could try using the same kind of implementation and pass multiple blocks with the BasePageData/StatusCode metric, but I don't know how the underlying module will react... it's a dll that we would need to decompile to see how it's working internally.

    Good luck :)

    0 comments No comments

  4. CyrAz 5,181 Reputation points
    2020-09-23T15:28:17.703+00:00

    Otherwise you could use a a simple Powershell monitor instead of one based on the native UrlProbe, of course.

    0 comments No comments