<?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>Is alert grooming working?</title><link>http://blogs.technet.com/jonathanalmquist/archive/2009/03/19/is-alert-grooming-working.aspx</link><description>Evaluate whether alert grooming is working.&amp;#160; No result is good. $Threshold = (Get-Date).ToUniversalTime().AddDays(-(get-defaultsetting)[42].Value).Date;Get-Alert | Where {$_.TimeResolved -and $_.TimeResolved.Date -lt $Threshold} | Measure-Object</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Is alert grooming working?</title><link>http://blogs.technet.com/jonathanalmquist/archive/2009/03/19/is-alert-grooming-working.aspx#3221293</link><pubDate>Thu, 02 Apr 2009 01:50:42 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3221293</guid><dc:creator>Nathan</dc:creator><description>&lt;p&gt;I ran this query against my Opsmgr database and got 38. &amp;nbsp;Any tips on troubleshooting this?&lt;/p&gt;</description></item><item><title>re: Is alert grooming working?</title><link>http://blogs.technet.com/jonathanalmquist/archive/2009/03/19/is-alert-grooming-working.aspx#3221314</link><pubDate>Thu, 02 Apr 2009 02:45:27 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3221314</guid><dc:creator>jtalmquist</dc:creator><description>&lt;P&gt;First, I want to say that I just realized&amp;nbsp;I was getting local time.&amp;nbsp; I&amp;nbsp;just changed the command to get GMT, which will be&amp;nbsp;more accurate depending on your time zone and when you actually run the query.&amp;nbsp; Try running the&amp;nbsp;updated query, and&amp;nbsp;see if that returns the same result.&lt;/P&gt;
&lt;P&gt;If same result...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alert Grooming in the database is a fairly simple process. &amp;nbsp;It simply selects alerts that have a resolution state = 255 and TimeResolved &amp;lt;&amp;gt; NULL. &amp;nbsp;Then calculates, if TimeResolved + Resolved Alert retention days = Today...groom alert. &amp;nbsp;So, if there is a problem I would first check the InternalJobHistory.&lt;/P&gt;
&lt;P&gt;SELECT * FROM InternalJobHistory Order By InternalJobHistoryId DESC&lt;/P&gt;
&lt;P&gt;If you see any jobs with a status code &amp;lt;&amp;gt; 1, then the job isn't starting or finishing as expected. &amp;nbsp;You could run the job manually, to see if it succeeds. &amp;nbsp;Or, check again tomorrow and see if it ran successfully. &amp;nbsp;If either results in a status code &amp;lt;&amp;gt; 1, then you'll need to do some further digging.&lt;/P&gt;</description></item><item><title>re: Is alert grooming working?</title><link>http://blogs.technet.com/jonathanalmquist/archive/2009/03/19/is-alert-grooming-working.aspx#3221777</link><pubDate>Fri, 03 Apr 2009 02:50:52 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3221777</guid><dc:creator>nathan</dc:creator><description>&lt;p&gt;Thanks for the update. &amp;nbsp;The new query returns no data. &amp;nbsp;Not even a 0. &amp;nbsp;I assume this is good!&lt;/p&gt;
&lt;p&gt;I also checked that Internaljob status and all have a code of 1.&lt;/p&gt;
&lt;p&gt;So it appears that all is healthly. &amp;nbsp;Thanks again.&lt;/p&gt;</description></item><item><title>re: Is alert grooming working?</title><link>http://blogs.technet.com/jonathanalmquist/archive/2009/03/19/is-alert-grooming-working.aspx#3221789</link><pubDate>Fri, 03 Apr 2009 03:54:48 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3221789</guid><dc:creator>jtalmquist</dc:creator><description>&lt;P&gt;That's right, Nathan. &amp;nbsp;No result from the query is a good thing. &amp;nbsp;That means no alerts were "stuck" after grooming finished. &amp;nbsp;I suppose I could write some output if the command returns no data, but I'm only giving core examples here.&lt;/P&gt;
&lt;P&gt;The reason why this needs to calculate based on GMT is because that's how the Date-Time stamp is stored in the database. &amp;nbsp;So, if you are located in GMT-6:00, for example, the query would return today's alert count if you run the command afte 7:00PM local time. &amp;nbsp;This would result in a false positive in the command results.&lt;/P&gt;
&lt;P&gt;Now I've got to go back and fix all my other commands that use an alert field containing a Date-Time stamp in a calulation. &amp;nbsp;Arghhh...&lt;/P&gt;</description></item></channel></rss>