<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Automating the Infrastructure : MOM</title><link>http://blogs.technet.com/ati/archive/tags/MOM/default.aspx</link><description>Tags: MOM</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Manually Resetting a Monitor</title><link>http://blogs.technet.com/ati/archive/2007/08/07/manually-resetting-a-monitor.aspx</link><pubDate>Tue, 07 Aug 2007 19:42:16 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1718127</guid><dc:creator>Brian Wren</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/ati/comments/1718127.aspx</comments><wfw:commentRss>http://blogs.technet.com/ati/commentrss.aspx?PostID=1718127</wfw:commentRss><description>&lt;p&gt;You may have noticed that all monitors in OpsMgr 2007 have an option called Reset Health.&amp;nbsp; The problem you may have encountered with this option is that it doesn't do anything on most monitors.&amp;nbsp; It will typically only work on monitors that were created with&amp;nbsp;a Manual reset.&amp;nbsp; This option actually does work in all cases, but it's up to the monitor (or more specifically the monitor type) to do something with it.&amp;nbsp; Most of the monitor types that you're probably building monitors from don't implement the required option for Reset Health to have any effect, so it looks like it just doesn't work.&lt;/p&gt; &lt;p&gt;To understand the issue here, we need to drop down into the management pack XML.&amp;nbsp; Every monitor is based on a monitor type that may be defined in the same management pack but is more commonly one of the standard monitor types in Microsoft.Windows.Library.&amp;nbsp; One of the sections of the of the monitor type is RegularDetections that defines what action to take when the different events watched by the monitor type are detected.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Below is an example from the monitor type Microsoft.Windows.2SingleEventLog2StateMonitorType.&amp;nbsp; This is the monitor type typically used when you create a monitor using a Windows event for an error state and a second Windows event for a healthy state.&amp;nbsp; Note the bold section that defines the RegularDetections.&amp;nbsp; The order of actions to take is defined from the innermost XML node out.&amp;nbsp; In the case of FirstEventRaised, FirstDataSource is executed to access the event log and then FirstFilterCondition is executed to filter out the event in question.&lt;/p&gt; &lt;p&gt;&amp;lt;UnitMonitorType ID="Microsoft.Windows.2SingleEventLog2StateMonitorType" Accessibility="Public"&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;MonitorTypeStates&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MonitorTypeState ID="FirstEventRaised" NoDetection="false" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MonitorTypeState ID="SecondEventRaised" NoDetection="false" /&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/MonitorTypeStates&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;Configuration&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;IncludeSchemaTypes&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SchemaType&amp;gt;System!System.ExpressionEvaluatorSchema&amp;lt;/SchemaType&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/IncludeSchemaTypes&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="FirstComputerName" type="xsd:string" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="FirstLogName" type="xsd:string" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="FirstExpression" type="ExpressionType" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SecondComputerName" type="xsd:string" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SecondLogName" type="xsd:string" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SecondExpression" type="ExpressionType" /&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/Configuration&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;MonitorImplementation&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MemberModules&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataSource ID="FirstDataSource" TypeID="Microsoft.Windows.BaseEventProvider"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ComputerName&amp;gt;$Config/FirstComputerName$&amp;lt;/ComputerName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;LogName&amp;gt;$Config/FirstLogName$&amp;lt;/LogName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/DataSource&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataSource ID="SecondDataSource" TypeID="Microsoft.Windows.BaseEventProvider"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ComputerName&amp;gt;$Config/SecondComputerName$&amp;lt;/ComputerName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;LogName&amp;gt;$Config/SecondLogName$&amp;lt;/LogName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/DataSource&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ConditionDetection ID="FirstFilterCondition" TypeID="System!System.ExpressionFilter"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Expression&amp;gt;$Config/FirstExpression$&amp;lt;/Expression&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ConditionDetection&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ConditionDetection ID="SecondFilterCondition" TypeID="System!System.ExpressionFilter"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Expression&amp;gt;$Config/SecondExpression$&amp;lt;/Expression&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ConditionDetection&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/MemberModules&amp;gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RegularDetections&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RegularDetection MonitorTypeStateID="FirstEventRaised"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Node ID="FirstFilterCondition"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Node ID="FirstDataSource" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Node&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/RegularDetection&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RegularDetection MonitorTypeStateID="SecondEventRaised"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Node ID="SecondFilterCondition"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Node ID="SecondDataSource" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Node&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/RegularDetection&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/RegularDetections&amp;gt;&lt;/strong&gt;&lt;br&gt;&amp;nbsp; &amp;lt;/MonitorImplementation&amp;gt;&lt;br&gt;&amp;lt;/UnitMonitorType&amp;gt;  &lt;p&gt;In order to enable the Reset Health option for the monitor, you need to add an OnDemandDetections section to the monitor type to define the action to be taken.&amp;nbsp; In the case of the Microsoft.Windows.2SingleEventLog2StateMonitorType, we need to decide which event will define success since this is the one we want to execute with the OnDemandDetection.&amp;nbsp; I'm going to use the first event for an error, and the second event for success.&amp;nbsp; With that in mind, we can modify the monitor type to the following with the added XML in bold:&lt;/p&gt; &lt;p&gt;&amp;lt;UnitMonitorType ID="Microsoft.Windows.2SingleEventLog2StateMonitorTypeWithReset" Accessibility="Public"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MonitorTypeStates&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MonitorTypeState ID="FirstEventRaised" NoDetection="false"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MonitorTypeState ID="SecondEventRaised" NoDetection="false"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/MonitorTypeStates&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Configuration&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;IncludeSchemaTypes&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SchemaType&amp;gt;System!System.ExpressionEvaluatorSchema&amp;lt;/SchemaType&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/IncludeSchemaTypes&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="FirstComputerName" type="xsd:string"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="FirstLogName" type="xsd:string"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="FirstExpression" type="ExpressionType"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SecondComputerName" type="xsd:string"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SecondLogName" type="xsd:string"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SecondExpression" type="ExpressionType"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Configuration&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MonitorImplementation&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MemberModules&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataSource ID="FirstDataSource" TypeID="Windows!Microsoft.Windows.BaseEventProvider"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ComputerName&amp;gt;$Config/FirstComputerName$&amp;lt;/ComputerName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;LogName&amp;gt;$Config/FirstLogName$&amp;lt;/LogName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/DataSource&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataSource ID="SecondDataSource" TypeID="Windows!Microsoft.Windows.BaseEventProvider"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ComputerName&amp;gt;$Config/SecondComputerName$&amp;lt;/ComputerName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;LogName&amp;gt;$Config/SecondLogName$&amp;lt;/LogName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/DataSource&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt; &amp;lt;ProbeAction ID="OnDemandReset" TypeID="System!System.PassThroughProbe"/&amp;gt;&lt;/strong&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ConditionDetection ID="FirstFilterCondition" TypeID="System!System.ExpressionFilter"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Expression&amp;gt;$Config/FirstExpression$&amp;lt;/Expression&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ConditionDetection&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ConditionDetection ID="SecondFilterCondition" TypeID="System!System.ExpressionFilter"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Expression&amp;gt;$Config/SecondExpression$&amp;lt;/Expression&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ConditionDetection&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/MemberModules&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RegularDetections&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RegularDetection MonitorTypeStateID="FirstEventRaised"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Node ID="FirstFilterCondition"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Node ID="FirstDataSource"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Node&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/RegularDetection&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RegularDetection MonitorTypeStateID="SecondEventRaised"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Node ID="SecondFilterCondition"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Node ID="SecondDataSource"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Node&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/RegularDetection&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/RegularDetections&amp;gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;OnDemandDetections&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;OnDemandDetection MonitorTypeStateID="SecondEventRaised"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Node ID="OnDemandReset"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/OnDemandDetection&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/OnDemandDetections&amp;gt;&lt;/strong&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/MonitorImplementation&amp;gt;&lt;br&gt;&amp;lt;/UnitMonitorType&amp;gt;  &lt;p&gt;Note that there are two nodes added to the XML.&amp;nbsp; First, we need to add a new System.PassThroughProbe&amp;nbsp;module so the monitor knows to even look for our reset.&amp;nbsp; We next need an OnDemandDetections node that specifies what MonitorTypeStateID to set when the reset is performed.&amp;nbsp; In this case, I'm assuming that the second event indicates a healthy state.&amp;nbsp; The MonitorTypeStateID of SecondEventRaised directly corresponds to the same ID in the MonitorTypeStates node.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=1718127" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/ati/archive/tags/MOM/default.aspx">MOM</category></item><item><title>Exporting Management Packs</title><link>http://blogs.technet.com/ati/archive/2007/08/06/exporting-management-packs.aspx</link><pubDate>Mon, 06 Aug 2007 20:43:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1713115</guid><dc:creator>Brian Wren</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/ati/comments/1713115.aspx</comments><wfw:commentRss>http://blogs.technet.com/ati/commentrss.aspx?PostID=1713115</wfw:commentRss><description>&lt;p&gt;Obviously, a great way to learn how to author a management pack&amp;nbsp;is to look at existing ones.&amp;nbsp; The problem is&amp;nbsp;that most of the interesting ones are sealed so you can't read the file, and the Operations Console won't allow you to export a&amp;nbsp;sealed management pack.&amp;nbsp; &lt;/p&gt; &lt;p&gt;This is actually very easy using Command Shell.&amp;nbsp;&amp;nbsp;You can export a single management pack or export the entire set of installed management packs from a management group.&amp;nbsp; This is my personal favorite as I like to have the entire set of management packs available for my reference.&lt;/p&gt; &lt;p&gt;Command Shell is an optional component of the Operations Manager User Interfaces, so it's probably something you already have installed.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Exporting a single management pack&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;To export a single management pack, use the following command:&lt;/p&gt; &lt;p align="center"&gt;get-managementPack -name &amp;lt;Name of MP&amp;gt; | export-managementPack&amp;nbsp;-path &amp;lt;Directory to store exported file&amp;gt;&lt;/p&gt; &lt;p&gt;For example, to export the SQL Library MP to a directory called c:\mp:&lt;/p&gt; &lt;p align="center"&gt;get-managementPack -name&amp;nbsp;Microsoft.SQLServer.Library | export-managementPack&amp;nbsp;-path c:\mp&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Exporting all management packs&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;It's actually easier to export all management packs since you don't have to specify the -name parameter on the get-managementPack CmdLet.&amp;nbsp; Just use the following, and you will fill c:\mp with the entire set of management packs installed in your management group.&lt;/p&gt; &lt;p align="center"&gt;get-managementPack | export-managementPack&amp;nbsp;-path c:\mp&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=1713115" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/ati/archive/tags/MOM/default.aspx">MOM</category></item><item><title>Targeting Rules and Monitors</title><link>http://blogs.technet.com/ati/archive/2007/05/14/targeting-rules-and-monitors.aspx</link><pubDate>Mon, 14 May 2007 17:40:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:961366</guid><dc:creator>Brian Wren</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.technet.com/ati/comments/961366.aspx</comments><wfw:commentRss>http://blogs.technet.com/ati/commentrss.aspx?PostID=961366</wfw:commentRss><description>&lt;P&gt;The concept of what target to use for a particular rule or monitor in OpsMgr 2007&amp;nbsp;seems to be one that people are struggling with.&amp;nbsp; The confusion is most prevelant among people who have had experience with MOM 2005 since the methods have completely in changed.&amp;nbsp; In MOM 2005, you would apply rule groups to computer groups.&amp;nbsp; If a computer was in the group, it would get the rule - it was that simple. In OpsMgr 2007, we do not use groups to target rules/monitors.&amp;nbsp; What adds to the confusion though is that groups are available in the list of targets when creating a rule/monitor in the console.&amp;nbsp; Let's see if I can explain this.&lt;/P&gt;
&lt;P&gt;The main conceptual difference between MOM 2005 and OpsMgr 2007 in this respect is that in MOM 2005 we thought about which computer we would retrieve a particular piece of information from, and we targeted rules at groups containing those computers.&amp;nbsp; We had to think about the individual agents and view the environment in terms of the physical computers being managed.&amp;nbsp; We had formulas for the groups to identify which computers held different components, but we were ultimately targeting groups of agents.&amp;nbsp; In OpsMgr 2007, we think about what component is generating the information.&amp;nbsp; That’s a distinctly different concept and ultimately more powerful.&amp;nbsp; OpsMgr will figure out which agents hold instances of that component, deliver the rule/monitor to the appropriate agents, and execute the rule/monitor for each instance.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In 2007, we also work against multiple instances of a class on a particular agent.&amp;nbsp; In MOM 2005, we only had a single rule sent to the agent, and that rule had to do the enumeration.&amp;nbsp; A good example is SQL databases.&amp;nbsp; The SQL scripts in MOM 2005 were enormous because they had to enumerate the whole list of databases and other SQL objects every single time they executed.&amp;nbsp; In 2007, we just apply those rules to the SQL Database class, and OpsMgr executes the rule for each database instance discovered.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;How does a rule get to an agent?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For any particular rule/monitor, OpsMgr will enumerate all instances of the target class and apply the rule to each.&amp;nbsp; If there are no instances of the target class on a particular agent, then the rule will do nothing.&amp;nbsp; It's that simple.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If I can't target groups, why are they listed when I select a target for a rule?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Groups are classes just like any other.&amp;nbsp; They’re singleton classes where the class and the instance are one and the same, but they are classes nonetheless which is why they show up in the list with all other classes.&amp;nbsp;&amp;nbsp; There are really very few circumstances where you will target a rule at a group though&lt;STRONG&gt;.&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What if I do target a group?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You can apply a rule/monitor directly to a group, but it will execute against the group object&amp;nbsp;itself.&amp;nbsp; OpsMgr will not enumerate members of the group and apply the rule to each.&amp;nbsp;&amp;nbsp;Any rules targeted at groups will actually operate on the Root Management Server since&amp;nbsp;groups have no host and unhosted objects are&amp;nbsp;managed by the RMS.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;How do I target some group of objects then?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;To the specific question of how to get a particular rule/monitor to a subset of components, you have two basic options.&amp;nbsp; Let’s say for example, you have a particular subset of web sites that you need a particular rule to apply.&amp;nbsp; You could target that rule at the IIS 2003 Web Site class for example, but that would apply the rule to all instances of that class.&amp;nbsp; It would probably apply to sites that you didn’t want.&lt;/P&gt;
&lt;P&gt;Option 1 would be to create a new class and target the rule at the class.&amp;nbsp; In the case of an IIS site, this would mean that you would need to go to the Authoring Console or raw XML and create a new class and discovery.&amp;nbsp; That’s a more advanced solution that most customers will do and probably overkill anyway.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Option 2 is the create a rule target at the whole class and disable it.&amp;nbsp; Create a group with the sites you want and create an override for that group to enable your rule.&amp;nbsp; This&amp;nbsp;might sound like a workaround, but&amp;nbsp;it's a completely valid solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;How do I know&amp;nbsp;if I'm selecting the right target?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The easiest method to validate you are using a target that actually has instances is to use the Discovered Inventory view in the Operations Console prior to creating your rule/monitor.&amp;nbsp;In the Actions pane is an option called "Change target type..." that will bring up the same Select a Target Type dialog box that you see when you select the target for a rule/monitor.&amp;nbsp; This view will list all instances of the target class you select.&amp;nbsp; You can validate which agents have an instance of that class and how many instances&amp;nbsp;each has.&amp;nbsp; If there are no instances listed, then the rule isn't going to do anything.&amp;nbsp; If there are instances, then you not only be confident that the rule/monitor will&amp;nbsp;execute on the agent, but you&amp;nbsp;can also view the properties of the instance that will be accessible to any rules/monitors targeted at it.&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=961366" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/ati/archive/tags/MOM/default.aspx">MOM</category></item><item><title>WMI Events in OpsMgr 2007</title><link>http://blogs.technet.com/ati/archive/2007/04/07/wmi-events-in-opsmgr-2007.aspx</link><pubDate>Sat, 07 Apr 2007 23:12:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:733962</guid><dc:creator>Brian Wren</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/ati/comments/733962.aspx</comments><wfw:commentRss>http://blogs.technet.com/ati/commentrss.aspx?PostID=733962</wfw:commentRss><description>&lt;p&gt;I've already explained how to work with WMI events in MOM 2005 in&amp;nbsp;an article in &lt;a class="" href="http://www.microsoft.com/technet/technetmag/issues/2006/09/WMIEvents" mce_href="http://www.microsoft.com/technet/technetmag/issues/2006/09/WMIEvents"&gt;TechNet Magazine&lt;/a&gt;.&amp;nbsp; Most of the information in that article still applies since it covers the basics of how WMI events work and how to write a query to detect them.&amp;nbsp; What has changed significantly though is how to use them in Operations Manager.&amp;nbsp; I suppose a follow up article would be in order, but a simple blog post should be enough to give you the information you need.&lt;/p&gt; &lt;p&gt;First of all, WMI events in OpsMgr 2007 are used for exactly the same purpose as in MOM 2005.&amp;nbsp; The one big difference is that we no longer have WMI providers for OpsMgr objects to monitor for things like the modification of an alert.&amp;nbsp; We're working on such a different platform though, that those old scenarios don't really apply anymore anyway.&amp;nbsp; &lt;/p&gt; &lt;p&gt;I'm going to speak completely in terms of the Operations Console since that's where most people work with Operations Manager - at least at this early stage of its life.&amp;nbsp; If you're more comfortable working directory with the XML of a management pack, then you'll know exactly what pieces of this information to pull out.&lt;/p&gt; &lt;p&gt;You can create a monitor or rule for a WMI event using the appropriate wizard in the Operations Console.&amp;nbsp; If I have to guide you to those or define the different between an rule and a monitor, then you probably want to start on some more basic monitoring before tackling this topic.&amp;nbsp; The namespace and query are going to be exactly the same as the ones you created in MOM 2005.&amp;nbsp; Again, check my TechNet article if you need some help there.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;WMI Event Filter Expressions&lt;/strong&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;As discussed in my article, you can specify criteria in the WMI query itself, or you can write a general query and specify the criteria separately.&amp;nbsp; In MOM 2005, that meant specifying criteria in the rule.&amp;nbsp; In OpsMgr 2007, you need to provide a filter expression.&amp;nbsp; The question is how to build it.&lt;/p&gt; &lt;p&gt;The wizard for creating a WMI Event monitor/rule actually won't let you specify no criteria.&amp;nbsp; The Next button won't be active until you provide some entry.&amp;nbsp; If you have a query that doesn't need any filter (which is entirely reasonable), then just specify some bogus filter.&amp;nbsp; Once the monitor/rule is created, open up its properties and delete the filter.&amp;nbsp; It's entirely valid to have a monitor/rule with no filter - the wizard just doesn't let you do it.&lt;/p&gt; &lt;p&gt;If you are going to provide filter, the parameter name needs to be in following format:&lt;/p&gt; &lt;blockquote&gt; &lt;p mce_keep="true"&gt;Collection[@Name='TargetInstance']/Property[@Name=&amp;lt;property name&amp;gt;]&lt;/p&gt;&lt;/blockquote&gt; &lt;p mce_keep="true"&gt;&lt;strong&gt;Example - No Filter&lt;/strong&gt;&amp;nbsp;&lt;/p&gt; &lt;p mce_keep="true"&gt;We can show this with a simple example.&amp;nbsp; Let's fire the rule when Notepad starts.&amp;nbsp; One method would be to use the following criteria with no filter:&lt;/p&gt; &lt;blockquote&gt; &lt;p mce_keep="true"&gt;SELECT&amp;nbsp;*&amp;nbsp;FROM __InstanceCreationEvent WITHIN 30 WHERE TargetInstance ISA 'win32_process' AND TargetInstance.Name = 'notepad.exe'&lt;/p&gt;&lt;/blockquote&gt; &lt;p mce_keep="true"&gt;&lt;strong&gt;Example - Filter&lt;/strong&gt;&amp;nbsp;&lt;/p&gt; &lt;p mce_keep="true"&gt;The second option would be to use the following query:&lt;/p&gt; &lt;blockquote&gt; &lt;p mce_keep="true"&gt;SELECT&amp;nbsp;*&amp;nbsp;FROM __InstanceCreationEvent WITHIN 30 WHERE TargetInstance ISA 'win32_process' &lt;/p&gt;&lt;/blockquote&gt; &lt;p mce_keep="true"&gt;with the following filter:&lt;/p&gt; &lt;blockquote&gt;Parameter Name: Collection[@Name='TargetInstance']/Property[@Name='Name'] equals&lt;br&gt;Operator: Equals&lt;br&gt;Value: notepad.exe&lt;/blockquote&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=733962" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/ati/archive/tags/MOM/default.aspx">MOM</category><category domain="http://blogs.technet.com/ati/archive/tags/Scripting/default.aspx">Scripting</category><category domain="http://blogs.technet.com/ati/archive/tags/WMI/default.aspx">WMI</category></item><item><title>Blank Description in SQL Server 2005 Block Analysis script</title><link>http://blogs.technet.com/ati/archive/2006/04/08/424749.aspx</link><pubDate>Sun, 09 Apr 2006 08:46:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:424749</guid><dc:creator>Brian Wren</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/ati/comments/424749.aspx</comments><wfw:commentRss>http://blogs.technet.com/ati/commentrss.aspx?PostID=424749</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;I found that block analysis script&amp;nbsp;for SQL 2005 was generating an appropriate alert, but the description is blank.&amp;nbsp; That description is pretty important because it identifies the process blocking and being blocked.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;After some investigation, I found that there is a problem on the line of the script building the description - specifically where we include the time that the black has been occuring.&amp;nbsp; This is pulled from the waittime field of the sysprocesses table.&amp;nbsp; It turns out that this field was an Int in SQL 2000 but changed to a BigInt in SQL 2005.&amp;nbsp; The script uses a CInt to covert this value to an Integer which results in an overflow.&amp;nbsp; Since we run into an error building the description, it's left blank in the alert.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Fortunately, this is trivial fix - just a matter of swapping out that CInt.&amp;nbsp; I found that to get a correct calculation, I had to convert to a Double prior to performing the division required to convert the value from milliseconds into minutes.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;The offending line is 2240 by my count.&amp;nbsp; Just modify as follows:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT color=#000000&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face=Arial&gt;Original line&lt;/FONT&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT color=#000000&gt;&lt;FONT face="Courier New"&gt;""" has been blocked for " &amp;amp; CStr(CInt(rsBlockedSPIDS("waittime").Value / 1000 / 60)) &amp;amp; _&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT color=#000000&gt;&lt;FONT face="Courier New"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT color=#000000&gt;Changed Line&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT color=#000000&gt;&lt;FONT face="Courier New"&gt;""" has been blocked for " &amp;amp; CStr(CInt(CDbl(rsBlockedSPIDS("waittime").Value) / 1000 / 60)) &amp;amp; _&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=424749" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/ati/archive/tags/MOM/default.aspx">MOM</category></item><item><title>Problem with SQL Server 2005 Long Running Agent Jobs script in MOM 2005</title><link>http://blogs.technet.com/ati/archive/2006/03/25/423134.aspx</link><pubDate>Sat, 25 Mar 2006 19:01:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:423134</guid><dc:creator>Brian Wren</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/ati/comments/423134.aspx</comments><wfw:commentRss>http://blogs.technet.com/ati/commentrss.aspx?PostID=423134</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;I found a problem in the latest version of&amp;nbsp;the SQL Server Management Pack (version 09.0.1399.0700) that I imagine many others have wrestled with as well.&amp;nbsp; Easy fix though, so I wanted to post it out here for everyone.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;The problem is with the script&amp;nbsp;SQL Server 2005 Long Running Agent Jobs.&amp;nbsp; If this script finds a long running job, you will most likely get an alert with a message similar to the following:&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;FONT face="Courier New" size=2&gt;The SQL Server management pack script "SQL Server 2005 Long Running Agent Jobs" is unable to successfully connect to the SQL Server instance "MSSQLSERVER". The error message returned is "Invalid column name 'originating_server'."&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;If you're interested in the background, this script is based on the same script for SQL 2000, but one critical modification was missed in the conversion.&amp;nbsp; The script retrieves a list of running jobs from the sysjobs system table in msdb.&amp;nbsp; In SQL 2000, the name of the server is in the originating_server field, but in SQL 2005 this was changed to originating_server_id.&amp;nbsp; We need to join with sys.servers to retrieve the server name.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;The script can be fixed with a change to a single line.&amp;nbsp; According to my count, line 2265 should be the following:&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New" size=2&gt;strQuery = "select originating_server, name from sysjobs where job_id = " &amp;amp; strGUID&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;Replace this line with the following line that includes a new query.&amp;nbsp; &lt;FONT color=#000000&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#000000&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;I shouldn't have to state the obvious, but make sure you backup the original script first.&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color=#0000ff&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;&lt;FONT face="Courier New" size=2&gt;strQuery = "SELECT&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#000000&gt;&lt;FONT size=2&gt; sys.servers.name as originating_server,sysjobs.name FROM sys.servers JOIN sysjobs ON sysjobs.originating_server_id = sys.servers.server_id WHERE sysjobs.job_id =&lt;FONT color=#000000&gt; " &amp;amp; strGUID&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#000000&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;That should be the only change you need to make to get this script working properly.&amp;nbsp; I expect that we will see it fixed in the next revision of the management pack, but this quick fix should get you by until then.&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=423134" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/ati/archive/tags/MOM/default.aspx">MOM</category></item><item><title>WMI Notifications in MOM</title><link>http://blogs.technet.com/ati/archive/2005/12/21/416398.aspx</link><pubDate>Wed, 21 Dec 2005 23:34:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:416398</guid><dc:creator>Brian Wren</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/ati/comments/416398.aspx</comments><wfw:commentRss>http://blogs.technet.com/ati/commentrss.aspx?PostID=416398</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Okay, I'm getting tired of answering this question but I have to admit that there is relatively little technical information out there on it.&amp;nbsp;&amp;nbsp;The most common&amp;nbsp;requests I get for MOM scripts are&amp;nbsp;for things like monitoring if a process is running, if a file gets created, if a registry key gets changed, etc.&amp;nbsp; Essentially, these are to monitor some action on the computer that we can't detect through standard MOM providers.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Most of the time,&amp;nbsp;monitoring these actions does not require a script.&amp;nbsp; They can be handled with a relatively simple WMI provider.&amp;nbsp;&amp;nbsp;This is far more efficient than script - easier to create, less overhead on the agent, and way more responsive.&amp;nbsp; Rather than running a script every few minutes to figure out if a process is running for example, I can have a WMI notification&amp;nbsp;tell me when the process terminates.&amp;nbsp; Rather then regularly checking if some file exists, I can have a WMI notification tell me when it gets created.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;I have a document that I wrote on this that includes an overview of WMI, methods for writing and testing WMI queries, and a bunch of examples.&amp;nbsp; &lt;A href="http://brianwren.members.winisp.net/WMI/Forms/AllItems.aspx"&gt;Have a look&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=416398" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/ati/archive/tags/MOM/default.aspx">MOM</category><category domain="http://blogs.technet.com/ati/archive/tags/WMI/default.aspx">WMI</category></item></channel></rss>