<?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>JIMMY HARPER'S OPERATIONS MANAGER BLOG : Monitor</title><link>http://blogs.technet.com/jimmyharper/archive/tags/Monitor/default.aspx</link><description>Tags: Monitor</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Using Integers and other “non-string” data types in Rules and Monitors</title><link>http://blogs.technet.com/jimmyharper/archive/2009/10/01/using-integers-and-other-non-string-data-types-in-rules-and-monitors.aspx</link><pubDate>Thu, 01 Oct 2009 07:19:19 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3284247</guid><dc:creator>jimmyharper</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/jimmyharper/comments/3284247.aspx</comments><wfw:commentRss>http://blogs.technet.com/jimmyharper/commentrss.aspx?PostID=3284247</wfw:commentRss><description>&lt;p&gt;If you need to use any non-string data type in the criteria for custom Rules and Monitors, you’ll need to edit the XML in order for it to work properly.&amp;#160; By default, OpsMgr will treat everything as a String value and the Rule/Monitor will not work properly.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;For example, I created a rule to watch for Event ID 1000 in the Application Log and throw an Alert if Parameter 1 is greater than 20.&amp;#160; Here is the Rule criteria:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/UsingIntegersandothernonstringdatatypesi_147EE/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/UsingIntegersandothernonstringdatatypesi_147EE/image_thumb.png" width="666" height="265" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/UsingIntegersandothernonstringdatatypesi_147EE/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/UsingIntegersandothernonstringdatatypesi_147EE/image_thumb_3.png" width="538" height="543" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Using Event Log Explorer (awesome tool for testing, get it &lt;a href="http://blogs.technet.com/momteam/archive/tags/EventLogExplorer/default.aspx"&gt;here&lt;/a&gt;), I generate Event 1000 with Parameter 1 set to 9:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/UsingIntegersandothernonstringdatatypesi_147EE/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/UsingIntegersandothernonstringdatatypesi_147EE/image_thumb_1.png" width="391" height="446" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I then received the following alert:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/UsingIntegersandothernonstringdatatypesi_147EE/image_10.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/UsingIntegersandothernonstringdatatypesi_147EE/image_thumb_4.png" width="671" height="365" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The reason I received this alert is that if OpsMgr is evaluating Parameter 1 as a String Value, then 9 would be greater than 20 (since 9 is greater than 2).&lt;/p&gt;  &lt;p&gt;To correct, this I’ll need to edit the XML of the rule to change the data type to Integer.&lt;/p&gt;  &lt;p&gt;So, I export the Management Pack that contains this Rule and look at the XML.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is the full XML of the Rule.&amp;#160; The expression that we are concerned with is highlighted in &lt;font color="#008000" size="3"&gt;&lt;strong&gt;green&lt;/strong&gt;&lt;/font&gt;, and the part we need to change is in &lt;font color="#ff0000" size="2"&gt;&lt;strong&gt;red&lt;/strong&gt;&lt;/font&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;lt;Rule ID=&amp;quot;MomUIGeneratedRuleb80bc5a17ec4486185215843882c0046&amp;quot; Enabled=&amp;quot;true&amp;quot; Target=&amp;quot;MicrosoftWindowsLibrary6062780!Microsoft.Windows.Computer&amp;quot; ConfirmDelivery=&amp;quot;true&amp;quot; Remotable=&amp;quot;true&amp;quot; Priority=&amp;quot;Normal&amp;quot; DiscardLevel=&amp;quot;100&amp;quot;&amp;gt;   &lt;br /&gt;&amp;#160; &amp;lt;Category&amp;gt;Custom&amp;lt;/Category&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;DataSources&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;DataSource ID=&amp;quot;DS&amp;quot; TypeID=&amp;quot;MicrosoftWindowsLibrary6062780!Microsoft.Windows.EventProvider&amp;quot;&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ComputerName&amp;gt;$Target/Property[Type=&amp;quot;MicrosoftWindowsLibrary6062780!Microsoft.Windows.Computer&amp;quot;]/NetworkName$&amp;lt;/ComputerName&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;LogName&amp;gt;Application&amp;lt;/LogName&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Expression&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;And&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Expression&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;SimpleExpression&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ValueExpression&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;XPathQuery Type=&amp;quot;UnsignedInteger&amp;quot;&amp;gt;EventDisplayNumber&amp;lt;/XPathQuery&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ValueExpression&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Operator&amp;gt;Equal&amp;lt;/Operator&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ValueExpression&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Value Type=&amp;quot;UnsignedInteger&amp;quot;&amp;gt;1000&amp;lt;/Value&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ValueExpression&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/SimpleExpression&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Expression&amp;gt;    &lt;br /&gt;&lt;font size="2"&gt;&lt;font color="#008000"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Expression&amp;gt;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;SimpleExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ValueExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;XPathQuery Type=&amp;quot;&lt;font color="#ff0000"&gt;String&lt;/font&gt;&amp;quot;&amp;gt;Params/Param[1]&amp;lt;/XPathQuery&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ValueExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Operator&amp;gt;Greater&amp;lt;/Operator&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ValueExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Value Type=&amp;quot;&lt;font color="#ff0000"&gt;String&lt;/font&gt;&amp;quot;&amp;gt;20&amp;lt;/Value&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ValueExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/SimpleExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Expression&amp;gt;&lt;/strong&gt;&lt;/font&gt;      &lt;br /&gt;&lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/And&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Expression&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/DataSource&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;/DataSources&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;WriteActions&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;WriteAction ID=&amp;quot;Alert&amp;quot; TypeID=&amp;quot;Health!System.Health.GenerateAlert&amp;quot;&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Priority&amp;gt;1&amp;lt;/Priority&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Severity&amp;gt;2&amp;lt;/Severity&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;AlertOwner /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;AlertMessageId&amp;gt;$MPElement[Name=&amp;quot;MomUIGeneratedRuleb80bc5a17ec4486185215843882c0046.AlertMessage&amp;quot;]$&amp;lt;/AlertMessageId&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;AlertParameters&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;AlertParameter1&amp;gt;$Data/Params/Param[1]$&amp;lt;/AlertParameter1&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/AlertParameters&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Suppression /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Custom1 /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Custom2 /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Custom3 /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Custom4 /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Custom5 /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Custom6 /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Custom7 /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Custom8 /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Custom9 /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Custom10 /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/WriteAction&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;/WriteActions&amp;gt;    &lt;br /&gt;&amp;lt;/Rule&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To get this rule to work as expected, we’ll need to change &lt;font color="#ff0000" size="2"&gt;&lt;strong&gt;“String”&lt;/strong&gt;&lt;/font&gt; to &lt;font color="#ff0000" size="2"&gt;&lt;strong&gt;“Integer”&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;font color="#008000"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Expression&amp;gt;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;SimpleExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ValueExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;XPathQuery Type=&amp;quot;&lt;font color="#ff0000"&gt;Integer&lt;/font&gt;&amp;quot;&amp;gt;Params/Param[1]&amp;lt;/XPathQuery&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ValueExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Operator&amp;gt;Greater&amp;lt;/Operator&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ValueExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Value Type=&amp;quot;&lt;font color="#ff0000"&gt;Integer&lt;/font&gt;&amp;quot;&amp;gt;20&amp;lt;/Value&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ValueExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/SimpleExpression&amp;gt;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Expression&amp;gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#008000" size="2"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;So, I make the change to the XML, update the version number of the MP, and reimport it.&lt;/p&gt;  &lt;p&gt;I create the same event on the agent an no longer get alerted on it.&lt;/p&gt;  &lt;p&gt;The possible data types that can be used here are:&lt;/p&gt;  &lt;p&gt;&amp;quot;Boolean&amp;quot;   &lt;br /&gt;&amp;quot;Integer&amp;quot;    &lt;br /&gt;&amp;quot;UnsignedInteger&amp;quot;    &lt;br /&gt;&amp;quot;Double&amp;quot;    &lt;br /&gt;&amp;quot;Duration&amp;quot;    &lt;br /&gt;&amp;quot;DateTime&amp;quot;    &lt;br /&gt;&amp;quot;String&amp;quot;&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3284247" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Monitor/default.aspx">Monitor</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Rule/default.aspx">Rule</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Criteria/default.aspx">Criteria</category></item><item><title>Service Monitors – What does the “State” value mean?</title><link>http://blogs.technet.com/jimmyharper/archive/2009/08/12/service-monitors-what-does-the-state-value-mean.aspx</link><pubDate>Wed, 12 Aug 2009 02:00:19 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3272546</guid><dc:creator>jimmyharper</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/jimmyharper/comments/3272546.aspx</comments><wfw:commentRss>http://blogs.technet.com/jimmyharper/commentrss.aspx?PostID=3272546</wfw:commentRss><description>&lt;p&gt;When you create a Service Monitor in OpsMgr 2007, we get an alert / state change when the service is not running, but this does not necessarily mean that the service is “stopped”.&amp;#160; The monitor attempts to get the “State” of the service, and alerts when the State is not “Running”.&amp;#160; So, what other states are there?&amp;#160; Here is a list of possible service states, copied from &lt;a title="http://msdn.microsoft.com/en-us/library/ms685996(VS.85).aspx" href="http://msdn.microsoft.com/en-us/library/ms685996(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms685996(VS.85).aspx&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/ServiceMonitorsWhatdoestheStatevaluemean_FCB5/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/ServiceMonitorsWhatdoestheStatevaluemean_FCB5/image_thumb_1.png" width="1288" height="396" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;However, I recently ran into an issue where we got an alert from a Service Monitor and Health Explorer showed that State=9:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/ServiceMonitorsWhatdoestheStatevaluemean_FCB5/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/ServiceMonitorsWhatdoestheStatevaluemean_FCB5/image_thumb_2.png" width="546" height="302" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;After checking with the OpsMgr product group, I found that State=9 means “Server not found”, and we get this when we fail to open SCManaged with “RPC_S_SERVER_UNAVAILABLE”.&amp;#160; In this particular case, the problem was on a clustered server which had failed over to the second node, which did not have the OpsMgr Agent installed.&lt;/p&gt;  &lt;p&gt;We also have two other states that are not listed in the above table.&amp;#160; State=8 means “Service not found” (we’re trying to monitor a service that does not exist on the agent), and State=0 means “Unknown state”….not sure exactly when we would see this.&lt;/p&gt;  &lt;p&gt;So, here’s the final list of State values that you may see on a service monitor:&lt;/p&gt;  &lt;p&gt;0 = MOM_SERVICE_UNKNOWN_STATE   &lt;br /&gt;1 = MOM_SERVICE_STOPPED    &lt;br /&gt;2 = MOM_SERVICE_START_PENDING    &lt;br /&gt;3 = MOM_SERVICE_STOP_PENDING    &lt;br /&gt;4 = MOM_SERVICE_RUNNING    &lt;br /&gt;5 = MOM_SERVICE_CONTINUE_PENDING    &lt;br /&gt;6 = MOM_SERVICE_PAUSE_PENDING    &lt;br /&gt;7 = MOM_SERVICE_PAUSED    &lt;br /&gt;8 = MOM_SERVICE_NOT_FOUND    &lt;br /&gt;9 = MOM_SERVER_NOT_FOUND&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3272546" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Monitor/default.aspx">Monitor</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Service/default.aspx">Service</category></item><item><title>SQL Server Full Text Search Service Monitor</title><link>http://blogs.technet.com/jimmyharper/archive/2009/07/02/sql-server-full-text-search-service-monitor.aspx</link><pubDate>Thu, 02 Jul 2009 10:41:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3260651</guid><dc:creator>jimmyharper</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.technet.com/jimmyharper/comments/3260651.aspx</comments><wfw:commentRss>http://blogs.technet.com/jimmyharper/commentrss.aspx?PostID=3260651</wfw:commentRss><description>&lt;P&gt;This issue is described in the SQL Server Management Pack Guide, but I wanted to blog it since I’ve seen a couple customers hit it.&lt;/P&gt;
&lt;P&gt;In the current version of the SQL Server Management Pack (version 6.0.6559.0), we have a monitor for the SQL Server Full Text Search Service which is targeted at the SQL 2005/2008 DB Engine classes.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_2.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_2.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb.png" width=833 height=496 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is, this is an optional component in SQL Server and is not always installed.&amp;nbsp; So, for servers where this service is not installed, we will see a lot of the following alerts:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Alert Name:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Service Check Probe Module Failed Execution&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;or&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Service Check Data Source Module Failed Execution&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Alert Description:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Error getting state of service Error: 0x8007007b Details: The filename, directory name, or volume label syntax is incorrect. One or more workflows were affected by this. Workflow name: Microsoft.SQLServer.2005.DBEngine.FullTextSearchServiceMonitor Instance name: MSSQLSERVER Instance ID: {625091EA-A1D9-1857-802C-0D908C93A5BB} Management group: jimmyh_mg1 &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_10.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_10.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_4.png" width=836 height=348 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_4.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To fix this, all we need to do is disable this monitor on any SQL Server that does not have the Full Text Search Service installed.&amp;nbsp; The easiest way to do this is to create a group for all of the SQL Instances that do not have the service installed.&amp;nbsp; The Full Text Search Service name is one of the discovered properties for the DB Engine class and will be blank if the service is not installed:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_4.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_4.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_1.png" width=708 height=321 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To create a group of SQL instances that do not have it installed, we can just use the criteria “Does not match regular expression . (dot)”, like this:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_6.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_6.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_2.png" width=588 height=701 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_2.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, just set an “Enabled=False” override on the monitor, targeted at this group:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_8.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_8.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_3.png" width=702 height=500 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Repeat the same steps to create the group and override for SQL 2008 DB Engines.&lt;/P&gt;
&lt;P&gt;One more thing that you’ll want to do with this monitor is set the “Alert only if startup type is automatic” override to False for clustered SQL Instances…..since the service will always be in a Manual startup mode.&lt;/P&gt;
&lt;P&gt;To do this, I create a group of Cluster SQL Instances where Full Text Search Service IS Installed:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_12.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_12.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_5.png" width=580 height=699 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_5.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And target the override at this group:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_14.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_14.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_6.png" width=699 height=503 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/f32844acbbb8_1F9C/image_thumb_6.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, repeat for SQL 2008 DB Engines.&lt;/P&gt;
&lt;P&gt;Attached is a sample MP that contains the above groups and overrides for SQL 2005 DB Engines.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UPDATED:&lt;/P&gt;
&lt;P&gt;I've removed the original attachment and attached a .zip file that contains these MPs for both SQL 2005 and SQL 2008.&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3260651" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/jimmyharper/attachment/3260651.ashx" length="3857" type="application/x-zip-compressed" /><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Monitor/default.aspx">Monitor</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Service/default.aspx">Service</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Service+Monitor+SQL+Cluster/default.aspx">Service Monitor SQL Cluster</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/SQL/default.aspx">SQL</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Management+Pack/default.aspx">Management Pack</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Full+Text+Search/default.aspx">Full Text Search</category></item><item><title>AD Trust Monitor doesn’t reset to Healthy State</title><link>http://blogs.technet.com/jimmyharper/archive/2009/05/20/ad-trust-monitor-doesn-t-reset-to-healthy-state.aspx</link><pubDate>Wed, 20 May 2009 09:33:25 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3243630</guid><dc:creator>jimmyharper</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.technet.com/jimmyharper/comments/3243630.aspx</comments><wfw:commentRss>http://blogs.technet.com/jimmyharper/commentrss.aspx?PostID=3243630</wfw:commentRss><description>&lt;p&gt;The Active Directory Management Pack (ADMP) – version 6.0.6452.0 – contains a monitor named “AD Trust Monitoring”.&amp;#160; This monitor runs a VBScript which queries WMI to get the status of the Domain Trusts on the Domain Controller.&amp;#160; Is the trust has an error status, the Monitor should change to a critical state, when the error status goes away, it should change back to a Healthy State:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/ADTrustMonitordoesntresettoHealthyState_15DB/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/ADTrustMonitordoesntresettoHealthyState_15DB/image_thumb.png" width="952" height="650" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The problem is that, with default settings, once the Monitor goes into a Critical state, it will not change back to a Healthy state once the Trust problem is resolved.&amp;#160; This is due to a bug in the script, where the value that is used to set the “Good” state is dependent on an override being set.&amp;#160; Without getting into the details, just know that the only way to get the Monitor to work properly (so that state is changed from Critical to Healthy when a Trust problem is resolved), is to set the “LogSuccessEvent” override to “True”:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/ADTrustMonitordoesntresettoHealthyState_15DB/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/ADTrustMonitordoesntresettoHealthyState_15DB/image_thumb_1.png" width="716" height="736" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Setting this Override will also cause the script to log an event to the OpsMgr Event Log every time it completes successfully.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3243630" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Monitor/default.aspx">Monitor</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Active+Directory/default.aspx">Active Directory</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/ADMP/default.aspx">ADMP</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Trust/default.aspx">Trust</category></item><item><title>Configuring or Disabling Replication Monitoring in the Active directory Management pack</title><link>http://blogs.technet.com/jimmyharper/archive/2009/05/20/configuring-or-disabling-replication-monitoring-in-the-active-directory-management-pack.aspx</link><pubDate>Wed, 20 May 2009 08:30:10 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3243598</guid><dc:creator>jimmyharper</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.technet.com/jimmyharper/comments/3243598.aspx</comments><wfw:commentRss>http://blogs.technet.com/jimmyharper/commentrss.aspx?PostID=3243598</wfw:commentRss><description>&lt;p&gt;The latest version of the Active Directory Management Pack (ADMP) – version 6.0.6452.0 – contains some significant changes to Replication Monitoring.&amp;#160; The basic premise is the same, but the Rules and Monitors used have changed a bit.&lt;/p&gt;  &lt;p&gt;Here’s a quick overview of how Replication Monitoring works:&lt;/p&gt;  &lt;p&gt;Each Domain Controller runs the AD Replication Monitoring VBScript.&amp;#160; The first time the script runs, it creates an object for the DC in the OpsMgrLatencyMonitors container in each Active Directory Naming Context that is monitored (the options are Domain, Configuration, and Application; these can be configured via overrides).&amp;#160; By default, every 6th time the script runs (determined by the “Change Injection Frequency” override), the script will update the AdminDescription attribute on the DC’s objects in Active Directory with the current time (these objects can be seen in ADSIEdit.msc).&amp;#160; The script will also look at the objects for all other DCs in its local copy of the Directory.&amp;#160; To determine how long replication from each DCs is taking, the script will look at the whenCreated attribute (this tells the DC when that copy of the object arrived at this DC) and the AdminDescription attribute (this tells the DC when the object was updated).&amp;#160; The time difference between when the object was updated and when it arrived at this DC tells us how long it takes to replicate an object from the given DC.&lt;/p&gt;  &lt;p&gt;The script does a number of other things as well….more details on how all of the scripts in the ADMP work can be found in the old ADMP Technical Reference, found &lt;a href="http://www.microsoft.com/DownLoads/details.aspx?FamilyID=39055bed-9585-4c1c-bf51-58bb3da779e0&amp;amp;displaylang=en"&gt;here&lt;/a&gt;.&amp;#160; This technical reference was written for the original ADMP for MOM 2005, but &lt;em&gt;much&lt;/em&gt; of the information about how the ADMP scripts work still applies today.&lt;/p&gt;  &lt;p&gt;Back to the subject of this blog.&amp;#160; The previous version of the ADMP used a Monitor named “AD Replication Monitoring” to run the Replication Monitoring script.&amp;#160; It also had 4 rules that ran the script as well.&amp;#160; In the new version of the ADMP, the monitor has been “deprecated” and is disabled by default.&amp;#160; Several Rules have been created to run the script and alert on various issues.&amp;#160; The purpose of this change was to avoid alert storms when one Domain Controller stops replicating (previously, we would get an alert from each DC, now we get just one).&amp;#160; The downside of this change is that we now have fourteen (14) Rules that run the Replication Monitoring script.&amp;#160; That’s 14 rules for each OS version….so, 14 for Windows 2000 DCs, 14 for Server 2003 DCs, and 14 for Server 2008 DCs.&amp;#160; To confuse things a little more, some of the rules have the EXACT same display names.&lt;/p&gt;  &lt;p&gt;So, if you need to set overrides to configure or disable Replication Monitoring, they must be set on all of the following Rules:&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;AD Replication is occurring slowly&lt;/font&gt; (there are three rules with this name)     &lt;br /&gt;&lt;font color="#ff0000"&gt;One or more domain controllers may not be replicating&lt;/font&gt; (there are three rules with this name)     &lt;br /&gt;&lt;font color="#ff0000"&gt;DC has failed to synchronize naming context with its replication partner&lt;/font&gt; (there are three rules with this name)     &lt;br /&gt;&lt;font color="#ff0000"&gt;All of the replication partners failed to replicate.      &lt;br /&gt;AD Replication Performance Collection - Metric Replication Latency      &lt;br /&gt;AD Replication Performance Collection - Metric Replication Latency:Minimum      &lt;br /&gt;AD Replication Performance Collection - Metric Replication Latency:Maximum      &lt;br /&gt;AD Replication Performance Collection - Metric Replication Latency:Average&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Why are some of these rules triplicated?&amp;#160; Behind the scenes, these are written to distinguish between replication problems from different versions of Windows Domain Controllers.&amp;#160; For example, if you look in the XML for the ADMP, you can see that the three “AD Replication is occurring slowly” rules have the following IDs:&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;Active_Directory_Latency_Alert_Rule_For_Windows2000 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;Active_Directory_Latency_Alert_Rule_For_Windows2003 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;Active_Directory_Latency_Alert_Rule_For_Windows2008&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;So, for example, each of these rules applies to a Windows Server 2003 Domain Controller, and watches for replication problems from the specified Domain Controller version.&lt;/p&gt;  &lt;p&gt;Again, all of the above rules run the same Replication Monitoring script, so if you need to configure overrides for the script, you must set them on all of these rules.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3243598" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Monitor/default.aspx">Monitor</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/ADMP+Active+Directory+Replication+Monitoring/default.aspx">ADMP Active Directory Replication Monitoring</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Active+Directory/default.aspx">Active Directory</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Replication+Monitoring/default.aspx">Replication Monitoring</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/ADMP/default.aspx">ADMP</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Management+Pack/default.aspx">Management Pack</category></item><item><title>Monitoring a service for State and StartMode</title><link>http://blogs.technet.com/jimmyharper/archive/2008/08/10/monitoring-a-service-for-state-and-startmode.aspx</link><pubDate>Sun, 10 Aug 2008 04:45:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3103036</guid><dc:creator>jimmyharper</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.technet.com/jimmyharper/comments/3103036.aspx</comments><wfw:commentRss>http://blogs.technet.com/jimmyharper/commentrss.aspx?PostID=3103036</wfw:commentRss><description>&lt;P&gt;I recently had a customer that wants to get an alert when a specific service is not Disabled and/or not Stopped.&amp;nbsp; I used the following steps to accomplish this using a "Timed Script Three State Monitor".&amp;nbsp; Even if you do not have this specific need, these steps can be used as a template for creating a monitor that uses a script to query WMI and change state or generate alerts based on the results.&amp;nbsp; If you don't have a need for three states (Critical, Warning, Healthy), there is a Two State Monitor that can be used for this.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new Monitor, select Scripting\Generic\Timed Script Three State Monitor&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_3.png" width=497 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_3.png"&gt;&lt;/P&gt;
&lt;DIV class=wlWriterSmartContent id=scid:0767317B-992E-4b12-91E0-4F059A8CECA8:0cd5adb7-3e5b-4abe-a35b-5a927d5997d5 style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;Technorati Tags: &lt;A href="http://technorati.com/tags/Operations%20Manager" rel=tag mce_href="http://technorati.com/tags/Operations%20Manager"&gt;Operations Manager&lt;/A&gt;,&lt;A href="http://technorati.com/tags/monitor" rel=tag mce_href="http://technorati.com/tags/monitor"&gt;monitor&lt;/A&gt;,&lt;A href="http://technorati.com/tags/Three-state" rel=tag mce_href="http://technorati.com/tags/Three-state"&gt;Three-state&lt;/A&gt;,&lt;A href="http://technorati.com/tags/Two-state" rel=tag mce_href="http://technorati.com/tags/Two-state"&gt;Two-state&lt;/A&gt;,&lt;A href="http://technorati.com/tags/service" rel=tag mce_href="http://technorati.com/tags/service"&gt;service&lt;/A&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Give it a name, target, etc. (I targeted the Windows Computer class, but Windows Operating System may be a better choice).&amp;nbsp; I try to make a habit of unchecking "Monitor is enabled" and enabling it with an override later....at least while testing it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_25.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_25.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_10.png" width=514 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_10.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Set the schedule...this just depends on how quickly you want to know if the service gets changed:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_9.png" width=497 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_9.png"&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, I used a basic VB script which accepts a service name as a parameter, queries WMI for the service, and puts the Service Name, State (Running, Stopped, etc.), and StartMode (Disabled, Manual, Automatic) into property bag values.&amp;nbsp; The full text of the script is below the screenshot:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_11.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_11.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_3.png" width=496 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;---------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;Dim oAPI, oBag,strComputer&lt;BR&gt;Set oAPI = CreateObject("MOM.ScriptAPI")&lt;BR&gt;Set oBag = oAPI.CreatePropertyBag()&lt;BR&gt;set oArgs=wscript.arguments&lt;BR&gt;strComputer="."&lt;BR&gt;ServName=oArgs(0) 
&lt;P&gt;Set namespace=GetObject("winmgmts:\\"&amp;amp; strComputer &amp;amp; "\root\cimv2")&lt;BR&gt;set servinfo=namespace.ExecQuery("select * from win32_service where name =" &amp;amp; """" &amp;amp; servname &amp;amp; """") 
&lt;P&gt;for each objservice in servinfo 
&lt;P&gt;Call oBag.AddValue("ServiceName",ServName)&lt;BR&gt;Call oBag.AddValue("State",objservice.State)&lt;BR&gt;Call oBag.AddValue("StartMode",objservice.StartMode)&lt;BR&gt;Call oAPI.Return(oBag) 
&lt;P&gt;next 
&lt;P&gt;--------------------------------------------------------------------------------------------------- 
&lt;P&gt;For the script parameter, I just enter "ServiceName"....this will be replaced by an override later, or you can just enter your service name here: 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_23.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_23.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_9.png" width=519 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_9.png"&gt;&lt;/A&gt; 
&lt;P&gt;Next, I set the "Unhealthy", "Degraded", and "Healthy" expressions for the monitor.&amp;nbsp; My goal is to set the state to Warning when the service is Stopped but NOT Disabled , Critical when it is NOT Stopped, and Healthy when it is Stopped AND Disabled.&amp;nbsp; I used the following expressions: 
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Unhealthy Expression:&lt;/U&gt;&lt;/STRONG&gt; 
&lt;P&gt;&lt;STRONG&gt;Parameter Name:&lt;/STRONG&gt; Property[@Name='State'] 
&lt;P&gt;&lt;STRONG&gt;Operator:&lt;/STRONG&gt; Does not equal 
&lt;P&gt;&lt;STRONG&gt;Value:&lt;/STRONG&gt; Stopped 
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Degraded Expression:&lt;/U&gt;&lt;/STRONG&gt; 
&lt;P&gt;&lt;STRONG&gt;Parameter Name:&lt;/STRONG&gt; Property[@Name='StartMode'] 
&lt;P&gt;&lt;STRONG&gt;Operator:&lt;/STRONG&gt; Does not equal 
&lt;P&gt;&lt;STRONG&gt;Value:&lt;/STRONG&gt; Disabled&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;AND&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Parameter Name:&lt;/STRONG&gt; Property[@Name='State'] 
&lt;P&gt;&lt;STRONG&gt;Operator:&lt;/STRONG&gt; Equals 
&lt;P&gt;&lt;STRONG&gt;Value:&lt;/STRONG&gt; Stopped&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Healthy Expression:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Parameter Name:&lt;/STRONG&gt; Property[@Name='StartMode'] 
&lt;P&gt;&lt;STRONG&gt;Operator:&lt;/STRONG&gt; Equals 
&lt;P&gt;&lt;STRONG&gt;Value:&lt;/STRONG&gt; Disabled&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;AND&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Parameter Name:&lt;/STRONG&gt; Property[@Name='State'] 
&lt;P&gt;&lt;STRONG&gt;Operator:&lt;/STRONG&gt; Equals 
&lt;P&gt;&lt;STRONG&gt;Value:&lt;/STRONG&gt; Stopped&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_13.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_13.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_4.png" width=522 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_4.png"&gt;&lt;/A&gt; 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_49.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_49.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_22.png" width=514 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_22.png"&gt;&lt;/A&gt; 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_17.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_17.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_6.png" width=516 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_6.png"&gt;&lt;/A&gt; 
&lt;P&gt;Next, I used the default settings for Health State, since they already match what I want to do: 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_19.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_19.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_7.png" width=521 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_7.png"&gt;&lt;/A&gt; 
&lt;P&gt;Next, I configure the alert settings.&amp;nbsp; The settings in the screen shot below will generate a Warning alert when the monitor is in a Warning state (service is not Disabled), and a Critical alert when the monitor is in the Critical state (service is not Stopped).&amp;nbsp; The Alert Description will have the service name (using the ServiceName property created by the script): 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_21.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_21.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_8.png" width=516 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_8.png"&gt;&lt;/A&gt;&amp;nbsp; 
&lt;P&gt;Now that I have the monitor created, I need to enable it and set the Override for the Service Name: 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_27.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_27.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=321 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_11.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_11.png"&gt;&lt;/A&gt; 
&lt;P&gt;I'm using the Alerter service for my test: 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_29.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_29.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=484 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_12.png" width=472 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_12.png"&gt;&lt;/A&gt; 
&lt;P&gt;To test the monitor, I first set the Alerter service to Manual Startup and leave it stopped: 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_31.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_31.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=143 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_13.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_13.png"&gt;&lt;/A&gt; 
&lt;P&gt;Then I verify that I get the Warning alert: 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_39.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_39.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=397 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_17.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_17.png"&gt;&lt;/A&gt; 
&lt;P&gt;Health Explorer correctly shows the "Degraded" Warning state: 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_41.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_41.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=327 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_18.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_18.png"&gt;&lt;/A&gt; 
&lt;P&gt;Now I want to test the Critical state, so I start the Alerter Service: 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_37.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_37.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=188 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_16.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_16.png"&gt;&lt;/A&gt; 
&lt;P&gt;Now the alert is changed to Critical: 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_43.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_43.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=393 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_19.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_19.png"&gt;&lt;/A&gt; 
&lt;P&gt;And Health Explorer shows the "Unhealthy" Critical state: 
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_45.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_45.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=313 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_20.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_20.png"&gt;&lt;/A&gt;&amp;nbsp; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I stop the service and disable it, the alert is auto-resolved and the state is changed back to Healthy:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_47.png" mce_href="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_47.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=310 alt=image src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_21.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/jimmyharper/WindowsLiveWriter/5a596b1689ae_10E0B/image_thumb_21.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've attached my sample MP which includes the following monitors:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;U&gt;Service disabled and stopped - two-state monitor:&lt;/U&gt;&lt;/B&gt; 
&lt;P&gt;If the specified service is not Stopped AND Disabled, the computer will be put in a Warning state and a Warning alert will be generated.&amp;nbsp; When the service is stopped and disabled, the computer will be put in a Healthy state. 
&lt;P&gt;&lt;B&gt;&lt;U&gt;Service disabled and stopped - three-state monitor:&lt;/U&gt;&lt;/B&gt; 
&lt;P&gt;If the specified service is Stopped and is not Disabled, the computer will be put in a Warning state and a Warning alert will be generated.&amp;nbsp; If the specified service is not Stopped, the computer will be put in a critical state and a Critical alert will be generated.&amp;nbsp; When the service is stopped and disabled, the computer will be put in a Healthy state. 
&lt;P&gt;&lt;B&gt;&lt;U&gt;Usage:&lt;/U&gt;&lt;/B&gt; 
&lt;P&gt;Both monitors are targeted at the Windows Computer class and roll up to the Configuration Health.&amp;nbsp; Both monitors are disabled by default.&amp;nbsp; They are configured to check the service every 1 minute.&amp;nbsp; To enable one of the monitors, add an Override for the Computer or Group you wish to monitor and set the following Override parameters: 
&lt;P&gt;&lt;B&gt;Enabled=True&lt;/B&gt; 
&lt;P&gt;&lt;B&gt;Script Arguments = &amp;lt;Service Name&amp;gt;&lt;/B&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Enjoy!!&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3103036" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/jimmyharper/attachment/3103036.ashx" length="15689" type="text/xml" /><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Monitor/default.aspx">Monitor</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Service/default.aspx">Service</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Three-state/default.aspx">Three-state</category><category domain="http://blogs.technet.com/jimmyharper/archive/tags/Two-state/default.aspx">Two-state</category></item></channel></rss>