<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Pavleck.Net</title>
	<atom:link href="http://pavleck.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://pavleck.net</link>
	<description>Monitoring, Scripting, and other Technologies</description>
	<pubDate>Tue, 12 Aug 2008 19:03:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Building dynamic groups using WMI Queries</title>
		<link>http://pavleck.net/2008/08/12/building-dynamic-groups-using-wmi-queries/</link>
		<comments>http://pavleck.net/2008/08/12/building-dynamic-groups-using-wmi-queries/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 19:03:06 +0000</pubDate>
		<dc:creator>Jeremy D. Pavleck</dc:creator>
		
		<category><![CDATA[Authoring]]></category>

		<category><![CDATA[SCOM]]></category>

		<category><![CDATA[WMI]]></category>

		<category><![CDATA[Attribute]]></category>

		<category><![CDATA[Custom]]></category>

		<category><![CDATA[Group]]></category>

		<guid isPermaLink="false">http://pavleck.net/?p=91</guid>
		<description><![CDATA[Occasionally I&#8217;ll get some interesting requests from clients. One of those requests happened recently.
My client wanted to be able to see all of the servers that a certain process was running on. It was a &#8216;roaming&#8217; process, and could be on any number of servers at any given time.  That&#8217;s easily solved with a dynamic [...]]]></description>
			<content:encoded><![CDATA[<p>Occasionally I&#8217;ll get some interesting requests from clients. One of those requests happened recently.</p>
<p>My client wanted to be able to see all of the servers that a certain process was running on. It was a &#8216;roaming&#8217; process, and could be on any number of servers at any given time.  That&#8217;s easily solved with a dynamic group, a WMI query, and a custom attribute. In this example, I&#8217;ll be using the ubiqutous Notepad.exe</p>
<ol>
<li>First, start the console, open the Authoring pane, then right click on attributes and select &#8220;<em>Create New Attribute</em>&#8220;.</li>
<li>Give your attribute a name - I used &#8220;Notepad Running&#8221; - and a nice description, then hit next.
<div id="attachment_92" class="wp-caption alignnone" style="width: 510px"><a href="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute-generalproperties.jpg"><img class="size-medium wp-image-92" title="SCOM - Create Attribute Wizard - General Properties" src="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute-generalproperties-500x444.jpg" alt="SCOM - Create Attribute Wizard - General Properties Page" width="500" height="444" /></a><p class="wp-caption-text">SCOM - Create Attribute Wizard - General Properties Page</p></div></li>
<li>Under &#8220;<em>Discovery Type</em>&#8221; select <strong>WMI Query</strong> and select your target and management pack. Windows Server_Extended is a good choice for something as open ended as our particular request is, but you can narrow it down if you&#8217;d like.<br />
Then hit next.</p>
<p><div id="attachment_93" class="wp-caption alignnone" style="width: 510px"><a href="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute-discoverymethod.jpg"><img class="size-medium wp-image-93" title="SCOM - Create Attribute Wizard - Discovery Method" src="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute-discoverymethod-500x444.jpg" alt="SCOM - Create Attribute Wizard - Discovery Method" width="500" height="444" /></a><p class="wp-caption-text">SCOM - Create Attribute Wizard - Discovery Method</p></div></li>
<li>Under WMI Configuration we will build our query. Enter root\cimv2 for the namespace and for the query we&#8217;ll be using &#8220;<em>Select * FROM WIN32_Process where Name = &#8220;notepad.exe&#8221;</em>. The Property Name field is the most important part, and one not a lot of people understand right away. The &#8220;Property Name&#8221; field is what SCOM pays attention to, and what you use when you build groups and rules. In this example, I only want processes with notepad.exe to be returned, so I specify that in my query. For the Property name, I&#8217;m using Handle, which will always return <em>something</em>, but I could have used almost anything - such as ProcessID.
<p><div id="attachment_94" class="wp-caption alignnone" style="width: 510px"><a href="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute-wmiconfiguration.jpg"><img class="size-medium wp-image-94" title="SCOM - Create Attribute Wizard - WMI Configuration" src="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute-wmiconfiguration-500x444.jpg" alt="SCOM - Create Attribute Wizard - WMI Configuration" width="500" height="444" /></a><p class="wp-caption-text">SCOM - Create Attribute Wizard - WMI Configuration</p></div>
<p>If I wanted to create a more generic attribute, I could have used the query &#8220;Select * FROM WIN32_Process&#8221;, with a property name of &#8220;Name&#8221;. Then I could create groups with attributes of &lt;Attribute&gt; equals &lt;Process Name&gt;. If you&#8217;d like to learn more about the various fields available to you, open CIM Studio, part of the <a title="MS: Download WMI Administrative Tools" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6430f853-1120-48db-8cc5-f2abdc3ed314&amp;displaylang=en">WMI Administrative Tools</a> bundle. When you execute a query, the column names are what we&#8217;re talking about here.</p>
<div id="attachment_95" class="wp-caption alignnone" style="width: 510px"><a href="http://pavleck.net/wp-content/uploads/2008/08/cimstudio-wmiqueryresults.jpg"><img class="size-medium wp-image-95" title="CIM Studio - Results of WMI Query" src="http://pavleck.net/wp-content/uploads/2008/08/cimstudio-wmiqueryresults-500x56.jpg" alt="CIM Studio - Results of WMI Query" width="500" height="56" /></a><p class="wp-caption-text">CIM Studio - Results of WMI Query</p></div></li>
<li>After you&#8217;re done, hit finish and we&#8217;ll be back at the attributes pane. Do a quick search to make sure it was added, and we&#8217;re done here.
<p><div id="attachment_96" class="wp-caption alignnone" style="width: 430px"><a href="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute-searchresults.jpg"><img class="size-medium wp-image-96" title="SCOM - Search Results for custom attribute" src="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute-searchresults.jpg" alt="SCOM - Search Results for custom attribute" width="420" height="133" /></a><p class="wp-caption-text">SCOM - Search Results for custom attribute</p></div></li>
<li>Now right-click on groups and select &#8220;Create a new group&#8221;<br />
Give it a nice friendly name &amp; description and for the management pack <strong>choose the same one you used when creating your attribute!</strong> That&#8217;s important, as dynamic inclusion rules only scope to what is available in the current management pack (And any dependent ones), so you&#8217;d be going crazy wondering where your attribute is if you used a different one. Then hit Next&gt;</p>
<p><div id="attachment_97" class="wp-caption alignnone" style="width: 510px"><a href="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute2-creategroupwizard.jpg"><img class="size-medium wp-image-97" title="SCOM - Create Attribute - Create Group Wizard" src="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute2-creategroupwizard-500x433.jpg" alt="SCOM - Create Attribute - Create Group Wizard" width="500" height="433" /></a><p class="wp-caption-text">SCOM - Create Attribute - Create Group Wizard</p></div></li>
<li>Under &#8220;Explicit Members&#8221; hit next, we don&#8217;t want to put anything in here.</li>
<li>Under &#8220;Dynamic Members&#8221; click on Create/Edit Rules. From the drop down, select the class your attribute was added to (In this case, it&#8217;s Windows Server_Extended) and hit add to insert a line. Click on the drop down for Property, and you should see the one we created called &#8220;Notepad Running&#8221;.
<p><div id="attachment_98" class="wp-caption alignnone" style="width: 510px"><a href="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute2-dynamicmemberrule.jpg"><img class="size-medium wp-image-98" title="SCOM - Create Attribute - Dynamic Group Query Builder" src="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute2-dynamicmemberrule-500x434.jpg" alt="SCOM - Create Attribute - Dynamic Group Query Builder 2" width="500" height="434" /></a><p class="wp-caption-text">SCOM - Create Attribute - Dynamic Group Query Builder 2</p></div></li>
<li>Select it, then finish up the formula. In this particular case we&#8217;re using &#8220;Greater than or equal to&#8221; as the operator and &#8220;1&#8243; as the value.
<p><div id="attachment_99" class="wp-caption alignnone" style="width: 510px"><a href="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute2-dynamicmemberrule2.jpg"><img class="size-medium wp-image-99" title="SCOM - Create Attribute - Dynamic Group Formula" src="http://pavleck.net/wp-content/uploads/2008/08/scom-createattribute2-dynamicmemberrule2-500x82.jpg" alt="SCOM - Create Attribute - Dynamic Group Formula" width="500" height="82" /></a><p class="wp-caption-text">SCOM - Create Attribute - Dynamic Group Formula</p></div>
<p>To be perfectly honest, you should consider this more of a &#8216;hack&#8217;. What happens is the agent runs &#8220;Select * FROM WIN32_Process where Name = &#8216;notepad.exe&#8217;&#8221; and returns the Handle property back to the server. The Handle property will never be 0 (Except for the System Idle Process). So if notepad.exe is running on a particular server, it will always return a Handle greater than or equal to 1. If notepad.exe isn&#8217;t running on a server, this query returns $null for the handle, which evaluates to FALSE in out Greater than or equal to formula.</li>
<li>Click on OK, then Next. Hit next on Subgroups and again on Excluded Members, then hit &#8216;Create&#8217;.</li>
</ol>
<p>You&#8217;re finished. Wait some time for the new discovery to propogate fully, then right click on your newly created group and then &#8220;View Group Members&#8221;. And now you can interact with this group just like you&#8217;ve always been. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://pavleck.net/2008/08/12/building-dynamic-groups-using-wmi-queries/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Not sitting on my laurels.</title>
		<link>http://pavleck.net/2008/08/05/not-sitting-on-my-laurels/</link>
		<comments>http://pavleck.net/2008/08/05/not-sitting-on-my-laurels/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 14:54:21 +0000</pubDate>
		<dc:creator>Jeremy D. Pavleck</dc:creator>
		
		<category><![CDATA[Community]]></category>

		<category><![CDATA[Powershell]]></category>

		<category><![CDATA[SCOM]]></category>

		<category><![CDATA[silly]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://pavleck.net/?p=88</guid>
		<description><![CDATA[It&#8217;s been awhile. I&#8217;ve actually been terribly busy at my current client, implementing and fine-tuning my Alert Resolution State notification workflow. I&#8217;m currently expanding it to hold a few dozen different teams, as well as creating PropertyBags to send performance data (Number of alerts changed per category, total time script ran, total alerts, etc) as [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been awhile. I&#8217;ve actually been terribly busy at my current client, implementing and fine-tuning my <a href="http://pavleck.net/2008/07/03/using-resolution-states-to-fine-tune-alert-notifications/">Alert Resolution State notification workflow</a>. I&#8217;m currently expanding it to hold a few dozen different teams, as well as creating PropertyBags to send performance data (Number of alerts changed per category, total time script ran, total alerts, etc) as well as addming more robust failure checks - that way it can also alert if it fails for any reason.</p>
<p>I&#8217;ve also been playing around with PowerShell and 37 year old code.</p>
<div id="attachment_89" class="wp-caption alignnone" style="width: 510px"><a href="http://pavleck.net/wp-content/uploads/2008/08/super-star-trek-in-powershell.jpg"><img class="size-medium wp-image-89" title="Super Star Trek done in PowerShell" src="http://pavleck.net/wp-content/uploads/2008/08/super-star-trek-in-powershell-500x320.jpg" alt="Super Star Trek - in PowerShell!" width="500" height="320" /></a><p class="wp-caption-text">Super Star Trek - in PowerShell!</p></div>
<p>Yes, that&#8217;s <a title="Wikipedia: Super Star Trek" href="http://en.wikipedia.org/wiki/Super_Star_Trek">Super Star Trek</a>. Just a little time-waster I work on while I&#8217;m mulling over a problem or two. And huge thanks to <a title="HuddledMasses.Org" href="http://huddledmasses.org/">Jaykul</a> of course, for all of his Powershell knowledge. I can&#8217;t do it without him and the crew in #powershell!</p>
<p>Are you on Twitter? If so, be sure to follow <a href="http://twitter.com/opsmgr">OpsMgr</a> to stay on top of the most recent SCOM posts out there! And while you&#8217;re at it, feel free to <a href="http://twitter.com/jpavleck">follow me</a> as well - I can always use more friends.</p>
<p>Until next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://pavleck.net/2008/08/05/not-sitting-on-my-laurels/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Twitter Updates for 2008-08-04</title>
		<link>http://pavleck.net/2008/08/04/twitter-updates-for-2008-08-04/</link>
		<comments>http://pavleck.net/2008/08/04/twitter-updates-for-2008-08-04/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 04:59:59 +0000</pubDate>
		<dc:creator>Jeremy D. Pavleck</dc:creator>
		
		<category><![CDATA[SCOM]]></category>

		<guid isPermaLink="false">http://pavleck.net/2008/08/04/twitter-updates-for-2008-08-04/</guid>
		<description><![CDATA[
System Center Forum: Operations Manager 2007 Community Extensions Worksheet: Cameron h.. http://tinyurl.com/68b4l8 #
SMS &#038; MOM Team: OpsMgr 2007: Info on grayed out healthy agent icons and the Exchange agent .. http://tinyurl.com/6zux22 #
Clive Eastwood: KB919154 - The MOM service does not start and event 9014 is logged when you.. http://tinyurl.com/5uwt5l #
Clive Eastwood: MOM 2005 Service Pack [...]]]></description>
			<content:encoded><![CDATA[<ul class="aktt_tweet_digest">
<li>System Center Forum: Operations Manager 2007 Community Extensions Worksheet: Cameron h.. <a href="http://tinyurl.com/68b4l8" rel="nofollow">http://tinyurl.com/68b4l8</a> <a href="http://twitter.com/opsmgr/statuses/877019568">#</a></li>
<li>SMS &#038; MOM Team: OpsMgr 2007: Info on grayed out healthy agent icons and the Exchange agent .. <a href="http://tinyurl.com/6zux22" rel="nofollow">http://tinyurl.com/6zux22</a> <a href="http://twitter.com/opsmgr/statuses/877245909">#</a></li>
<li>Clive Eastwood: KB919154 - The MOM service does not start and event 9014 is logged when you.. <a href="http://tinyurl.com/5uwt5l" rel="nofollow">http://tinyurl.com/5uwt5l</a> <a href="http://twitter.com/opsmgr/statuses/877562211">#</a></li>
<li>Clive Eastwood: MOM 2005 Service Pack 1 support on Windows Server 2008-based computers: The.. <a href="http://tinyurl.com/66rlvv" rel="nofollow">http://tinyurl.com/66rlvv</a> <a href="http://twitter.com/opsmgr/statuses/877562298">#</a></li>
<li>Clive Eastwood: MOM 2005 SP1 - New/Updated MP&#8217;s for Windows Server 2008 release/releasing t.. <a href="http://tinyurl.com/5fozgc" rel="nofollow">http://tinyurl.com/5fozgc</a> <a href="http://twitter.com/opsmgr/statuses/877562324">#</a></li>
</ul>
<p class="aktt_credit">Powered by <a href="http://alexking.org/projects/wordpress">Twitter Tools</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pavleck.net/2008/08/04/twitter-updates-for-2008-08-04/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Let&#8217;s get the community going</title>
		<link>http://pavleck.net/2008/07/14/lets-get-the-community-going/</link>
		<comments>http://pavleck.net/2008/07/14/lets-get-the-community-going/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 17:18:28 +0000</pubDate>
		<dc:creator>Jeremy D. Pavleck</dc:creator>
		
		<category><![CDATA[Community]]></category>

		<category><![CDATA[Chat]]></category>

		<category><![CDATA[IRC]]></category>

		<guid isPermaLink="false">http://pavleck.net/?p=81</guid>
		<description><![CDATA[Granted, as SCOM people we already have a lot of places available to us. There&#8217;s the newsgroups, SystemCenterForum.Org, MOMCommunity.Com, the MS community, MyITForum, FAQShop, and the whole army of bloggers - but I can&#8217;t find somewhere I can&#8217;t get live help, bounce ideas off of people, etc. Sure, I have friends on various IM programs [...]]]></description>
			<content:encoded><![CDATA[<p>Granted, as SCOM people we already have a lot of places available to us. There&#8217;s the <a href="http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.opsmgr">newsgroups</a>, <a href="http://www.systemcenterforum.org">SystemCenterForum.Org</a>, <a href="http://www.momcommunity.com">MOMCommunity.Com</a>, the <a href="http://www.microsoft.com/technet/community/en-us/management/default.mspx">MS community</a>, <a href="http://www.MyITForum.com">MyITForum</a>, <a href="http://www.FAQShop.com">FAQShop</a>, and the whole <a href="http://pavleck.net/2008/06/16/great-list-of-scom-mom-bloggers/">army of bloggers</a> - but I can&#8217;t find somewhere I can&#8217;t get live help, bounce ideas off of people, etc. Sure, I have friends on various IM programs that do the same thing, but they aren&#8217;t always around and I&#8217;d hate to bother them if I don&#8217;t have to.</p>
<p>I want one. From hanging out in a <a href="http://huddledmasses.org/">PowerShell</a> chat room I&#8217;ve learned so much more, and so much faster, then I would have reading books and going through tutorials.</p>
<p>So I&#8217;ve setup an IRC chat room on the <a href="http://freenode.net/">FreeNode network</a>. Why FreeNode? Well, the PowerShell guys hang out there, so we might as well hang out there too. So if you&#8217;re familiar with IRC, connect to chat.freenode.net and /join channel #scom. Not familiar with it? Then <a href="http://pavleck.net/chat/">use the web based chat</a> I&#8217;ve setup (And will eventually register) or read the <a href="http://www.irchelp.org/irchelp/ircprimer.html">&#8217;short&#8217; IRC primer</a>.</p>
<p>Hope to see you there, as I&#8217;m fairly lonely in the channel all by myself!</p>
]]></content:encoded>
			<wfw:commentRss>http://pavleck.net/2008/07/14/lets-get-the-community-going/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A SCOM agent on your SmartPhone?</title>
		<link>http://pavleck.net/2008/07/10/a-scom-agent-on-your-smartphone/</link>
		<comments>http://pavleck.net/2008/07/10/a-scom-agent-on-your-smartphone/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 04:56:44 +0000</pubDate>
		<dc:creator>Jeremy D. Pavleck</dc:creator>
		
		<category><![CDATA[SCOM]]></category>

		<category><![CDATA[big brother]]></category>

		<category><![CDATA[huge hacks]]></category>

		<category><![CDATA[scom agent]]></category>

		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://pavleck.net/?p=78</guid>
		<description><![CDATA[Mayyyyyybe. I&#8217;m not saying anything 100% right now, but lemme say - wouldn&#8217;t it be so creepy and big brotherish if you had a SCOM agent on your SmartPhone, grabbing your current co-ordinates every 15 mins via GPS and then sending it to the RMS wirelessly?
But man, just how do we shoe horn an agent [...]]]></description>
			<content:encoded><![CDATA[<p>Mayyyyyybe. I&#8217;m not saying anything 100% right now, but lemme say - wouldn&#8217;t it be so creepy and big brotherish if you had a SCOM agent on your SmartPhone, grabbing your current co-ordinates every 15 mins via GPS and then sending it to the RMS wirelessly?</p>
<p>But man, just how do we shoe horn an agent on poor Windows Mobile?</p>
<p>Just wait.</p>
]]></content:encoded>
			<wfw:commentRss>http://pavleck.net/2008/07/10/a-scom-agent-on-your-smartphone/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Setting agent failover servers &#038; Switching SNMP device proxies</title>
		<link>http://pavleck.net/2008/07/07/setting-agent-failover-servers-switching-snmp-device-proxies/</link>
		<comments>http://pavleck.net/2008/07/07/setting-agent-failover-servers-switching-snmp-device-proxies/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 18:55:19 +0000</pubDate>
		<dc:creator>Jeremy D. Pavleck</dc:creator>
		
		<category><![CDATA[Command Shell]]></category>

		<category><![CDATA[Powershell]]></category>

		<category><![CDATA[SCOM]]></category>

		<category><![CDATA[SCOM Snippets]]></category>

		<category><![CDATA[SNMP]]></category>

		<category><![CDATA[Failover]]></category>

		<category><![CDATA[Proxy]]></category>

		<guid isPermaLink="false">http://pavleck.net/?p=74</guid>
		<description><![CDATA[By default, you can&#8217;t really specify a failover management server in OpsMgr. Why? Not really sure, though I think it&#8217;s a ploy to ensure you setup the OpsMgr Active Directory Integration, which will handle this for you.
No fret though, we can still do it - it&#8217;ll just take a little bit of actual effort.
First, we [...]]]></description>
			<content:encoded><![CDATA[<p>By default, you can&#8217;t really specify a failover management server in OpsMgr. Why? Not really sure, though I think it&#8217;s a ploy to ensure you setup the <a href="http://wchomak.spaces.live.com/blog/cns!F56EFE25599555EC!386.entry?wa=wsignin1.0">OpsMgr Active Directory Integration</a>, which will handle this for you.</p>
<p>No fret though, we can still do it - it&#8217;ll just take a little bit of actual effort.</p>
<p>First, we need to define our Primary and Failover management servers. This isn&#8217;t something you can just progmatically grab, so you&#8217;ll need to know the name yourself.</p>
<p>In my $PROFILE, I&#8217;ve set them to be defined to 2 variables with the following:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1"># Set Primary Management Server</span><br />
<span class="re3">$Primary_MS</span> = <span class="re0">Get-<span class="re1">ManagementServer</span></span> | <span class="kw1">?</span> <span class="br0">&#123;</span><span class="re3">$_</span>.<span class="me1">Name</span> <span class="re2">-like</span> <span class="st0">&quot;SERVERNAME*&quot;</span><span class="br0">&#125;</span><br />
<span class="co1"># Set Failover Management Server</span><br />
<span class="re3">$Failover_MS</span> = <span class="re0">Get-<span class="re1">ManagementServer</span></span> | <span class="kw1">?</span> <span class="br0">&#123;</span><span class="re3">$_</span>.<span class="me1">Name</span> <span class="re2">-like</span> <span class="st0">&quot;BACKUPSERVER*&quot;</span><span class="br0">&#125;</span></div>
<p>Now that we have that set, it&#8217;s simple to do the rest. First, lets grab all of the servers that don&#8217;t have a failover management server set.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re3">$noFailoverSpecified</span> = <span class="re0">Get-<span class="re1">Agent</span></span> | <span class="kw1">?</span> <span class="br0">&#123;</span><span class="br0">&#40;</span>!<span class="re3">$_</span>.<span class="me1">GetFailoverManagementServers</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#125;</span></div>
<p>What the above does is call the GetFailoverManagementServers() method on each agent. If they have a failover, it will return data and thus $True. If there aren&#8217;t any failovers, it will return nothing - which is the same as $False. So we look for all the ones that don&#8217;t return anything.</p>
<p>If you&#8217;re curious, you can see just how many servers are missing failovers with</p>
<div class="dean_ch" style="white-space: wrap;"> <span class="re3">$noFailoverSpecified</span>.<span class="me1">Count</span></div>
<p>- in my case it was 63.</p>
<p>Now, we just run a quick snippet that adds the failover server to the agent:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">ForEach</span> <span class="br0">&#40;</span><span class="re3">$agent</span> <span class="kw1">in</span> <span class="re3">$noFailoverSpecified</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="re0">Set-<span class="re1">ManagementServer</span></span> <span class="re2">-PrimaryManagementServer</span> <span class="re3">$Primary_MS</span> <span class="re2">-AgentManagedComputer</span> <span class="re3">$agent</span> <span class="re2">-FailoverServer</span> <span class="re3">$Failover_MS</span> | <span class="re0">Out-<span class="re1">Null</span></span><br />
<span class="br0">&#125;</span></div>
<p>That will crunch away as it&#8217;s doing it&#8217;s thing, we&#8217;re redirecting output to $null so we don&#8217;t have to see agents scrolling over and over. When it returns you to a prompt, you&#8217;re done. If you&#8217;d like to verify that you did indeed set all of the agents to have a failover, we can check real quick:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">If</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="re0">Get-<span class="re1">Agent</span></span> |? <span class="br0">&#123;</span><span class="br0">&#40;</span>!<span class="re3">$_</span>.<span class="me1">GetFailoverManagementServers</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#125;</span><span class="br0">&#41;</span>.<span class="me1">Count</span> <span class="re2">-eq</span> <span class="re3">$null</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<span class="re0">Write-<span class="re1">Host</span></span> <span class="st0">&quot;Every agent has a failover server, great job!&quot;</span> <span class="re2">-ForeGroundColor</span> Green<br />
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
<span class="re0">Write-<span class="re1">Host</span></span> <span class="st0">&quot;Looks like we missed some, try again!&quot;</span> <span class="re2">-ForeGroundColor</span> Magenta<br />
<span class="br0">&#125;</span></div>
<p>And that&#8217;s that. All of your agents have a primary and failover server.</p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/07/scom-settingfailoverservers.jpg"><img class="alignnone size-medium wp-image-75" title="scom-settingfailoverservers" src="http://pavleck.net/wp-content/uploads/2008/07/scom-settingfailoverservers-500x265.jpg" alt="Screen shot of SCOM Command Shell showing steps to setup failover agents" width="500" height="265" /></a></p>
<p>But wait, you have a lot of remotely managed devices too? Monitoring SNMP on a bunch of different servers - what happens for that?</p>
<p>Well, we can&#8217;t setup a failover (From what I&#8217;ve seen, if I&#8217;m wrong please let me know) agent. But we can proactively write a script that will change the proxy agent on the devices, and run it as needed.</p>
<p>This was written in a response to <a href="http://groups.google.com/group/microsoft.public.opsmgr.general/browse_thread/thread/49935f503af88e07">this query on the newsgroups</a>, and is only a cursory look into it. There may be other ways of doing this - and I&#8217;d love to hear it. As it stands, I&#8217;m not sure how to set them back to a management server as the monitor.</p>
<p>Firstly, we&#8217;ll have to pick an agent managed computer to use as the new proxy agent. You can&#8217;t use a management server for this, because they aren&#8217;t &#8220;Agent Managed&#8221; and you can&#8217;t use Set-ManagementServer because the devices aren&#8217;t &#8220;Remote Managed Computers&#8221;.  I have a seperate agent-managed server on my network I call &#8220;Timex&#8221; because it acts like a <strong>watch</strong>er node. So I&#8217;ll go ahead and use him.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re3">$proxyAgent</span> = <span class="re0">Get-<span class="re1">Agent</span></span> |? <span class="br0">&#123;</span><span class="re3">$_</span>.<span class="me1">Name</span> <span class="re2">-eq</span> <span class="st0">&quot;timex.pavleck.net&quot;</span><span class="br0">&#125;</span></div>
<p>Then gather a list of our current remotely managed devices</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re3">$remDevices</span> = <span class="re0">Get-<span class="re1">RemotelyManagedDevice</span></span></div>
<p>Now just loop through it, setting the device to use the proxy agent we just instantiated:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">ForEach</span><span class="br0">&#40;</span><span class="re3">$device</span> <span class="kw1">in</span> <span class="re3">$remDevices</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="re0">Set-<span class="re1">ProxyAgent</span></span> <span class="re2">-ProxyAgent</span> <span class="re3">$proxyAgent</span> <span class="re2">-Device</span> <span class="re3">$device</span> | <span class="re0">Out-<span class="re1">Null</span></span><br />
<span class="br0">&#125;</span></div>
<p>That will loop through things changing the proxy server that it uses. When it&#8217;s done, we can verify it by running:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">Get-<span class="re1">RemotelyManagedDevice</span></span> |? <span class="br0">&#123;</span><span class="re3">$_</span>.<span class="me1">ProxyAgentPrincipalName</span> <span class="re2">-ne</span> <span class="re3">$proxyAgent</span>.<span class="me1">Name</span><span class="br0">&#125;</span></div>
<p>If it outputs nothing, then they&#8217;ve all been changed. Simple as that!</p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/07/scom-setproxyagent.jpg"><img class="alignnone size-medium wp-image-76" title="scom-setproxyagent" src="http://pavleck.net/wp-content/uploads/2008/07/scom-setproxyagent-500x265.jpg" alt="SCOM: Setting the proxy agent for a device via command shell" width="500" height="265" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://pavleck.net/2008/07/07/setting-agent-failover-servers-switching-snmp-device-proxies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Resolution States to fine tune alert notifications</title>
		<link>http://pavleck.net/2008/07/03/using-resolution-states-to-fine-tune-alert-notifications/</link>
		<comments>http://pavleck.net/2008/07/03/using-resolution-states-to-fine-tune-alert-notifications/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 20:17:29 +0000</pubDate>
		<dc:creator>Jeremy D. Pavleck</dc:creator>
		
		<category><![CDATA[Authoring]]></category>

		<category><![CDATA[Notifications]]></category>

		<category><![CDATA[SCOM]]></category>

		<category><![CDATA[Alert]]></category>

		<category><![CDATA[Notification]]></category>

		<category><![CDATA[Resolution States]]></category>

		<guid isPermaLink="false">http://pavleck.net/?p=61</guid>
		<description><![CDATA[I haven&#8217;t seen this solution offered as a way to send more customized alerts, and am fairly excited about it. With some of the previous solutions, they involve using the command shell to create an alert notification. This is fine, except if you open the subscription in the GUI - once you&#8217;ve done that, you&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t seen this solution offered as a way to send more customized alerts, and am fairly excited about it. With some of the previous solutions, they involve using the command shell to create an alert notification. This is fine, except if you open the subscription in the GUI - once you&#8217;ve done that, you&#8217;ve essentially undid all that work and created a &#8216;catch all&#8217; that sends an alert on any event. Why? Well, the GUI itself isn&#8217;t designed for the custom settings that can be done in Powershell. This makes it fairly difficult to add people or change the alert - not acceptable to me.</p>
<p>After messing around with authoring console and creating classes based on event viewer errors and other equally exotic methods I came upon something that works wonderfully. The catch? You can only create 254 rules this way.</p>
<p>What am I talking about? Some powershell scripts and the alert resolution states!</p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/07/scom-admin-alertresolutionstates.jpg"><img class="alignnone size-medium wp-image-62" title="scom-admin-alertresolutionstates" src="http://pavleck.net/wp-content/uploads/2008/07/scom-admin-alertresolutionstates-492x500.jpg" alt="SCOM Administration MG Settings - Alerts" width="492" height="500" /></a></p>
<p>By default, there are only 2 states defined - 0 for New, and 255 for Closed. They are always there, and can not be deleted. This leaves 1 - 254 as user definable states. We can use these to make one-to-one events.</p>
<p>Let me start off that this isn&#8217;t an ideal solution, but it is the most <em>readable</em> and elegant solution for this particular problem. You probably shouldn&#8217;t do this on a single rule basis, but target it more at a wildcard match. You <em>do</em> have a naming convention for your rules and monitors, right? If not, this is the perfect reason to get one. I&#8217;ll typically use a convention of &lt;Product Type&gt;-&lt;Product&gt;-&lt;Version (If multiple)-&lt;Rule&gt;. So if I had a rule targeted at exchange, I&#8217;d have a rule similar to &#8220;EMAIL - Exchange - Exchange 2007 - Search for &#8216;Jeremy is fired&#8217; in execs mail&#8221;. Then when I&#8217;m using an exotic config to send an alert, such as this one, I can better fine tune alerts.</p>
<p>Remember, the more you move away from the  &#8220;Out of box&#8221; yfunctionality with OpsMgr, the more you should be documenting. Or even better, a wiki. Just make a reference to the wiki in the description, and people will know exactly what you&#8217;re trying to do - that&#8217;s for another post though.</p>
<p><strong>Let&#8217;s get on with it, shall we?</strong></p>
<p>I&#8217;m going to create a situation. I have a custom application which logs to the Application log. There&#8217;s one particular event that only one group in the organization cares about - all they want is a notification of this one single event and nothing else. How do we do it?</p>
<p>The Cliff&#8217;s Notes version of what we&#8217;ll be accomplishing today:</p>
<ul>
<li>Create a custom Resolution State</li>
<li>Define a new rule</li>
<li>Deploy a PowerShell script to the RMS to update the resolution state of matching alerts</li>
<li>Create a notification subscription which responds to our particular state</li>
</ul>
<p>Now, for the complete steps</p>
<ol>
<li> First go to Authoring &gt; Management Pack Objects &gt; Rules - Right click and &#8220;Create new rule&#8221;</li>
<li>Under rule type, select Alert Generating, Event Based, NT Event Log (Alert) and select a management pack to use.<br />
<a href="http://pavleck.net/wp-content/uploads/2008/07/scom-author-createrule.jpg"><img class="alignnone size-medium wp-image-63" title="scom-author-createrule" src="http://pavleck.net/wp-content/uploads/2008/07/scom-author-createrule-500x448.jpg" alt="System Center Operations Manager 2007 Creat Rule Wizard" width="500" height="448" /></a></li>
<li>Enter a rule name that is distinctive enough that no other rules will have that same name.  Then enter a description, rule category and choose a target. You can go with the shotgun approach and pick &#8220;All Computers&#8221; here if you&#8217;d like.<br />
<a href="http://pavleck.net/wp-content/uploads/2008/07/scom-author-createrule2.jpg"><img class="alignnone size-medium wp-image-65" title="scom-author-createrule2" src="http://pavleck.net/wp-content/uploads/2008/07/scom-author-createrule2-500x448.jpg" alt="SCOM - Authoring - Create Rule Wizard" width="500" height="448" /></a><a href="http://pavleck.net/wp-content/uploads/2008/07/scom-author-createrule-nameanddescription.jpg"><br />
</a></li>
<li>Now walk through the rest of the wizard and configure your event log settings - for this test I&#8217;m using the Application log, Event ID of 926 and event source of &#8220;Pavleck.NET Test&#8221;. But you can put whatever you want here ace, it&#8217;s up to you.</li>
<li>Configure your alert. It should automatically copy over the rule name as the alert name. The alert name is what we&#8217;ll actually be alerting on, so it&#8217;s important that you remember what it is, and ensure it&#8217;s distinctive enough to not match something that already exists.<br />
<a href="http://pavleck.net/wp-content/uploads/2008/07/scom-author-createrule-configurealert.jpg"><img class="alignnone size-medium wp-image-66" title="scom-author-createrule-configurealert" src="http://pavleck.net/wp-content/uploads/2008/07/scom-author-createrule-configurealert-500x448.jpg" alt="SCOM - Authoring - Create Rule Wizard - Configuring the alert" width="500" height="448" /></a></li>
<li>Now we can work on the other parts of this while our rule is propagating across the environment.</li>
<li>Go to Administration &gt; Settings &gt; Alerts - this is where we&#8217;ll define a new Alert Resolution State to use. Click on &#8220;New&#8230;&#8221; and name your state and choose an ID for it, I used 10 in this example.<br />
<a href="http://pavleck.net/wp-content/uploads/2008/07/scom-admin-setresolutionstate.jpg"><img class="alignnone size-medium wp-image-67" title="scom-admin-setresolutionstate" src="http://pavleck.net/wp-content/uploads/2008/07/scom-admin-setresolutionstate-491x500.jpg" alt="SCOM - Alert Resolution States - Adding a new state" width="491" height="500" /></a></li>
<li>Click Apply, then Ok and now we&#8217;re done with part 2.</li>
<li>Let&#8217;s go ahead and test and see if our rule works, just open a command window and use some EventCreate.exe magic.<br />
<a href="http://pavleck.net/wp-content/uploads/2008/07/scom-eventcreate-makeanalert.jpg"><img class="alignnone size-medium wp-image-68" title="scom-eventcreate-makeanalert" src="http://pavleck.net/wp-content/uploads/2008/07/scom-eventcreate-makeanalert-499x99.jpg" alt="" width="499" height="99" /></a></li>
<li>Open up the alert console for whatever machine you ran that on and you should see our new alert in there - yay, we did something!<br />
<a href="http://pavleck.net/wp-content/uploads/2008/07/scom-alerts-tutorialrule.jpg"><img class="alignnone size-medium wp-image-69" title="scom-alerts-tutorialrule" src="http://pavleck.net/wp-content/uploads/2008/07/scom-alerts-tutorialrule-500x157.jpg" alt="" width="500" height="157" /></a></li>
<li>Now we&#8217;ll add the magic that changes the alert resolution state. It&#8217;s a fairly simple script, and it&#8217;s meant to be that way. For simplicity&#8217;s sake, we&#8217;ll be running this script as a timed response from the RMS. Depending on how your particular environment is setup, you could also run it inside of the rule itself, as an additional response to &#8220;Create Alert&#8221;. But that only works well if you only plan on doinbg this sparingly, otherwise it makes more sense to run this from the RMS and add onto the script as needed.<br />
First, <a href="http://pavleck.net/wp-content/uploads/2008/07/scom-updateresolution.ps1">download SCOM-UpdateResolution.ps1</a> here (Or view it after the jump) and edit the alert name, resolution state and RMS to what matches your environment.</li>
<li>Now we&#8217;ll need to go and create a new rule. Rule type is Timed Commands &gt; Execute a command. Give it a name and description. I&#8217;ve set the rule category to &#8220;Maintenance&#8221; as that makes the most sense to me.<br />
<a href="http://pavleck.net/wp-content/uploads/2008/07/scom-author-createtimedscriptruleoverview.jpg"><img class="alignnone size-medium wp-image-71" title="scom-author-createtimedscriptruleoverview" src="http://pavleck.net/wp-content/uploads/2008/07/scom-author-createtimedscriptruleoverview-500x443.jpg" alt="" width="500" height="443" /></a></li>
<li>For the schedule, I&#8217;ve set mine to run every 2 minutes. This means there will be a delay of that much between alerts and notifications, but that&#8217;s acceptable to me. Then hit next.</li>
<li>Configure the command line execution settings as shown - remembering to use &#8220;&amp;&#8221; instead of &#8220;&amp;&#8221;. I&#8217;ve set the timeout to 45 seconds.<br />
<a href="http://pavleck.net/wp-content/uploads/2008/07/scom-author-configurecommandlineexecution.jpg"><img class="alignnone size-medium wp-image-72" title="scom-author-configurecommandlineexecution" src="http://pavleck.net/wp-content/uploads/2008/07/scom-author-configurecommandlineexecution-500x441.jpg" alt="" width="500" height="441" /></a></li>
<li>Hit create and that&#8217;s almost all of it - all we need to do now is to create the alert subscription. Go to administration, right click on Subscriptions and choose &#8220;Create new notification subscription&#8221;</li>
<li>Step through it like normal, choosing all groups, all classes. When you get to the Alert Criteria page, uncheck &#8220;New&#8221; and &#8220;Closed&#8221; and check our new resolution state. If you keep &#8216;closed&#8217; in there, it will pertain to all alerts that close. That&#8217;s one drawback to this method, you won&#8217;t get closed alerts.<br />
<a href="http://pavleck.net/wp-content/uploads/2008/07/scom-alert-alertcriteriapane.jpg"><img class="alignnone size-medium wp-image-70" title="scom-alert-alertcriteriapane" src="http://pavleck.net/wp-content/uploads/2008/07/scom-alert-alertcriteriapane-500x472.jpg" alt="Alert Criteria Pane of the Notification Subscription wizard, showing our custom resolution selected" width="500" height="472" /></a></li>
<li>Finish it up as you normally would, then lets test it! Create a few more test events, and lets see if it works.</li>
</ol>
<p>That&#8217;s all there is to it. This works, reliably and 100% of the time. It&#8217;s extremely flexible and easy to follow for someone just walking into your environment.</p>
<p>By using a single PowerShell script, and targeting the RMS computer <em>group</em> you&#8217;ll be making sure that you have only a single simple script to edit and by mirroring the files and directory paths to any other management servers in your environment you maintain this method if you ever need to promote one to an RMS.</p>
<p><span id="more-61"></span></p>
<p>Here&#8217;s the full script, in case any one wants to view it this way - as you can see it&#8217;s quite simple. It&#8217;s also easily edited to add more functionality - I&#8217;ll be posting updates to it every now and then.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1"># ==============================================================================================</span><br />
<span class="co1">#</span><br />
<span class="co1"># Microsoft PowerShell Source File &#8212; Created with SAPIEN Technologies PrimalScript 2007</span><br />
<span class="co1">#</span><br />
<span class="co1"># NAME: SCOM-UpdateResolution.ps1</span><br />
<span class="co1">#</span><br />
<span class="co1"># AUTHOR: Jeremy D. Pavleck , Pavleck.Net - jeremy@pavleck.net</span><br />
<span class="co1"># DATE &nbsp;: 7/3/2008</span><br />
<span class="co1">#</span><br />
<span class="co1"># COMMENT: This script will look for alerts that match a given name, then change their resolution state</span><br />
<span class="co1">#&nbsp; &nbsp; &nbsp; &nbsp;from New (0) to the defined state. Then you can create alert notifications based solely on that alert</span><br />
<span class="co1"># &nbsp; resolution state.</span><br />
<span class="co1">#</span><br />
<span class="co1"># ==============================================================================================</span></p>
<p><span class="re3">$alertName</span> = <span class="st0">&quot;Pavleck.NET - Tutorial - Resolution State - Error 926&quot;</span><br />
<span class="re3">$resState</span> = <span class="nu0">10</span> <span class="co1"># Our custom resolution state</span><br />
<span class="re3">$RMS</span> = <span class="st0">&quot;MYRMS&quot;</span></p>
<p><span class="re0">Add-<span class="re1">PSSnapin</span></span> <span class="st0">&quot;Microsoft.EnterpriseManagement.OperationsManager.Client&quot;</span><br />
<span class="re0">Set-<span class="re1">Location</span></span> <span class="st0">&quot;OperationsManagerMonitoring::&quot;</span><br />
<span class="re0">New-<span class="re1">ManagementGroupConnection</span></span> <span class="re2">-ConnectionString</span>:<span class="re3">$RMS</span><br />
<span class="re0">Set-<span class="re1">Location</span></span> <span class="re3">$RMS</span></p>
<p><span class="co1"># Let&#8217;s instantiate the SCOM API</span><br />
<span class="re3">$momapi</span> = <span class="re0">New-<span class="re1">Object</span></span> <span class="re2">-comObject</span> <span class="st0">&quot;MOM.ScriptAPI&quot;</span></p>
<p><span class="co1"># Gather all the alerts in &#8216;new&#8217; state and with our alert name</span><br />
<span class="re3">$alerts</span> = <span class="re0">Get-<span class="re1">Alert</span></span> | <span class="re0">Where-<span class="re1">Object</span></span> <span class="br0">&#123;</span><span class="re3">$_</span>.<span class="me1">ResolutionState</span> <span class="re2">-eq</span> <span class="nu0">0</span> <span class="re2">-and</span> <span class="re3">$_</span>.<span class="me1">Name</span> <span class="re2">-eq</span> <span class="re3">$alertName</span><span class="br0">&#125;</span></p>
<p><span class="co1"># Now that we have our alerts, lets change the resolution state to our custom one.</span><br />
<span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re3">$alert</span> <span class="kw1">in</span> <span class="re3">$alerts</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="co1"># Change resolution</span><br />
<span class="re3">$alert</span>.<span class="me1">ResolutionState</span> = <span class="nu0">10</span><br />
<span class="co1"># Update the RMS</span><br />
<span class="re3">$alert</span>.<span class="me1">Update</span><span class="br0">&#40;</span><span class="st0">&quot;&quot;</span><span class="br0">&#41;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://pavleck.net/2008/07/03/using-resolution-states-to-fine-tune-alert-notifications/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Refresher Course: Moving management packs from MOM 2005 to SCOM 2007</title>
		<link>http://pavleck.net/2008/06/26/refresher-course-moving-management-packs-from-mom-2005-to-scom-2007/</link>
		<comments>http://pavleck.net/2008/06/26/refresher-course-moving-management-packs-from-mom-2005-to-scom-2007/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 22:38:18 +0000</pubDate>
		<dc:creator>Jeremy D. Pavleck</dc:creator>
		
		<category><![CDATA[MOM]]></category>

		<category><![CDATA[Migration]]></category>

		<category><![CDATA[SCOM]]></category>

		<category><![CDATA[Basics]]></category>

		<category><![CDATA[Refresher]]></category>

		<category><![CDATA[Setup]]></category>

		<guid isPermaLink="false">http://pavleck.net/?p=54</guid>
		<description><![CDATA[This is just a refresher course on how to convert an MS Operations Manager 2005 management pack into an OpsMgr 2007 management pack. It&#8217;s not tough, but I&#8217;m doing it so I figure I might as well document it!
1. Open your MOM 2005 Administration console, click on &#8220;Management Packs&#8221;, then select &#8220;Import/Export Management Packs&#8221; in [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a refresher course on how to convert an MS Operations Manager 2005 management pack into an OpsMgr 2007 management pack. It&#8217;s not tough, but I&#8217;m doing it so I figure I might as well document it!</p>
<p>1. Open your MOM 2005 Administration console, click on &#8220;Management Packs&#8221;, then select &#8220;Import/Export Management Packs&#8221; in the right hand pane.</p>
<p>2. Go through the wizard, selecting the export option, and choosing the rule group you&#8217;re looking for. You can choose to export views and tasks as well, but I recommend against that as it&#8217;s easy enough to recreate in OpsMgr and you have a lot more objects to choose from. Give it a file name - I usually use &lt;Rule Group&gt;.MP.2005 to make it obvious where it came from.</p>
<p>3. Next you&#8217;ll want to make sure you have the <a title="TechNet: MS Operations Manager 2005 Resource Kit" href="http://technet.microsoft.com/en-us/opsmgr/bb498240.aspx">MOM 2005 Resource Kit</a> installed on your management server and go to %PROGRAM FILES%\Microsoft Operations Manager Resource Kit\Tools\Convert Management Packs to XML. Copy the file MP2XML.exe to the same place you exported your management pack to.</p>
<p>4. Now get to that location via the command line, and lets take that binary AKM and make it useful. Converting it is pretty straightforward - just run MP2XML.exe MOM2005ManagementPack.akm MyNewXMLFile.xml.</p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/06/snag-0000.jpg"><img class="alignnone size-full wp-image-55" title="Screen shot of MOM 2005 RK MP2XML" src="http://pavleck.net/wp-content/uploads/2008/06/snag-0000.jpg" alt="Screen shot of MOM 2005 RK MP2XML" width="499" height="126" /></a></p>
<p>5. When it&#8217;s done, copy that new MOM 2005 XML document into your SCOM directory. In that directory lie 2 tools we need, MPConvert.exe and MPVerify.exe. You can copy these tools somewhere else if you like, but the verification tool needs access to other management packs so make sure it&#8217;s in your %PATH% otherwise.</p>
<p>6. Run MPConvert.exe against your XML file. The tool is looking for MPConvert.exe OLD_NAME NEW_NAME. For simplicity&#8217;s sake I use the same name, only appending _converted to the end to differentiate the 2.</p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/06/snag-0002.jpg"><img class="alignnone size-full wp-image-56" title="Running MPConvert.exe against an XML file" src="http://pavleck.net/wp-content/uploads/2008/06/snag-0002.jpg" alt="Running MPConvert.exe against an XML file" width="500" height="90" /></a></p>
<p>7. When that&#8217;s done, run MPVerify.exe against the new managment pack. What this tool does is ensure that everything has been converted over to the new format properly. It&#8217;s as simple as MPVerify.exe New_Management_Pack.xml</p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/06/snag-0003.jpg"><img class="alignnone size-full wp-image-57" title="Running MPVerify.exe against a newly converted management pack" src="http://pavleck.net/wp-content/uploads/2008/06/snag-0003.jpg" alt="Running MPVerify.exe against a newly converted management pack" width="499" height="99" /></a></p>
<p>8. From there, it&#8217;s up to you. You can open the new unsealed management pack in the Authoring Console to adjust things, or you can just import it in as it is - the choice is yours! That&#8217;s all there is to it!</p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/06/snag-0004.jpg"><img class="alignnone size-medium wp-image-59" title="Newly converted management pack imported into SCOM" src="http://pavleck.net/wp-content/uploads/2008/06/snag-0004-500x174.jpg" alt="Newly converted management pack imported into SCOM" width="500" height="174" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://pavleck.net/2008/06/26/refresher-course-moving-management-packs-from-mom-2005-to-scom-2007/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A &#8216;consoleless&#8217; OpsMgr</title>
		<link>http://pavleck.net/2008/06/23/a-consoleless-opsmgr/</link>
		<comments>http://pavleck.net/2008/06/23/a-consoleless-opsmgr/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 17:50:09 +0000</pubDate>
		<dc:creator>Jeremy D. Pavleck</dc:creator>
		
		<category><![CDATA[HP]]></category>

		<category><![CDATA[Powershell]]></category>

		<category><![CDATA[SCOM]]></category>

		<guid isPermaLink="false">http://pavleck.net/?p=51</guid>
		<description><![CDATA[In MOM 2005, virtually everything was a rule. A rule looked for an even in the event viewer, a line in a log file, a return code from a script, etc and fired off an alert (Or did another action). It was essentially &#8216;dumb&#8217;, because it had no idea whether or not if an even [...]]]></description>
			<content:encoded><![CDATA[<p>In MOM 2005, virtually everything was a rule. A rule looked for an even in the event viewer, a line in a log file, a return code from a script, etc and fired off an alert (Or did another action). It was essentially &#8216;dumb&#8217;, because it had no idea whether or not if an even it raised was ever fixed. It just fired them off every time it saw it.</p>
<p>Enter OpsMgr 2007. It introduced us to an old concept of the &#8216;monitor&#8217;. The monitor is a multi-state event. It watches for multiple items; something will set a particular item into a failed or degraded mode, and there is a corresponding event that marked it as being healthy again. This is wonderful, as it helps minimize the amount of open alerts sitting in your system at any given time. Less open alerts means we have more relevant information to look at.</p>
<p>When it comes to core Windows monitors, it works beautifully and 100% of the time. If you cross a memory threshold, an event is created and an alert goes out (If you&#8217;ve set it up to alert). When the memory drops below this threshold, then the monitor marks that particular object as being in a Healthy state again and, if you&#8217;ve allowed it to, it auto-closes the alert.</p>
<p>When this doesn&#8217;t work beautifully and 100% of the time is when you need to rely on 3rd party agents and management packs. I&#8217;ll use the <a href="http://h18013.www1.hp.com/products/servers/management/mom2007/index.html">HP Management Packs</a> as an example, because that&#8217;s what I&#8217;ve been facing recently.</p>
<p>The way OpsMgr knows about hardware events that happen on an HP machine is because the HP agents themselves will place an event in the Event Viewer and/or send an SNMP trap about it. Works flawlessly to create an event in SCOM about an unhealthy object. What doesn&#8217;t work perfectly is the corresponding event that marks that system as being healthy again.</p>
<p>The reason for this seems to depend on the exact configuration of a server, the version of the HP agents, and the actual event itself. If there is an event, such as a power supply failing, the log is populated and SCOM creates an event saying &#8220;Power Supply #1 degraded.&#8221;. When that power supply is replaced, it won&#8217;t necessarily auto-resolve the event, because instead of seeing &#8220;Power Supply #1 Healthy&#8221;, the HP agents might instead log &#8220;Power Supply (Serial number: FD30401104-P) Inserted into Bay #0&#8243;. The monitor isn&#8217;t looking for that, and so it isn&#8217;t aware that that is the corresponding &#8216;good&#8217; event, and the event stays open.</p>
<p>So theoretically you could replace a failing piece of hardware, such as a Power Supply, which doesn&#8217;t auto-resolve and then in the future have that same PSU die, which won&#8217;t cause a new alert and literally leave you &#8216;powerless&#8217; to know what is going on.</p>
<p>Now, in a normal deployment of OpsMgr this isn&#8217;t to large of a concern. There are always eyes on the console or emails being sent. Someone will see it, fix it, then ensure the event is closed.</p>
<p>The current situation I&#8217;m in, however, doesn&#8217;t work this way. SCOM is being used consoleless to monitor a group of monitoring tools. Essentially it&#8217;s here to keep &#8216;them&#8217; honest, and to ensure there&#8217;s another level of defense to protect us and let us know when a failure has occurred.</p>
<p>Because of this, those slight discrepancies in the HP agents and the HP management pack aren&#8217;t acceptable. But OpsMgr really doesn&#8217;t have a way of being run without anyone paying attention to it - or does it?</p>
<p>It actually does. What I&#8217;ve setup at this site is a PowerShell script which runs every 4 hours and resolves all the open HP alerts.The HP Agents themselves will run a self-check every hour or so, and log that &#8220;Power Supply #1&#8243; is still failed. Because we&#8217;ve already cleared that alert, SCOM will pick it up again and re-fire the event, the alert, and all that jazz. In essence, we&#8217;ve created a &#8216;nag&#8217; feature in SCOM.</p>
<p>This is beneficial in our case, because the current setup of OpsMgr where I&#8217;m at is mainly there to watch the other monitoring tools. This &#8216;nag&#8217; lets us know that the problem was either not taken care of, or was not alerted on - thus &#8216;keeping them honest&#8217;.</p>
<p>How we do all this is very simple - the OpsMgr Command Shell has almost everything we need.</p>
<p>We&#8217;ll use Get-Alert to bring back a list of all open HP events, and Resolve-Alert to close them, adding a comment that we automated this.</p>
<p>To find the HP alerts, we need to match against the MonitoringObjectFullName property inside the alert. Through trial and error, I noticed that every single HP object began with &#8220;HewlettPackard&#8221;. So we&#8217;ll match against that, picking all alerts that don&#8217;t have a resolution state of 255 (Closed).</p>
<p>From there, we cycle through the alert array, passing each one to Resolve-Alert, along with a -comment - in my case I used &#8220;Closed by Powershell - see (link) for more details&#8221; with a link to the internal Wiki.</p>
<p>And that&#8217;s really all that there is to it. Mind you, I&#8217;ve done a lot more in the script, as you&#8217;ll see below. It measures how long it took to bring up the alerts, counts how many were per severity, the repeat count, etc then creates a PropertyBag and submits all the information to OpsMgr for reporting. It then also logs it to the eventviewer.</p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/06/scom-resolve-hardwarealerts.ps1">Download SCOM-Resolve-HardwareAlerts.ps1</a></p>
<p>This script is best setup to run every 4 hours or so. It&#8217;s setup as a generic &#8216;timed script&#8217; inside of SCOM. If you&#8217;d like more info on setting up SCOM to work with Powershell more properly, see <a href="http://blogs.technet.com/brianwren/archive/2008/02/20/running-powershell-scripts-from-a-management-pack.aspx">Brian Wren&#8217;s post here</a>.</p>
<p>Here&#8217;s the script:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1"># ==============================================================================================</span><br />
<span class="co1">#</span><br />
<span class="co1"># Microsoft PowerShell Source File &#8212; Created with SAPIEN Technologies PrimalScript 4.1</span><br />
<span class="co1">#</span><br />
<span class="co1"># NAME: SCOM-Resolve-HardwareAlerts.ps1</span><br />
<span class="co1">#</span><br />
<span class="co1"># AUTHOR: Jeremy D. Pavleck , JPavleck@GMail.com</span><br />
<span class="co1"># DATE  : 6/11/2008</span><br />
<span class="co1">#</span><br />
<span class="co1"># COMMENT: When run, will gather all open HP alerts and mark them as resolved, setting a user</span><br />
<span class="co1">#    defined comment as well. It will then log to the event viewer it has done so.</span><br />
<span class="co1">#</span><br />
<span class="co1"># NOTES: The &quot;Object Name&quot; we use to determine what rules we want to resolve comes from the</span><br />
<span class="co1">#    MonitoringObjectFullName field of Get-Alert.</span><br />
<span class="co1">#    Also, you&#8217;ll need to either set this command to start in your SCOM2007 dir (By default</span><br />
<span class="co1">#    C:\Program Files\System Center 2007 or edit Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Startup.ps1</span><br />
<span class="co1">#    in said directory and change the dot source reference from current directory to the complete path.</span><br />
<span class="co1">#</span><br />
<span class="co1"># When calling this from an OpsMgr scheduled command, use</span><br />
<span class="co1"># powershell  -PSConsoleFile &quot;C:\Program Files\System Center Operations Manager 2007\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Console.psc1&quot; -command &quot;&amp;amp;amp; {C:\Script\Path.ps1}&quot;</span><br />
<span class="co1">#</span><br />
<span class="co1"># ==============================================================================================</span><br />
<span class="co1"># Ensure that the OpsMgr snap-in is there</span><br />
<span class="re0">Get-<span class="re1">PSSnapin</span></span> <span class="re2">-name</span> <span class="kw3">Microsoft</span>.<span class="me1">EnterpriseManagement</span>.<span class="me1">OperationsManager</span>.<span class="me1">Client</span> <span class="re2">-ErrorAction</span> SilentlyContinue<br />
<span class="kw1">If</span> <span class="br0">&#40;</span>!$?<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
throw <span class="st0">&quot;OpsMgr Console not loaded - please run with -PSConsolfile &#8216;X:\Path\To\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Console.psc1&#8242;&quot;</span><br />
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
<span class="co1"># CHANGE THIS to match the path in your system. Or don&#8217;t.</span><br />
. <span class="st0">&quot;C:\Program Files\System Center Operations Manager 2007\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Startup.ps1&quot;</span> <span class="co1"># Load OpsMgr stuff.</span><br />
<span class="br0">&#125;</span></p>
<p><span class="co1"># Create some counters</span><br />
<span class="re3">$iinfo</span> = <span class="nu0">0</span><br />
<span class="re3">$iwarn</span> = <span class="nu0">0</span><br />
<span class="re3">$ierr</span> = <span class="nu0">0</span><br />
<span class="re3">$icrit</span> = <span class="nu0">0</span><br />
<span class="re3">$iunk</span> = <span class="nu0">0</span></p>
<p><span class="co1">### Configuration Section ###</span><br />
<span class="re3">$objectName</span> = <span class="st0">&quot;HewlettPackard&quot;</span> <span class="co1"># All of the HP objects start with this</span><br />
<span class="re3">$comment</span> = <span class="st0">&quot;Automatically Resolved via PowerShell&quot;</span> <span class="co1"># Added to alert</span></p>
<p><span class="co1"># Create the SCOM Script API object, so we can shove this info into the database</span><br />
<span class="re3">$momapi</span> = <span class="re0">New-<span class="re1">Object</span></span> <span class="re2">-comObject</span> <span class="st0">&quot;MOM.ScriptAPI&quot;</span></p>
<p><span class="co1"># Grab all alerts that match MonitoringObjectFullName and are not Closed</span><br />
<span class="co1"># Time the whole thing for no reason</span><br />
<span class="re3">$findAlertsTime</span> = <span class="re0">Measure-<span class="re1">Command</span></span> <span class="br0">&#123;</span><br />
<span class="re3">$openHPAlerts</span> = <span class="re0">get-<span class="re1">alert</span></span> | <span class="re0">Where-<span class="re1">Object</span></span> <span class="br0">&#123;</span><br />
<span class="br0">&#40;</span><span class="re3">$_</span>.<span class="me1">MonitoringObjectFullName</span> <span class="re2">-match</span> <span class="re3">$objectName</span><span class="br0">&#41;</span> <span class="re2">-and</span> <span class="br0">&#40;</span><span class="re3">$_</span>.<span class="me1">ResolutionState</span> <span class="re2">-ne</span> <span class="nu0">255</span><span class="br0">&#41;</span><br />
<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="co1"># Let&#8217;s grab some stats about what we grabbed first, before we resolve them.</span><br />
<span class="re3">$openCount</span> = <span class="re3">$openHPAlerts</span>.<span class="me1">Count</span><br />
<span class="re3">$totalFindTime</span> = <span class="br0">&#40;</span><span class="br0">&#91;</span>datetime<span class="br0">&#93;</span><span class="br0">&#40;</span><span class="re3">$findAlertsTime</span>.<span class="me1">ticks</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">ToString</span><span class="br0">&#40;</span><span class="st0">&quot;HH:mm.ss&quot;</span><span class="br0">&#41;</span><br />
<span class="co1"># Create a property bag to hold values to send to SCOM</span><br />
<span class="re3">$pbag</span> = <span class="re3">$momapi</span>.<span class="me1">CreatePropertyBag</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="re3">$pbag</span>.<span class="me1">AddValue</span><span class="br0">&#40;</span><span class="st0">&quot;Total_Open&quot;</span>, <span class="re3">$openCount</span><span class="br0">&#41;</span><br />
<span class="re3">$pbag</span>.<span class="me1">AddValue</span><span class="br0">&#40;</span><span class="st0">&quot;Total_FindTime&quot;</span>, <span class="re3">$totalFindTime</span><span class="br0">&#41;</span></p>
<p><span class="co1"># Resolving them couldn&#8217;t be simpler</span><br />
<span class="co1"># Lets count the severities we&#8217;re clearing, though.</span><br />
<span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re3">$alert</span> <span class="kw1">in</span> <span class="re3">$openHPAlerts</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<span class="kw1">switch</span> <span class="br0">&#40;</span><span class="re3">$alert</span>.<span class="me1">Severity</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="st0">&quot;Information&quot;</span>     <span class="br0">&#123;</span><span class="re3">$iinfo</span>++<span class="br0">&#125;</span><br />
<span class="st0">&quot;Warning&quot;</span>         <span class="br0">&#123;</span><span class="re3">$iwarn</span>++<span class="br0">&#125;</span><br />
<span class="st0">&quot;Error&quot;</span>            <span class="br0">&#123;</span><span class="re3">$ierr</span>++<span class="br0">&#125;</span><br />
<span class="st0">&quot;Critical&quot;</span>        <span class="br0">&#123;</span><span class="re3">$icrit</span>++<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<span class="re3">$progress</span> += <span class="st0">&quot;Server: &quot;</span> + <span class="re3">$alert</span>.<span class="me1">NetBiosComputerName</span> + <span class="st0">&quot; - Rule &#8216;&quot;</span> + <span class="re3">$alert</span>.<span class="me1">Name</span> + <span class="st0">&quot;&#8217; - Repeat Count: &quot;</span> + <span class="re3">$alert</span>.<span class="me1">RepeatCount</span> + <span class="st0">&quot; <span class="es0">`n</span>&quot;</span>;<br />
<span class="co1"># $pbag.AddValue(&quot;AutoResolveFor&quot;, $alert.NetBiosComputerName)</span><br />
<span class="re0">resolve-<span class="re1">alert</span></span> <span class="re2">-comment</span> <span class="re3">$comment</span> <span class="re2">-Alert</span> <span class="re3">$alert</span><br />
<span class="br0">&#125;</span></p>
<p><span class="re3">$pbag</span>.<span class="me1">AddValue</span><span class="br0">&#40;</span><span class="st0">&quot;Info_HP_Alerts&quot;</span>, <span class="re3">$iinfo</span><span class="br0">&#41;</span><br />
<span class="re3">$pbag</span>.<span class="me1">AddValue</span><span class="br0">&#40;</span><span class="st0">&quot;Warn_HP_Alerts&quot;</span>, <span class="re3">$iwarn</span><span class="br0">&#41;</span><br />
<span class="re3">$pbag</span>.<span class="me1">AddValue</span><span class="br0">&#40;</span><span class="st0">&quot;Err_HP_Alerts&quot;</span>, <span class="re3">$ierr</span><span class="br0">&#41;</span><br />
<span class="re3">$pbag</span>.<span class="me1">AddValue</span><span class="br0">&#40;</span><span class="st0">&quot;Crit_HP_Alerts&quot;</span>, <span class="re3">$icrit</span><span class="br0">&#41;</span><br />
<span class="co1"># Submit property bag to SCOM</span><br />
<span class="re3">$momapi</span>.<span class="kw1">Return</span><span class="br0">&#40;</span><span class="re3">$pbag</span><span class="br0">&#41;</span></p>
<p><span class="co1"># Log eventviewer event to let us know what we did</span><br />
<span class="co1"># Severities: 1 = Error, 2 = Warning, 4 = Informational - &quot;Script Name&quot;, &quot;Event ID&quot;, &quot;Severity&quot;, &quot;Description&quot;</span><br />
<span class="re3">$momapi</span>.<span class="me1">LogScriptEvent</span><span class="br0">&#40;</span><span class="st0">&quot;SCOM-Resolve-HardwareAlerts.ps1&quot;</span>, <span class="nu0">926</span>, <span class="nu0">4</span>, <span class="st0">&quot;Successfully resolved &quot;</span> + <span class="re3">$openCount</span> + <span class="st0">&quot; alerts. <span class="es0">`n</span>Report:<span class="es0">`n</span>&quot;</span> + <span class="re3">$progress</span><span class="br0">&#41;</span><br />
&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://pavleck.net/2008/06/23/a-consoleless-opsmgr/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Great list of SCOM &#038; MOM Bloggers</title>
		<link>http://pavleck.net/2008/06/16/great-list-of-scom-mom-bloggers/</link>
		<comments>http://pavleck.net/2008/06/16/great-list-of-scom-mom-bloggers/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 22:53:21 +0000</pubDate>
		<dc:creator>Jeremy D. Pavleck</dc:creator>
		
		<category><![CDATA[Community]]></category>

		<category><![CDATA[MOM]]></category>

		<category><![CDATA[SCOM]]></category>

		<category><![CDATA[Blog]]></category>

		<category><![CDATA[List]]></category>

		<guid isPermaLink="false">http://pavleck.net/?p=45</guid>
		<description><![CDATA[Ian Blyth of the System Center Technologies blog has put together a quite extensive list of MOM &#38; SCOM bloggers. I encourage you to check em out and add their feeds to your feed reader - and to make it even easier on you, I&#8217;ve created 4 OPML feeds for you to choose from. They&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Ian Blyth of the <a title="Ian Blyth's System Center Technologies Blog" href="http://ianblythmanagement.wordpress.com/mom-blog-links/">System Center Technologies blog</a> has put together a quite <a title="List of MOM &amp; SCOM Bloggers, official and otherwise" href="http://ianblythmanagement.wordpress.com/mom-blog-links/">extensive list of MOM &amp; SCOM bloggers</a>. I encourage you to check em out and add their feeds to your feed reader - and to make it even easier on you, I&#8217;ve created 4 <a title="Wikipedia: OPML" href="http://en.wikipedia.org/wiki/OPML">OPML</a> feeds for you to choose from. They&#8217;ve been lumped into 3 groups; MS Blogs, Community Blogs, and Useful Feeds. Most newsreaders allow you to choose which links you want to import from a feed, and they are in folders, so choose the grand list first and if that doesn&#8217;t work, try one of the other ones.</p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/06/scom_mom_all_feeds.opml">SCOM &amp; MOM - All Feeds.opml</a></p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/06/scom_mom_ms_feeds.opml">SCOM &amp; MOM - MS &#8220;Official&#8221; Feeds.opml</a></p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/06/scom_mom_community_feeds.opml">SCOM &amp; MOM - Community Feeds.opml</a></p>
<p><a href="http://pavleck.net/wp-content/uploads/2008/06/scom_mom_useful_feeds.opml">SCOM &amp; MOM - Useful Feeds.opml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pavleck.net/2008/06/16/great-list-of-scom-mom-bloggers/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
