MOM Notes

We are  using MOM 2000 for monitoring the application.

Below are a few links that I found useful :
How to delete orphaned server/s records from “OnePoint” Database in particular shows that in OnePoint
 database Event.idGeneratedBy =computer.idComputer  , which is useful for queries per computer.

We periodically have a long delay(sometimes up to 30 min) before events from computers appear in MOM.
I noticed that delay disappeared after a message “A rule has generated 50 alerts in the last 60 seconds… In order to avoid excessive load on the consolidator, this rule will be temporarily disabled”. 

Event Type: Warning
Event Source: OnePoint Operations
Event Category: None
Event ID: 21251
Date:  10/12/2007
Time:  11:47:02 PM
Description:
A rule has generated 50 alerts in the last 60 seconds.  Usually, when a rule generates this many alerts, it is because the rule definition is misconfigured.  Please examine the rule for errors, and also consider creating an event consolidation rule for events that may match the rule.

In order to avoid excessive load on the consolidator, this rule will be temporarily disabled until 10/12/2007 23:57:02.

Rule description:
Rule Id:      {05ED1868-F50D-11D3-AB6D-0090275A4C62}
Group Id:     {064902E1-AA35-4B79-987D-4748E59FF534}
Name:         Operations agent attempted to process responses
Provider Id:  {F6DA1507-12AF-11D3-AB21-00A0C98620CE}
Provider: Application
Criteria:
Event Number == 21252
Source Name == OnePoint Operations
Type:         Event Processing Rule

 MOM 2000 Generates Numerous Entries About Event ID 21252 suggests to find a rule by using search within the MOM Administrator Console to find the rule that is generating the events  or use SQL, e.g.
   Select * from processrule where idprocessrule=’05ED1868-F50D-11D3-AB6D-0090275A4C62′

Search showed that the rules is located under “Microsoft Operations ManagerAgents, Consolidators, or Data Access Servers”.

There are other related links that I used to investigate delay

Suppression of 25261 errors  exposed under: Information Services/Internet Information Services 6.0/Core Services/World
Wide Web Pulishing Service\Event Rules All HTTP 400 errors 

OnePoint Free Data Space Percentage thread suggests to shorten your periods between grooming intervals.You’ll find this in the Global Settings of the MOM Administrator Console.
 

WatiN testing of multi-level Frames page

I wanted to use  WatiN Web Application Testing In .Net, to test  html page with multi-level frames:

E.g TopFrame.aspx :
<Frameset>
     <FRAME SRC=”ContentFrame.aspx”>
</Frameset>

ContentFrame.aspx
<body>
     <IFRAME SRC=”SubFrame.aspx”>
</body>

When I tried to check ie.Frame(“ContentFrame”) it didn’t show me html of ContentFrame.aspx(as expected), but showed html of parent  TopFrame.aspx. I’ve attached debug version of WatiN and stepped through to opening page. And in debugger  ie.Frame(“ContentFrame”)  was populated correctly.

I thought that the problem is with timeout of loading down-level page(SubFrame.aspx in my sample). Unfortunately 
increase of TimeOut didn’t help.
I’ve done a few attempts in debugger and sometimes(when I had breakpoints in IE.CreateNewIEAndGoToUri and DomContainer.WaitWhileMainDocumentNotAvailable) it loaded html of content frame, but mostly showed parent’s frameset.
There are some ideas to try in discussions: best way to find if webbrowser is totally ready and Webbrowser Wait!.

I’ve reported the problem to WatiN bug list 1747471 “Frame is not loaded for page with multi-level frames”.

ASP.NET Exception Handling links

There are a few articles about ASP.NET Exception Handling that I want to bookmark.

User Friendly ASP.NET Exception Handling -very good library, in particular for logging Unhandled Exceptions in ASP.NET Web Services. Minor disadvantage is that it uses propriatory logging, not Enterprise Library Logging Block.

Take Exception To Critical Errors With Custom Application Blocks shows how to use Enterprise Library to build an error-reporting framework and post them to remote web server.

Article Rich Custom Error Handling with ASP.NET   describes how to pass Exception to Custom Error Pages  using one of state objects: Application, Context, Cookies, and QueryString.

 I didn’t understand why article stated, that Response.Redirect()  can’t use Session as storage basket?.  Later I found(see my post Passing Exception details in Session to Custom Error page. ) that it is possible. 

I’ve noticed that Exception has Data property to keep any custom key/value pair. However Data is not included in ToString, and overide is required if you want to trace/log it.(see also Giving Exceptions the Extra Info They Need with Exception.Data)

Links to many other articles can be found in the CodeIdol article “Exception Handling  

Consider to use Exceptions Visualizers

 

My DataBinderHelper class.

Previously I’ve posted a few Helper Classes . This post describes my DataBinderHelper class.

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Web.UI;

    public class DataBinderHelper
    {
        public static bool IsPropertyExist(object container, string propName)
        {
            if (container == null)
            {
                throw new ArgumentNullException(“container”);
            }
            if (string.IsNullOrEmpty(propName))
            {
                throw new ArgumentNullException(“propName”);
            }
            PropertyDescriptor descriptor1 = TypeDescriptor.GetProperties(container).Find(propName, true);
            if (descriptor1 == null)
            {
                return false;
            }
            return true;
        }
/// <summary>
///
/// </summary>
/// <param name=”container”></param>
/// <param name=”propName”></param>
/// <example>DataBinderHelper.EvalWithDefault(DataItem, “VPath”, “”)</example>
/// <param name=”defaultValue”></param>
/// <returns></returns>
        public static object EvalWithDefault(object container, string propName,object defaultValue)
        {
            object oRet=defaultValue;
            if (IsPropertyExist( container,  propName))
            {
                oRet = DataBinder.Eval(container, propName);
            }
            return oRet;
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name=”container”></param>
        /// <param name=”propName”></param>
        /// <param name=”format”></param>
        /// <param name=”defaultValue”></param>
        /// <example>DataBinderHelper.EvalWithDefault(Container.DataItem,”CreationDateTime”,”{0:d}”,””)%</example>
        /// <returns></returns>
        public static object EvalWithDefault(object container, string propName, string format, object defaultValue)
        {
            object oRet = defaultValue;
            if (IsPropertyExist(container, propName))
            {
                oRet = DataBinder.Eval(container, propName, format);
            }
            return oRet;
        }
    }


Tools to debug/Trace ASP.NET applications.

I personally hate to open blogs, that just have list of links without more useful information. But as I wrote in Ways to store bookmarks/favorites post, blog is a convinient way to save favorites. So I will just save links for now, and hopefully will add more comments about them later.

FIDDLER supports HTTPS, ensure that  “Capture HTTPS Connects” and “Decrypting HTTPS traffic”  are ticked in in “Fiddler options”. However running Fiddler in “https mode” can have side effects, e.g. my connection to TFs is not working until I close Fiddler .     

Web Development Helper by Nikhil Kothari -utility for Web developers and plugs into Internet Explorer.ScottGu (and I agree)prefer it over  Fiddler for some ASP.NET and AJAX specific scenarios .

Java application Charles (30 day evaluation) is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP traffic between their machine and the Internet.

YATT (Yet Another Trace Tool) – replacement of trace tools ( tcpTrace, proxyTrace, pcapTrace ), 

I love Internet Explorer Developer Toolbar , in particular “Find by Click” option.

Using System.Net Tracing  – very useful .Net 2.0 features activated in web.config – allows to see details of requests and responces.
Use trace Output tool,e.g.Dbwin32 or DBMonitor.On development machine use Visual Studio Output window.
It is recommended to increase
maxdatasize to avoid text truncation,e.g. 
 <source name=System.Net maxdatasize=4096>

However if you know more about format of requests and responces, it is better to write custom code to represent data in more readable format.
In paricular, when I am sending SOAP requests, it’s better to trace them as XML, rather than view generic hex/ascii dump table (like 6E 64 2E 63 6F 72 70 2E-6D 69 63 72 6F 73 6F 66 : nd.corp.microsof).
It should be considered SOAP extensions, including WSE 3.0.
If you just use Web Services, not WSE 3.0, you can use described in MSDN logging Soap extension, or SoapLogger , or use code from User Friendly ASP.NET Exception Handling.

The hints how to make you class more debugger-friendly (not specific to ASP.NET ) are posted in Easier Debugging with Attributes

Unit Testing ASP.NET Applications

I will put a few links related to ASP.NET unit testing.

WATIN

Initially I saw reference to WATIR from Scott Hanselman’s post Integrating Ruby and Watir with NUnit .

Recently I’ve found WatiN Web Application Testing In .Net, including articles WatiN – Web Application Testing In .Net – The Code Project – ASP.NET and WatiN Test Recorder – The Code Project .(The home page for WatiN Test Recorder is here

There is interesting article by Jeremy D. Miller   with comment from ScottGu recommending WatiN .

Using regular expressions in WatiN (e.g. for asp.net long IDs)

 

Also WatiNFixture is a custom fixture for FitNesse – acceptance testing framework.

VSTS ASP.NET tools

From MSDN Overview of ASP.NET Unit Tests  it seems, that you can only test business classes in App_code. However there is a blog post describing Testing the page object for an ASP.NET site  .

HttpRuntime simulator.

To simulate ASP.NET server functionality(i,e.HttpRuntime I am using class based on Haacked’s  HttpSimulator. May be http://www.codeplex.com/plasma should be considered. 

Comments on closed problems in “MS Connect” are ignored.

I’ve asked MS Supportregarding https://connect.microsoft.com/Connect : does MS staff receive notifications when someone adds Community Discussion comment, Rating or Validation comment for closed issues?Or it is better to raise a new issue to grab MS staff attention? It will be good to put the answer to https://connect.microsoft.com/intro.aspx “Submit and Track Feedback”section.

They replied  that no notification is sent to MS staff for a closed bug. If a new bug is submitted for the same issue, it would likely be identified and closed as a duplicate.

I considered to post the following as a suggestion to MS.

Let’s consider the following scenario.
I noticed some bug/limitation in Visual Studio. I opened  Feedback website and found that somenone reported the similar problem back in 2005 and it was closed with resolution “postponed” or “Won’t fix”(which often means postponed) or “external”. I believe that the issue is important and want to ask MS to review/re-consider the resolution. To do this I am adding   Community Discussion comment and/or Rating or Validation comment  with assumption that MS staff will be notified about my comments.
 
Based on your answer that no notification is sent to MS staff for a closed bug, I wouldn’t achieve what I wanted. An ability to add  Community Discussion comment, Rating or Validation comment  is MISLEADING and causes confusion for users.
It will be good to show warning when user adds comment to the closed issue.

However I found similar ACTIVE issue raised here: Improve feedback comments handling and reactivation   ,so I just voted as important. 

Lesson learned: If I want to ask MS to read/review/re-consider the closed issue, I have to submit a new bug/suggestion report.