<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>musc@&#62; $daniele.rant &#124; Out-Blog &#187; OpsMgr2007</title>
	<atom:link href="http://www.muscetta.com/category/opsmgr2007/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.muscetta.com</link>
	<description>Superior Dedication - If you try hard enough, you might even get it to work.</description>
	<lastBuildDate>Thu, 11 Mar 2010 09:58:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>OpsMgr Eventlog analysis with Powershell</title>
		<link>http://www.muscetta.com/2009/12/16/opsmgr-eventlog-analysis-with-powershell/</link>
		<comments>http://www.muscetta.com/2009/12/16/opsmgr-eventlog-analysis-with-powershell/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 10:17:35 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[analysis]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[eventlog]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=489</guid>
		<description><![CDATA[The following technique should already be understood by any powersheller. Here we focus on Operations Manager log entries, even if the data mining technique shows is entirely possibly – and encouraged   &#8211; with any other event log.
Let’s start by getting our eventlog into a variable called $evt:
PS&#160; &#62;&#62; $evt = Get-Eventlog “Operations Manager”
The [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>The following technique should already be understood by any powersheller. Here we focus on Operations Manager log entries, even if the data mining technique shows is entirely possibly – and encouraged <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  &#8211; with any other event log.</p>
<p>Let’s start by getting our eventlog into a variable called $evt:</p>
<p><strong>PS&#160; &gt;&gt; $evt = Get-Eventlog “Operations Manager”</strong></p>
<p>The above only works locally in POSH v1.</p>
<p>In POSH v2 you can go remotely by using the “-computername” parameter:</p>
<p><strong>PS&#160; &gt;&gt; $evt = Get-Eventlog “Operations Manager” –computername RMS.domain.com</strong></p>
<p>Anyhow, you can get to this remotely also in POSHv1 with this other more “dotNET-tish” syntax:</p>
<p><strong>PS &gt;&gt; $evt = (New-Object System.Diagnostics.Eventlog -ArgumentList &quot;Operations Manager&quot;).get_Entries()</strong></p>
<p>you could even export this (or any of the above) to a CLIXML file:</p>
<p><strong>PS &gt;&gt; (New-Object System.Diagnostics.Eventlog -ArgumentList &quot;Operations Manager&quot;).get_Entries() | export-clixml -path c:\evt\Evt-OpsMgr-RMS.MYDOMAIN.COM.xml</strong></p>
<p>and then you could reload your eventlog to another machine:</p>
<p><strong>PS&#160; &gt;&gt; $evt = import-clixml c:\evt\Evt-OpsMgr-RMS.MYDOMAIN.COM.xml</strong>     </p>
<p>whatever way you used to populate your $evt&#160; variable, be it from a “live” eventlog or by re-importing it from XML, you can then start analyzing it:</p>
<p><strong>PS&#160; &gt;&gt; $evt | where {$_.Entrytype -match &quot;Error&quot;} | select EventId,Source,Message | group eventid </strong></p>
<p>Count Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Group    <br />&#8212;&#8211; &#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8211;     <br />1510 4509&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=4509; Source=HealthService; Message=The constructor for the managed module type &quot;Microsoft.EnterpriseManagement.Mom.DatabaseQueryModules.GroupCalculatio.     <br />&#160;&#160; 15 20022&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=20022; Source=OpsMgr Connector; Message=The health service {7B0E947B-2055&#8230;     <br />&#160;&#160;&#160; 3 26319&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=26319; Source=OpsMgr SDK Service; Message=An exception was thrown while p&#8230;     <br />&#160;&#160;&#160; 1 4512&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=4512; Source=HealthService; Message=Converting data batch to XML failed w&#8230; </p>
<p>the above is functionally identical to the following:</p>
<p><strong>PS&#160; &gt;&gt; $evt | where {$_.Entrytype -eq 1} | select EventID,Source,Message | group eventid </strong></p>
<p>Count Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Group    <br />&#8212;&#8211; &#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8211;     <br />1510 4509&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=4509; Source=HealthService; Message=The constructor for the managed modul&#8230;     <br />&#160;&#160; 15 20022&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=20022; Source=OpsMgr Connector; Message=The health service {7B0E947B-2055&#8230;     <br />&#160;&#160;&#160; 3 26319&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=26319; Source=OpsMgr SDK Service; Message=An exception was thrown while p&#8230;     <br />&#160;&#160;&#160; 1 4512&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=4512; Source=HealthService; Message=Converting data batch to XML failed w&#8230; </p>
<p>Note that Eventlog Entries’ type is an ENUM that has values of 0,1,2 – similarly to OpsMgr health states – but beware that their order is not the same, as shown in the following table:</p>
<table border="1" cellspacing="0" cellpadding="2" width="342">
<tbody>
<tr>
<td valign="top" width="71"><strong>Code</strong></td>
<td valign="top" width="137"><strong>OpsMgr States</strong></td>
<td valign="top" width="132"><strong>Events EntryType</strong></td>
</tr>
<tr>
<td valign="top" width="71">0</td>
<td valign="top" width="137">Not Monitored</td>
<td valign="top" width="132">Information</td>
</tr>
<tr>
<td valign="top" width="71">1</td>
<td valign="top" width="137">Success</td>
<td valign="top" width="132">Error</td>
</tr>
<tr>
<td valign="top" width="71">2</td>
<td valign="top" width="137">Warning</td>
<td valign="top" width="132">Warning</td>
</tr>
<tr>
<td valign="top" width="71">3</td>
<td valign="top" width="137">Critical</td>
<td valign="top" width="132">&#8211;</td>
</tr>
</tbody>
</table>
<p>Let’s now look at Information Events (Entrytype –eq 0)</p>
<p><strong>PS&#160; &gt;&gt; $evt | where {$_.Entrytype -eq 0} | select EventID,Source,Message | group eventid </strong></p>
<p>Count Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Group    <br />&#8212;&#8211; &#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8211;     <br />4135 2110&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=2110; Source=HealthService; Message=Health Service successfully transferr&#8230;     <br />1548 21025&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=21025; Source=OpsMgr Connector; Message=OpsMgr has received new configura&#8230;     <br />4644 7026&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=7026; Source=HealthService; Message=The Health Service successfully logge&#8230;     <br />1548 7023&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=7023; Source=HealthService; Message=The Health Service has downloaded sec&#8230;     <br />1548 7025&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=7025; Source=HealthService; Message=The Health Service has authorized all&#8230;     <br />1548 7024&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=7024; Source=HealthService; Message=The Health Service successfully logge&#8230;     <br />1548 7028&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=7028; Source=HealthService; Message=All RunAs accounts for management gro&#8230;     <br />&#160;&#160; 16 20021&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=20021; Source=OpsMgr Connector; Message=The health service {7B0E947B-2055&#8230;     <br />&#160;&#160; 13 7019&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=7019; Source=HealthService; Message=The Health Service has validated all &#8230;     <br />&#160;&#160;&#160; 4 4002&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=4002; Source=Health Service Script; Message=Microsoft.Windows.Server.Logi&#8230; </p>
<p>&#160;</p>
<p>And “Warning” events (Entrytype –eq 2):</p>
<p><strong>PS&#160; &gt;&gt; $evt | where {$_.Entrytype -eq 2} | select EventID,Source,Message | group eventid </strong></p>
<p>Count Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Group    <br />&#8212;&#8211; &#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8211;     <br />1511 1103&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=1103; Source=HealthService; Message=Summary: 1 rule(s)/monitor(s) failed &#8230;     <br />&#160; 501 20058&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=20058; Source=OpsMgr Connector; Message=The Root Connector has received b&#8230;     <br />&#160;&#160;&#160; 5 29202&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=29202; Source=OpsMgr Config Service; Message=OpsMgr Config Service could &#8230;     <br />&#160; 421 31501&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=31501; Source=Health Service Modules; Message=No primary recipients were &#8230;     <br />&#160;&#160; 18 10103&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=10103; Source=Health Service Modules; Message=In PerfDataSource, could no&#8230;     <br />&#160;&#160;&#160; 1 29105&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {@{EventID=29105; Source=OpsMgr Config Service; Message=The request for management p&#8230; </p>
<p>&#160;</p>
<p>&#160;</p>
<p>Ok now let’s see those event 20022, for example… so we get an idea of which healthservices they are referring to (20022 indicates&quot; “hearthbeat failure”, btw):</p>
<p><strong>PS&#160; &gt;&gt; $evt | where {$_.eventid -eq 20022} | select message </strong></p>
<p>Message    <br />&#8212;&#8212;-     <br />The health service {7B0E947B-2055-C12A-B6DB-DD6B311ADF39} running on host webapp3.domain1.mydomain.com and s&#8230;     <br />The health service {E3B3CCAA-E797-4F08-860F-47558B3DA477} running on host SERVER1.domain2.mydomain.com and serving&#8230;     <br />The health service {E3B3CCAA-E797-4F08-860F-47558B3DA477} running on host SERVER1.domain2.mydomain.com and serving&#8230;     <br />The health service {E3B3CCAA-E797-4F08-860F-47558B3DA477} running on host SERVER1.domain2.mydomain.com and serving&#8230;     <br />The health service {52E16F9C-EB1A-9FAF-5B9C-1AA9C8BC28E3} running on host DC4WK3.domain1.mydomain.com and se&#8230;     <br />The health service {F96CC9E6-2EC4-7E63-EE5A-FF9286031C50} running on host VWEBDL2.domain1.mydomain.com and s&#8230;     <br />The health service {71987EE0-909A-8465-C32D-05F315C301CC} running on host VDEVWEBPROBE2.domain2.mydomain.com&#8230;.     <br />The health service {BAF6716E-54A7-DF68-ABCB-B1101EDB2506} running on host XP2SMS002.domain2.mydomain.com and serving mana&#8230;     <br />The health service {30C81387-D5E0-32D6-C3A3-C649F1CF66F1} running on host stgweb3.domain3.mydomain.com and&#8230;     <br />The health service {3DCDD330-BBBB-B8E8-4FED-EF163B27DE0A} running on host VWEBDL1.domain1.mydomain.com and s&#8230;     <br />The health service {13A47552-2693-E774-4F87-87DF68B2F0C0} running on host DC2.domain4.mydomain.com and &#8230;     <br />The health service {920BF9A8-C315-3064-A5AA-A92AA270529C} running on host FSCLU2 and serving management group Pr&#8230;     <br />The health service {FAA3C2B5-C162-C742-786F-F3F8DC8CAC2F} running on host WEBAPP4.domain1.mydomain.com and s&#8230;     <br />The health service {3DCDD330-BBBB-B8E8-4FED-EF163B27DE0A} running on host WEBDL1.domain1.mydomain.com and s&#8230;     <br />The health service {3DCDD330-BBBB-B8E8-4FED-EF163B27DE0A} running on host WEBDL1.domain1.mydomain.com and s&#8230; </p>
<p>&#160;</p>
<p>or let’s look at some warning for the Config Service:</p>
<p><strong>PS&#160; &gt;&gt; $evt | where {$_.Eventid -eq 29202} </strong></p>
<p>&#160;&#160; Index Time&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; EntryType&#160;&#160; Source&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InstanceID Message    <br />&#160;&#160; &#8212;&#8211; &#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8212;&#8212;&#160;&#160; &#8212;&#8212;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8212;&#8212;- &#8212;&#8212;-     <br />5535065 Dec 07 21:18&#160; Warning&#160;&#160;&#160;&#160; OpsMgr Config Ser&#8230;&#160;&#160; 2147512850 OpsMgr Config Service could not retrieve a cons&#8230;     <br />5543960 Dec 09 16:39&#160; Warning&#160;&#160;&#160;&#160; OpsMgr Config Ser&#8230;&#160;&#160; 2147512850 OpsMgr Config Service could not retrieve a cons&#8230;     <br />5545536 Dec 10 01:06&#160; Warning&#160;&#160;&#160;&#160; OpsMgr Config Ser&#8230;&#160;&#160; 2147512850 OpsMgr Config Service could not retrieve a cons&#8230;     <br />5553119 Dec 11 08:24&#160; Warning&#160;&#160;&#160;&#160; OpsMgr Config Ser&#8230;&#160;&#160; 2147512850 OpsMgr Config Service could not retrieve a cons&#8230;     <br />5555677 Dec 11 10:34&#160; Warning&#160;&#160;&#160;&#160; OpsMgr Config Ser&#8230;&#160;&#160; 2147512850 OpsMgr Config Service could not retrieve a cons&#8230; </p>
<p>Once seen those, can you remember of any particular load you had on those days that justifies the instance space changing so quickly that the Config Service couldn’t keep up?</p>
<p>&#160;</p>
<p>Or let’s group those events with ID 21025 by hour, so we know how many Config recalculations we’ve had (which, if many, might indicate <a href="http://blogs.technet.com/kevinholman/archive/2009/10/05/what-is-config-churn.aspx">Config Churn</a>):</p>
<p><strong>PS&#160; &gt;&gt; $evt | where {$_.Eventid -eq 21025} | select TimeGenerated | % {$_.TimeGenerated.ToShortDateString()} | group </strong></p>
<p>Count Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Group    <br />&#8212;&#8211; &#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8211;     <br />&#160;&#160; 39 12/7/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/7/2009, 12/7/2009, 12/7/2009, 12/7/2009&#8230;}     <br />&#160; 203 12/8/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/8/2009, 12/8/2009, 12/8/2009, 12/8/2009&#8230;}     <br />&#160; 217 12/9/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/9/2009, 12/9/2009, 12/9/2009, 12/9/2009&#8230;}     <br />&#160; 278 12/10/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/10/2009, 12/10/2009, 12/10/2009, 12/10/2009&#8230;}     <br />&#160; 259 12/11/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/11/2009, 12/11/2009, 12/11/2009, 12/11/2009&#8230;}     <br />&#160; 224 12/12/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/12/2009, 12/12/2009, 12/12/2009, 12/12/2009&#8230;}     <br />&#160; 237 12/13/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/13/2009, 12/13/2009, 12/13/2009, 12/13/2009&#8230;}     <br />&#160;&#160; 91 12/14/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/14/2009, 12/14/2009, 12/14/2009, 12/14/2009&#8230;} </p>
<p>&#160;</p>
<p>Event ID 21025 shows that there is a new configuration for the Management Group.</p>
<p>Event ID 29103 has a similar wording, but shows that there is a new configuration for a given Healthservice. These should normally be many more events, unless your only health Service is the RMS, which is unlikely…</p>
<p>If we look at the event description (“message”) in search for the name (or even the GUID, as both are present) or our RMS, as follows, then they should be the same numbers of the 21025 above:</p>
<p><strong>PS&#160; &gt;&gt; $evt | where {$_.Eventid -eq 29103} | where {$_.message -match &quot;myrms.domain.com&quot;} | select TimeGenerated | % {$_.TimeGenerated.ToShortDateString()} | group </strong></p>
<p>Count Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Group    <br />&#8212;&#8211; &#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8211;     <br />&#160;&#160; 39 12/7/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/7/2009, 12/7/2009, 12/7/2009, 12/7/2009&#8230;}     <br />&#160; 203 12/8/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/8/2009, 12/8/2009, 12/8/2009, 12/8/2009&#8230;}     <br />&#160; 217 12/9/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/9/2009, 12/9/2009, 12/9/2009, 12/9/2009&#8230;}     <br />&#160; 278 12/10/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/10/2009, 12/10/2009, 12/10/2009, 12/10/2009&#8230;}     <br />&#160; 259 12/11/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/11/2009, 12/11/2009, 12/11/2009, 12/11/2009&#8230;}     <br />&#160; 224 12/12/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/12/2009, 12/12/2009, 12/12/2009, 12/12/2009&#8230;}     <br />&#160; 237 12/13/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/13/2009, 12/13/2009, 12/13/2009, 12/13/2009&#8230;}     <br />&#160;&#160; 91 12/14/2009&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {12/14/2009, 12/14/2009, 12/14/2009, 12/14/2009&#8230;} </p>
<p>&#160;</p>
<p>Going back to the initial counts of events by their IDs, when showing the errors the counts above had spotted the presence of a lonely 4512 event, which might have gone undetected if just browsing the eventlog with the GUI, since it only occurred once.</p>
<p>Let’s take a look at it:</p>
<p><strong>PS&#160; &gt;&gt; $evt | where {$_.eventid -eq 4512} </strong></p>
<p>&#160;&#160; Index Time&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; EntryType&#160;&#160; Source&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InstanceID Message    <br />&#160;&#160; &#8212;&#8211; &#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8212;&#8212;&#160;&#160; &#8212;&#8212;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8212;&#8212;- &#8212;&#8212;-     <br />5560756 Dec 12 11:18&#160; Error&#160;&#160;&#160;&#160;&#160;&#160; HealthService&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 3221229984 Converting data batch to XML failed with error &#8230; </p>
<p>Now, when it is about counts, Powershell is great.&#160; But sometimes Powershell makes it difficult to actually READ the (long) event messages (descriptions) in the console. For example, our event ID 4512 is difficult to read in its entirety and gets truncated with trailing dots…</p>
<p>we can of course increase the window size and/or selecting only THAT one field to read it better:</p>
<p><strong>PS&#160; &gt;&gt; $evt | where {$_.eventid -eq 4512} | select message </strong></p>
<p>Message    <br />&#8212;&#8212;-     <br />Converting data batch to XML failed with error &quot;Not enough storage is available to complete this operation.&quot; (0&#215;8007000E) in rule &quot;Microsoft.SystemCenter.ConfigurationService.CollectionRule.Event.ConfigurationChanged&quot; running for instance &quot;RMS.MYDOMAIN.COM&quot; with id:&quot;{04F4ADED-2C7F-92EF-D620-9AF9685F736F}&quot; in management group &quot;SCOMPROD&quot; </p>
<p>Or, worst case, if it still does not fit, we can still go and search for it in the actual, usual eventlog application… but at least we will have spotted it!</p>
<p>&#160;</p>
<p>The above wants to give you an idea of what is easily accomplished with some simple one-liners, and how it can be a useful aid in analyzing/digging into Eventlogs.</p>
<p>All of the above is ALSO be possible with Logparser, and it would actually be even less heavy on memory usage and it will be quicker, to be honest! </p>
<p>I just like Powershell syntax a lot more, and its ubiquity, which makes it a better option for me. Your mileage may vary, of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2009/12/16/opsmgr-eventlog-analysis-with-powershell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Invoking Methods on the Xplat agent with WINRM</title>
		<link>http://www.muscetta.com/2009/10/26/invoking-methods-on-the-xplat-agent-with-winrm/</link>
		<comments>http://www.muscetta.com/2009/10/26/invoking-methods-on-the-xplat-agent-with-winrm/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 22:32:43 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Cross Platform]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[xplat]]></category>
		<category><![CDATA[invoke]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[winrm]]></category>
		<category><![CDATA[ws-man]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=488</guid>
		<description><![CDATA[So I was testing other stuff tonight, to be honest, but I got pinged on Instant Messenger by my geek friend and colleague Stefan Stranger who pointed me at his request for help here http://friendfeed.com/sstranger/4571f39b/help-needed-on-winrs-or-winrm-and-openwsman-to
He wanted to use WINRM or any other command line utility to interact with the Xplat agent, and call methods on [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>So I was testing other stuff tonight, to be honest, but I got pinged on Instant Messenger by my geek friend and colleague <a href="http://blogs.technet.com/stefan_stranger/">Stefan Stranger</a> who pointed me at his request for help here <a title="http://friendfeed.com/sstranger/4571f39b/help-needed-on-winrs-or-winrm-and-openwsman-to" href="http://friendfeed.com/sstranger/4571f39b/help-needed-on-winrs-or-winrm-and-openwsman-to">http://friendfeed.com/sstranger/4571f39b/help-needed-on-winrs-or-winrm-and-openwsman-to</a></p>
<p>He wanted to use WINRM or any other command line utility to interact with the Xplat agent, and call methods on the Unix machine from windows. This could be very useful to – for example – restart a service (in fact it is what the RECOVERY actions in the Xplat Management Packs do, btw).</p>
<p>At first I told him I had only tested enumerations – such as on this other post <a title="http://www.muscetta.com/2009/06/01/using-the-scx-agent-with-wsman-from-powershell-v2/" href="http://www.muscetta.com/2009/06/01/using-the-scx-agent-with-wsman-from-powershell-v2/">http://www.muscetta.com/2009/06/01/using-the-scx-agent-with-wsman-from-powershell-v2/</a> … but the question intrigued me, so I check out the help for winrm’s INVOKE verb:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://www.muscetta.com/wp-content/uploads/clip_image0021.jpg" width="650" height="472" /></p>
<p>Which told me that you can pass in the parameters for the method to be called/invoked either as an hashtable @{KEY=”value”;KEY2=”value”}, or as an input XML file. I first tried the XML file but I could not get its format right.</p>
<p>After a few more minutes of trying, I figured out the right syntax.</p>
<p>This one works, for example:</p>
<p><strong>winrm invoke ExecuteCommand http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem?__cimnamespace=root/scx @{command=&quot;ps&quot;;timeout=&quot;60&quot;} -username:root -password:password -auth:basic -r:https://virtubuntu.huis.dom:1270/wsman -skipCACheck -encoding:UTF-8</strong></p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://www.muscetta.com/wp-content/uploads/clip_image0041.jpg" width="634" height="662" /></p>
<p>Happy remote management of your unix systems from Windows <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2009/10/26/invoking-methods-on-the-xplat-agent-with-winrm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The mistery of the lost registry values</title>
		<link>http://www.muscetta.com/2009/09/10/mistery-of-lost-registry-values/</link>
		<comments>http://www.muscetta.com/2009/09/10/mistery-of-lost-registry-values/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 14:53:44 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[32bit]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Monad]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[StdRegProvider]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[Wbem]]></category>
		<category><![CDATA[WMI]]></category>
		<category><![CDATA[Wow]]></category>
		<category><![CDATA[Wow32]]></category>
		<category><![CDATA[Wow64]]></category>
		<category><![CDATA[Wow6432Node]]></category>
		<category><![CDATA[wrapper]]></category>
		<category><![CDATA[x64]]></category>
		<category><![CDATA[x86]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=481</guid>
		<description><![CDATA[During the OpsMgr Health Check engagement we use custom code to assess the customer’s Management group, as I wrote here already. Given that the customer tells us which machine is the RMS, one of the very first things that we do in our tool is to connect to the RMS’s registry, and check the values [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>During the OpsMgr Health Check engagement we use custom code to assess the customer’s Management group, <a href="http://www.muscetta.com/2008/12/30/early-adoptions-health-checks-and-new-year-rants/">as I wrote here already</a>. Given that the customer tells us which machine is the RMS, one of the very first things that we do in our tool is to connect to the RMS’s registry, and check the values under <strong>HKLM\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup </strong>to see which machine holds the database. It is a rather critical piece of information for us, as we run a number of queries afterward… so we need to know where the db is, obviously <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I learned from here <a title="http://mybsinfo.blogspot.com/2007/01/powershell-remote-registry-and-you-part.html" href="http://mybsinfo.blogspot.com/2007/01/powershell-remote-registry-and-you-part.html">http://mybsinfo.blogspot.com/2007/01/powershell-remote-registry-and-you-part.html</a> how to access registry remotely thru powershell, by using .Net classes. This is also one of the methods illustrated in this other article on Technet Script Center <a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/jan09/hey0105.mspx">http://www.microsoft.com/technet/scriptcenter/resources/qanda/jan09/hey0105.mspx</a> </p>
<p>Therefore the “core” instructions of the function I was using to access the registry looked like the following</p>
<p><!-- Code --></p>
<div class="dp-highlighter">
<ol class="dp-rb">
<li class="alt"><span><span>Function GetValueFromRegistry ([string]</span><span class="variable">$computername</span><span>, </span><span class="variable">$regkey</span><span>, </span><span class="variable">$value</span><span>)    </span></span></li>
<li><span>{   </span></li>
<li><span>     </span><span class="variable">$reg</span><span> = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(</span><span class="string">&#039;LocalMachine&#039;</span><span>, </span><span class="variable">$computername</span><span>)   </span></li>
<li><span>     </span><span class="variable">$regKey</span><span>= </span><span class="variable">$reg</span><span>.OpenSubKey(</span><span class="string">&#034;$regKey&#034;</span><span>)   </span></li>
<li><span>     </span><span class="variable">$result</span><span> = </span><span class="variable">$regkey</span><span>.GetValue(</span><span class="string">&#034;$value&#034;</span><span>)   </span></li>
<li><span>     </span><span class="keyword">return</span><span> </span><span class="variable">$result</span><span>  </span></li>
<li><span>}   </span></li>
</ol>
</div>
<p><span> </span></p>
<p>[Note: the actual function is bigger, and contains error handling, and logging, and a number of other things that are unnecessary here]</p>
<p>Therefore, the function was called as follows:<br />
<strong>GetValueFromRegistry $RMS &#034;SOFTWARE\\Microsoft\\Microsoft Operations Manager\\3.0\\Setup&#034; &#034;DatabaseServerName&#034;</strong><br />
Now so far so good.</p>
<p>In theory.</p>
<p> </p>
<p>Now for some reason that I could not immediately explain, we had noticed that this piece of code performing registry accessm while working most of the times, only on SOME occasions was giving errors about not being able to open the registry value…</p>
<p><a href="http://www.muscetta.com/wp-content/uploads/image45.png" rel="lightbox[481]"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image_thumb.png" border="0" alt="image" width="518" height="69" /></a></p>
<p>When you are onsite with a customer conducting an assessment, the PFE engineer does not always has the time to troubleshoot the error… as time is critical, we have usually resorted to just running the assessment from ANOTHER machine, and this “solved” the issue… but always left me wondering WHY this was giving an error. I had suspected an issue with permissions first, but it could not be as the permissions were obviously right: performing the assessment from another machine but with the same user was working!</p>
<p>A few days ago <a href="http://blogs.technet.com/stefan_stranger/">my colleague and buddy Stefan Stranger</a> figured out that this was related to the platform architecture:</p>
<ul>
<li>X64 client to x64 RMS was working</li>
<li>X64 client to x86 RMS was working</li>
<li>X86 client to x86 RMS was working</li>
<li><strong>X86 client to x64 RMS was NOT working</strong></li>
</ul>
<p>You don’t need to use our custom code to reproduce this, REGEDIT shows the behavior as well.</p>
<p>If, from a 64-bit server, you open a remote registry connection to 64-bit RMS server, you can see all OpsMgr registry keys:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" src="http://www.muscetta.com/wp-content/uploads/clip_image002.jpg" border="0" alt="clip_image002" width="918" height="268" /></p>
<p>If, anyhow, from a 32-bit server, you open a remote registry connection to 64-bit RMS server, you don’t see ALL – but only SOME &#8211; OpsMgr registry keys:<br />
<img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" src="http://www.muscetta.com/wp-content/uploads/clip_image004.jpg" border="0" alt="clip_image004" width="863" height="192" /></p>
<p>So here’s the reason! This is what was happening! How could I not think of this before? It was nothing related to permissions, but to <a href="http://msdn.microsoft.com/en-us/library/aa384232(VS.85).aspx">registry redirection</a>! The issue was happening because the 32 bit machine is using the 32bit registry editor and what it will do when accessing a 64bit machine will be to default to the Wow6432Node location in the registry. There all OpsMgr data won’t be in the WOW64 location on a 64bit machine, only some.</p>
<p>So, just like regedit, the 32bit powershell and the 32bit .Net framework were being redirected to the 32bit-compatibility registry keys… not finding the stuff we needed, whereas a 64bit application could find that. Any 32bit application by default gets redirected to a 32bit-safe registry.</p>
<p>So, after finally UNDERSTANDING what the issue was, I started wondering: ok&#8230; but<strong> how can I access the REAL “HLKM\SOFTWARE\Microsoft” key on a 64bit machine when running this FROM a 32bit machine – WITHOUT being redirected to “HKLM\SOFTWARE\Wow6432Node\Microsoft” ? </strong>What if my application CAN deal just fine with those values and actually NEEDs to access them?</p>
<p>The answer wasn’t as easy as the question. I did a bit of digging on this, and still I have NOT yet found a way to do this with the .Net classes. It seems that in a lot of situations, Powershell or even .Net classes are nice and sweet wrappers on the underlying Windows APIs… but for how sweet and easy they are, they are very often not very complete wrappers – letting you do just about enough for most situations, but not quite everything you would or could with the APi underneath. But I digress, here&#8230;</p>
<p>The good news is that I did manage to get this working, but I had to resort to using dear old WMI StdRegProvider… There are a number of locations on the Internet mentioning the issue of accessing 32bit registry from 64bit machines or vice versa, but all examples I have found were using VBScript. But I needed it in Powershell. Therefore I started with the <a href="http://msdn.microsoft.com/en-us/library/aa393067(VS.85).aspx">VBScript example code that is present here</a>, and I ported it to Powershell.</p>
<p>Handling the WMI COM object from Powershell was slightly less intuitive than in VBScript, and it took me a couple of hours to figure out how to change some stuff, especially this bit that sets the parameters collection:</p>
<blockquote><p>Set Inparams = objStdRegProv.Methods_(&#034;GetStringValue&#034;).Inparameters</p>
<p>Inparams.Hdefkey = HKLM</p>
<p>Inparams.Ssubkeyname = RegKey</p>
<p>Inparams.Svaluename = RegValue</p>
<p>Set Outparams = objStdRegProv.ExecMethod_(&#034;GetStringValue&#034;, Inparams,,objCtx)</p></blockquote>
<p>INTO this:</p>
<blockquote><p>$Inparams = ($objStdRegProv.Methods_ | where {$_.name -eq &#034;GetStringValue&#034;}).InParameters.SpawnInstance_()</p>
<p>($Inparams.Properties_ | where {$_.name -eq &#034;Hdefkey&#034;}).Value = $HKLM</p>
<p>($Inparams.Properties_ | where {$_.name -eq &#034;Ssubkeyname&#034;}).Value = $regkey</p>
<p>($Inparams.Properties_ | where {$_.name -eq &#034;Svaluename&#034;}).Value = $value</p>
<p>$Outparams = $objStdRegProv.ExecMethod_(&#034;GetStringValue&#034;, $Inparams, &#034;&#034;, $objNamedValueSet)</p></blockquote>
<p> </p>
<p>I have only done limited testing at this point and, even if the actual work now requires nearly <strong>15</strong> lines of code to be performed vs. the previous <strong>3 </strong>lines in the .Net implementation, it at least seems to work just fine.</p>
<p>What follows is the complete code of my replacement function, in all its <span style="text-decoration: line-through;">uglyness</span> glory:</p>
<p> </p>
<p><!-- Code --></p>
<div class="dp-highlighter">
<ol class="dp-rb">
<li class="alt"><span>Function GetValueFromRegistryThruWMI([string]</span><span class="variable">$computername</span><span>, </span><span class="variable">$regkey</span><span>, </span><span class="variable">$value</span><span>)   </span></li>
<li><span>{   </span></li>
<li><span>    </span><span class="comment">#constant for the HLKM </span><span>  </span></li>
<li><span>    </span><span class="variable">$HKLM</span><span> = </span><span class="string">&#034;&amp;h80000002&#034;</span><span>  </span></li>
<li><span> </span></li>
<li><span>    #creates an SwbemNamedValueSet object</span></li>
<li><span>    </span><span class="variable">$objNamedValueSet</span><span> = </span><span class="builtin">New-Object</span><span> -COM </span><span class="string">&#034;WbemScripting.SWbemNamedValueSet&#034;</span><span>  </span></li>
<li><span> </span></li>
<li><span>    #adds the actual value that will requests the target to provide 64bit-registry info</span></li>
<li><span>    </span><span class="variable">$objNamedValueSet</span><span>.Add(</span><span class="string">&#034;__ProviderArchitecture&#034;</span><span>, 64) | </span><span class="builtin">Out-Null</span><span>  </span></li>
<li> </li>
<li><span>    #back to all the other usual COM objects for WMI that you have used a zillion times in VBScript</span></li>
<li><span>    </span><span class="variable">$objLocator</span><span> = </span><span class="builtin">New-Object</span><span> -COM </span><span class="string">&#034;Wbemscripting.SWbemLocator&#034;</span><span>  </span></li>
<li><span>    </span><span class="variable">$objServices</span><span> = </span><span class="variable">$objLocator</span><span>.ConnectServer(</span><span class="variable">$computername</span><span>,</span><span class="string">&#034;root\default&#034;</span><span>,</span><span class="string">&#034;&#034;</span><span>,</span><span class="string">&#034;&#034;</span><span>,</span><span class="string">&#034;&#034;</span><span>,</span><span class="string">&#034;&#034;</span><span>,</span><span class="string">&#034;&#034;</span><span>,</span><span class="variable">$objNamedValueSet</span><span>)   </span></li>
<li><span>    </span><span class="variable">$objStdRegProv</span><span> = </span><span class="variable">$objServices</span><span>.Get(</span><span class="string">&#034;StdRegProv&#034;</span><span>)   </span></li>
<li><span>  </span></li>
<li class="alt"><span>    </span><span class="comment"># Obtain an InParameters object specific to the method. </span><span>  </span></li>
<li><span>    </span><span class="variable">$Inparams</span><span> = (</span><span class="variable">$objStdRegProv</span><span>.Methods_ | </span><span class="keyword">where</span><span> {</span><span class="variable">$_</span><span>.name -eq </span><span class="string">&#034;GetStringValue&#034;</span><span>}).InParameters.SpawnInstance_()   </span></li>
<li><span>  </span></li>
<li class="alt"><span>    </span><span class="comment"># Add the input parameters </span><span>  </span></li>
<li><span>    (</span><span class="variable">$Inparams</span><span>.Properties_ | </span><span class="keyword">where</span><span> {</span><span class="variable">$_</span><span>.name -eq </span><span class="string">&#034;Hdefkey&#034;</span><span>}).Value = </span><span class="variable">$HKLM</span><span>  </span></li>
<li><span>    (</span><span class="variable">$Inparams</span><span>.Properties_ | </span><span class="keyword">where</span><span> {</span><span class="variable">$_</span><span>.name -eq </span><span class="string">&#034;Ssubkeyname&#034;</span><span>}).Value = </span><span class="variable">$regkey</span><span>  </span></li>
<li><span>    (</span><span class="variable">$Inparams</span><span>.Properties_ | </span><span class="keyword">where</span><span> {</span><span class="variable">$_</span><span>.name -eq </span><span class="string">&#034;Svaluename&#034;</span><span>}).Value = </span><span class="variable">$value</span><span>  </span></li>
<li><span>  </span></li>
<li class="alt"><span>    </span><span class="comment">#Execute the method </span><span>  </span></li>
<li><span>    </span><span class="variable">$Outparams</span><span> = </span><span class="variable">$objStdRegProv</span><span>.ExecMethod_(</span><span class="string">&#034;GetStringValue&#034;</span><span>, </span><span class="variable">$Inparams</span><span>, </span><span class="string">&#034;&#034;</span><span>, </span><span class="variable">$objNamedValueSet</span><span>)   </span></li>
<li><span>  </span></li>
<li class="alt"><span>    </span><span class="comment">#shows the return value </span><span>  </span></li>
<li><span>    (</span><span class="variable">$Outparams</span><span>.Properties_ | </span><span class="keyword">where</span><span> {</span><span class="variable">$_</span><span>.name -eq </span><span class="string">&#034;ReturnValue&#034;</span><span>}).Value   </span></li>
<li><span>  </span></li>
<li class="alt"><span>    </span><span class="keyword">if</span><span> ((</span><span class="variable">$Outparams</span><span>.Properties_ | </span><span class="keyword">where</span><span> {</span><span class="variable">$_</span><span>.name -eq </span><span class="string">&#034;ReturnValue&#034;</span><span>}).Value -eq 0)   </span></li>
<li><span>    {   </span></li>
<li><span>       write-host </span><span class="string">&#034;it worked&#034;</span><span>  </span></li>
<li><span>       </span><span class="variable">$result</span><span> = (</span><span class="variable">$Outparams</span><span>.Properties_ | </span><span class="keyword">where</span><span> {</span><span class="variable">$_</span><span>.name -eq </span><span class="string">&#034;sValue&#034;</span><span>}).Value   </span></li>
<li><span>       write-host </span><span class="string">&#034;Result: $result&#034;</span><span>  </span></li>
<li><span>       </span><span class="keyword">return</span><span> </span><span class="variable">$result</span><span>  </span></li>
<li><span>    }   </span></li>
<li><span>    </span><span class="keyword">else</span><span>  </span></li>
<li><span>    {   </span></li>
<li><span>        write-host </span><span class="string">&#034;nope&#034;</span><span>  </span></li>
<li><span>    }   </span></li>
<li><span>}   </span></li>
</ol>
</div>
<p><span> </span></p>
<p><span>which can be called similarly to the previous one: </span><br />
<strong><span>GetValueFromRegistryThruWMI </span><span class="variable">$RMS</span><span> </span><span class="string">&#034;SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup&#034;</span><span> </span><span class="string">&#034;DatabaseServerName&#034;</span></strong></p>
<p>[Note: you don’t need the double\escape backslashes here, compared to the .Net implementation]</p>
<p>Enjoy your cross-architecture registry access: from 32bit to 64bit &#8211; and back!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2009/09/10/mistery-of-lost-registry-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCX Evolutions</title>
		<link>http://www.muscetta.com/2009/07/19/scx-evolutions/</link>
		<comments>http://www.muscetta.com/2009/07/19/scx-evolutions/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 10:31:53 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Cross Platform]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[xplat]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Interop]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[management pack]]></category>
		<category><![CDATA[openpegasus]]></category>
		<category><![CDATA[R2]]></category>
		<category><![CDATA[scom]]></category>
		<category><![CDATA[scx]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=475</guid>
		<description><![CDATA[During the beta of the Cross-Platform extensions and of System Center Operations Manager 2007 R2, the product team had promised to eventually release the SCX Providers&#039;source code.
Now that this promise has been mantained, and the SCX providers have been released on Codeplex at http://xplatproviders.codeplex.com/ it should be finally possible to entirely build your own unsupported [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>During the beta of the Cross-Platform extensions and of System Center Operations Manager 2007 R2, <a href="http://blogs.msdn.com/scxplat/archive/2008/08/11/opsmgr-2007-cross-platform-extensions-beta-refresh.aspx">the product team had promised to eventually release the SCX Providers&#039;source code</a>.</p>
<p>Now that <a href="http://blogs.msdn.com/cellfish/archive/2009/07/09/system-center-opsmgr-x-plat-providers-source-code-available.aspx">this promise has been mantained</a>, and the SCX providers have been released on Codeplex at <a href="http://xplatproviders.codeplex.com/">http://xplatproviders.codeplex.com/</a> it should be finally possible to entirely build your own unsupported agent package, starting from source code, without having to <a href="http://www.muscetta.com/2009/05/30/installing-the-opsmgr-2007-r2-scx-agent-on-ubuntu/">modify the original package as I have shown earlier on this blog</a>.<br />
Of course this will still be unsupported by Microsoft Product support, but will eventually work just fine!<br />
This is an extraordinary event in my opinion, as it is not a common event that Microsoft releases code as open source, especially when this is part of one of the product it sells. I suspect we will see more of this as we going forward.</p>
<p>Also, at R2 release time, <a href="http://technet.microsoft.com/en-us/library/dd919155.aspx">some official documentation about buildilng Cross-Plaform Management Packs has been published on Technet</a>.</p>
<p>Anyway, I have in the past posted a number of posts on my blog under this tag <a href="http://www.muscetta.com/tag/xplat/">http://www.muscetta.com/tag/xplat/</a> (I will continue to use that tag going forward) which show/describe how I hacked/modified both the existing MPs AND the SCX agent package to let it run on unsupported distributions (and I think they are still useful as they show a number of techniques about how to test, understand and troubleshoot the Xplat agent a bit. In fact, I have first learned how to understand and <a href="http://www.muscetta.com/2008/11/23/centos-discovery-in-opsmgr2007-r2-beta/">modify the RedHat MPs to monitor CentOS</a> and eventually even <a href="http://www.muscetta.com/2009/05/30/installing-the-opsmgr-2007-r2-scx-agent-on-ubuntu/">modified the RPM package to run on Ubuntu</a> (which also works on <a href="http://www.debian.org/releases/lenny/">Debian 5/Lenny</a>), eventually, as you can see because I am now using it to monitor &#8211; from home, across the Internet &#8211; the machine running this blog:</p>
<p><a title="www.muscetta.com Performance in OpsMgr by Daniele Muscetta, on Flickr" href="http://www.flickr.com/photos/dani3l3/3734028273/"><img src="http://farm4.static.flickr.com/3142/3734028273_5a0016c352.jpg" alt="www.muscetta.com Performance in OpsMgr" width="500" height="201" /></a></p>
<p>Or even, with or without OpsMgr 2007 R2, <a href="http://www.muscetta.com/2009/06/01/using-the-scx-agent-with-wsman-from-powershell-v2/">you could write your own scripts to interact with those providers, by using your favourite Scripting Language</a>.</p>
<p>After all, those experimentations with Xplat got me a fame of being a &#034;Unix expert at Microsoft&#034; (this expression still makes me laugh), <a href="http://twitter.com/dani3l3/status/1972980193">as I was tweeting here</a>:<br />
<a title="Unix expert at Microsoft by Daniele Muscetta, on Twitter" href="http://twitter.com/dani3l3/status/1972980193"><img src="http://farm4.static.flickr.com/3496/3734827286_076702367c.jpg" alt="Unix expert at Microsoft" width="500" height="381" /></a></p>
<p>But really, I have never hidden my interest for interoperability and <a href="http://old.honeynet.org/scans/scan29/sol/dmuscetta/index.html">the fact that I have been using Linux quite a bit in the past</a>, and still do.</p>
<p>Also, one more related information is that the fine people at Xandros have released their <a href="http://www.bridgeways.ca/products.php">Bridgeways Management Packs</a> and at the same time also started their own blog at <a href="http://blog.xplatxperts.com/">http://blog.xplatxperts.com/</a> where they discuss some troubleshooting techniques for the Xplat agent, <a href="http://www.muscetta.com/2009/03/27/cross-platform-in-opsmgr-2007-r2-release-candidate/">both similar to what I have been writing about here and also</a> &#8211; of course &#8211; <a href="http://blog.xplatxperts.com/xplat-xperts/2009/07/validating-and-troubleshooting-unixlinux-providers.html">specific to their own providers, that are in their XSM namespace</a>.</p>
<p><strong>Disclaimer</strong></p>
<p>The information in this weblog is provided &#034;AS IS&#034; with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my own personal opinion. All code samples are provided &#034;AS IS&#034; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.<br />
THIS WORK IS NOT ENDORSED AND NOT EVEN CHECKED, AUTHORIZED, SCRUTINIZED NOR APPROVED BY MY EMPLOYER, AND IT ONLY REPRESENT SOMETHING WHICH I&#039;VE DONE IN MY FREE TIME. NO GUARANTEE WHATSOEVER IS GIVEN ON THIS. THE AUTHOR SHALL NOT BE MADE RESPONSIBLE FOR ANY DAMAGE YOU MIGHT INCUR WHEN USING THIS INFORMATION. The solution presented here IS NOT SUPPORTED by Microsoft.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2009/07/19/scx-evolutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the SCX Agent with WSMan from Powershell v2</title>
		<link>http://www.muscetta.com/2009/06/01/using-the-scx-agent-with-wsman-from-powershell-v2/</link>
		<comments>http://www.muscetta.com/2009/06/01/using-the-scx-agent-with-wsman-from-powershell-v2/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 17:47:08 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Cross Platform]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MOM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[xplat]]></category>
		<category><![CDATA[Get-WSManInstance]]></category>
		<category><![CDATA[Interop]]></category>
		<category><![CDATA[scx]]></category>
		<category><![CDATA[Test-WSMan]]></category>
		<category><![CDATA[ws-man]]></category>
		<category><![CDATA[wsman]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=473</guid>
		<description><![CDATA[So Powershell v2 adds a nice bunch of Ws-Man related cmdlets. Let’s see how we can use them to interact with OpenPegasus’s WSMan on a SCX Agent.
PS C:\maint&#62; test-wsman -computer virtubuntu.huis.dom -port 1270 -authentication basic -credential (get-credential) -usessl
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential

But we do get this error:
Test-WSMan : [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>So Powershell v2 adds <a href="http://blogs.msdn.com/wmi/archive/2009/03/26/wsman-enhancements-in-powershell-2-0.aspx" target="_blank">a nice bunch of Ws-Man related cmdlets</a>. Let’s see how we can use them to interact with OpenPegasus’s WSMan on a SCX Agent.</p>
<p>PS C:\maint&gt; <strong>test-wsman -computer virtubuntu.huis.dom -port 1270 -authentication basic -credential (get-credential) -usessl</strong></p>
<p>cmdlet Get-Credential at command pipeline position 1<br />
Supply values for the following parameters:<br />
Credential</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb22.png" border="0" alt="image" width="323" height="252" /></p>
<p>But we do get this error:</p>
<p><span style="color: #ff0000;">Test-WSMan : The server certificate on the destination computer (virtubuntu.huis.dom:1270) has the following errors:<br />
The SSL certificate could not be checked for revocation. The server used to check for revocation might be unreachable.</span></p>
<p><span style="color: #ff0000;">The SSL certificate is signed by an unknown certificate authority.<br />
At line:1 char:11<br />
+ test-wsman &lt;&lt;&lt;&lt;  -computer virtubuntu.huis.dom -port 1270 -authentication basic -credential (get-credential) -usessl<br />
+ CategoryInfo          : InvalidOperation: (:) [Test-WSMan], InvalidOperationException<br />
+ FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand</span></p>
<p>The credentials above have to be a unix login. Which we typed correctly. But we still can&#039;t get thru, as the certificate used by the agent is not trusted by our workstation. This seems to be the “usual” issue I first faced when testing SCX with WINRM in beta1. <a href="http://www.muscetta.com/2008/05/04/testing-system-center-cross-plaform-extentions/">At the time I simply dismissed it with the following sentence</a></p>
<blockquote><p>[…] Of course you have to solve some other things such as DNS resolution AND trusting the self-issued certificates that the agent uses, first. Once you have done that, you can run test queries from the Windows box towards the Unix ones by using WinRM. […]</p></blockquote>
<p>and I sincerely thought that it would explain pretty well… but eventually a lot of people got confused by this and did not know what to do, especially for the part that goes about trusting the certificate.  Anyway, <a href="http://www.muscetta.com/2009/03/27/cross-platform-in-opsmgr-2007-r2-release-candidate/">in the following posts I figured out you could pass the –skipCACheck parameter to WINRM</a>… which solved the issue with having to trust the certificate (which is fine for testing, but I would not use that for automations and scripts running in production… as it might expose your credentials to man-in-the-middle attacks).</p>
<p>So it seems that with the Powershell cmdlets we are back to that issue, as I can’t find a parameter to skip the CA check. Maybe it is there, but with PSv2 not having been released yet, I don&#039;t know everything about it, and the CTP documentation is not yet complete. Therefore, back to trusting the certificate.</p>
<p>Trusting the certificate is actually very simple, but it can be a bit tricky when passing those certs back and forth from unix to windows. So let&#039;s make the process a bit clearer.</p>
<p>All of the SCX-agents certificates are ultimately signed by a key on the Management server that has discovered them, but I don&#039;t currently know where that certificate/key is stored on the management server. Anyway, you can get it from the agent certificate &#8211; as you only really need the public key, not the private signing key.</p>
<p>Use WinSCP or any other utility to copy the certificate off one of the agents.<br />
You can find that in the <strong>/etc/opt/microsoft/scx/ssl</strong> location:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb23.png" border="0" alt="image" width="772" height="219" /></p>
<p>that <strong>scx-host-computername.pem</strong> is your agent certificate.</p>
<p>Copy it to the Management server and change its extension from <strong>.pem</strong> to <strong>.cer</strong>. Now Windows will be happy to show it to you with the usual Certificate interface:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb24.png" border="0" alt="image" width="404" height="472" /></p>
<p>We need to go to the “Certification Path” tab, select the ISSUER certificate (the one called “SCX-Certificate”):</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb25.png" border="0" alt="image" width="813" height="476" /></p>
<p>then go to the “Details” tab, and use the “Copy to File” button to export the certificate.</p>
<p>After you have the certificate in a .CER file, you can add it to the “trusted root certification authorities” store on the computer you are running your powershell tests from.</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb26.png" border="0" alt="image" width="792" height="374" /></p>
<p>So after you have trusted it, the same command as above actually works now:</p>
<p>PS C:\maint&gt; <strong>test-wsman -computer virtubuntu.huis.dom -port 1270 -authentication basic -credential (get-credential) -usessl</strong></p>
<p>cmdlet Get-Credential at command pipeline position 1<br />
Supply values for the following parameters:<br />
Credential</p>
<p>wsmid           : http://schemas.dmtf.org/wbem/wsman/identify/1/wsmanidentity.xsd<br />
lang            :<br />
ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd<br />
ProductVendor   : Microsoft System Center Cross Platform<br />
ProductVersion  : 1.0.4-248</p>
<p>Ok, we can talk to it! Now we can do something funnier, like actually returning instances and/or calling methods:</p>
<p>PS C:\maint&gt; <strong>Get-WSManInstance -computer virtubuntu.huis.dom -authentication basic -credential (get-credential) -port 1270 -usessl -enumerate http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem?__cimnamespace=root/scx</strong></p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb27.png" border="0" alt="image" width="836" height="697" /></p>
<p>This is far from exhaustive, but should get you started on a world of possibilities about automating diagnostics and responses with Powershell v2 towards the OpsMgr 2007 R2 Cross-Platform machines. Enjoy!</p>
<p><strong>Disclaimer</strong></p>
<p>The information in this weblog is provided &#034;AS IS&#034; with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my own personal opinion. All code samples are provided &#034;AS IS&#034; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.<br />
THIS WORK IS NOT ENDORSED AND NOT EVEN CHECKED, AUTHORIZED, SCRUTINIZED NOR APPROVED BY MY EMPLOYER, AND IT ONLY REPRESENT SOMETHING WHICH I&#039;VE DONE IN MY FREE TIME. NO GUARANTEE WHATSOEVER IS GIVEN ON THIS. THE AUTHOR SHALL NOT BE MADE RESPONSIBLE FOR ANY DAMAGE YOU MIGHT INCUR WHEN USING THIS INFORMATION. The solution presented here IS NOT SUPPORTED by Microsoft.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2009/06/01/using-the-scx-agent-with-wsman-from-powershell-v2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing the OpsMgr 2007 R2 SCX Agent on Ubuntu</title>
		<link>http://www.muscetta.com/2009/05/30/installing-the-opsmgr-2007-r2-scx-agent-on-ubuntu/</link>
		<comments>http://www.muscetta.com/2009/05/30/installing-the-opsmgr-2007-r2-scx-agent-on-ubuntu/#comments</comments>
		<pubDate>Sat, 30 May 2009 12:19:50 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Cross Platform]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MOM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[xplat]]></category>
		<category><![CDATA[cim]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[openpegasus]]></category>
		<category><![CDATA[R2]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[scom]]></category>
		<category><![CDATA[scx]]></category>
		<category><![CDATA[scxcimcli]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[wsman]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=458</guid>
		<description><![CDATA[You know since the beta1 of Xplat I have been busy with modifying the Redhat management pack and monitor CentOS with OpsMgr. Now, CentOS is a distribution that is pretty similar to RedHat, so the RPM package just runs, and it is only a matter of hacking a modified MP.
I never went really further in [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>You know <a href="http://www.muscetta.com/2008/05/04/testing-system-center-cross-plaform-extentions/" target="_blank">since the beta1 of Xplat I have been busy with modifying the Redhat management pack and monitor CentOS with OpsMgr</a>. Now, CentOS is a distribution that is pretty similar to RedHat, so the RPM package just runs, and <a href="http://www.muscetta.com/2008/11/23/centos-discovery-in-opsmgr2007-r2-beta/" target="_blank">it is only a matter of hacking a modified MP</a>.</p>
<p>I never went really further in my experiments, mostly due to lack of time… but then yesterday I got a comment to this older post asking about Ubuntu. Of course I know about Ubuntu, and have been using Debian-based distributions for years. I actually even prefer them over RPM-based distributions such as RedHat or SuSE (personal preference). Heck, even this weblog is running on Debian!</p>
<p>Anyway, I never really tried to see if one of the existing RPM packages for RedHat or SuSE could be modified to run on Ubuntu. I will eventually test this on Debian too, but for now I used Ubuntu which tends to have slightly newer packages and libraries, overall. The machine I tested on is a Ubuntu Server 8.04.2. Older/newer versions might slightly differ.</p>
<p>BEWARE THAT ALL THAT FOLLOWS BELOW IS <strong>NOT</strong> SUPPORTED BY MICROSOFT. It is only described here for EXPERIMENTAL (==fun) purpose. DO NOT USE THIS IN A PRODUCTION ENVIRONMENT.</p>
<p>So, you are warned. Now let’s hack it.</p>
<p>The first thing to do is to copy the Redhat agent’s RPM package off your OpsMgr2007 R2 server in the “usual” path “<strong>C:Program FilesSystem Center Operations manager 2007AgentManagementUnixAgents</strong>”. Let’s grab the RHEL5 agent, which is called <strong>scx-1.0.4-248.rhel.5.x86.rpm</strong> in R2 RTM.</p>
<p>First we need to <a href="http://ubuntu.wordpress.com/2005/09/23/installing-using-an-rpm-file/" target="_blank">CONVERT the RPM package to the DEB package format used by Ubuntu, by using the ALIEN package</a>:</p>
<blockquote><p>sudo apt-get update<br />
sudo apt-get install alien<br />
sudo bash<br />
alien -k scx-1.0.4-248.rhel.5.x86.rpm &#8211;scripts<br />
dpkg -i scx_1.0.4-248_i386.deb</p></blockquote>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb15.png" border="0" alt="image" width="628" height="253" /></p>
<p>The converted package will install… but the script execution will fail in a few places – most notably in the generation of the certificate, as it is not able to locate the right openssl libraries, as shown in the screenshot above.</p>
<p>If the libssl.so.6 file cannot be found, you might be missing the “libssl-dev” package, which you can install as follows:</p>
<blockquote><p>apt-get install libssl-dev</p></blockquote>
<p>But even if it is installed, you will find that the files are still missing. This is not really true: actually, the files are there, but on Ubuntu they have a different name than on RedHat, that’s all. You can therefore create hardlinks to the “right” files, so that they are aliased and get found afterwards:</p>
<blockquote><p>cd /usr/lib<br />
ln -s libcrypto.so.0.9.8 libcrypto.so.6<br />
ln -s libssl.so.0.9.8 libssl.so.6</p></blockquote>
<p>So now when installing the package, the certificate generation will work:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb16.png" border="0" alt="image" width="629" height="266" /></p>
<p>You are nearly ready to go. You have to start the service by using the init scripts – the “service” command is RedHat-specific, that will still fail.</p>
<p><strong>/etc/init.d/scx-cimd start</strong> is the “standard” way of starting daemons from init on Unix.</p>
<p>But it still fails, as it seems that the init script provided in the RedHat package is really searching for a file called “functions” which is present on RedHat and on CentOS, which provides re-usable functions for startup scripts to include:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb17.png" border="0" alt="image" width="533" height="78" /></p>
<p>How do you fix this? I just copied the <strong>/etc/init.d/functions</strong> file from a CentOS box to my Ubuntu box.</p>
<p>I copied it via SCP from the CentOS box I have:</p>
<blockquote><p>cd /etc/init.d</p>
<p>scp root@centos.huis.dom:/etc/init.d/functions .</p></blockquote>
<p>You can probably also find and fetch the file from the Internet (both CentOS and RedHat should have accessible repositories with all the files in their distributions, since it is open sourced).</p>
<p>After you have the file in place, the init script will be able to include it, will find the functions it needs, and the daemon/service will now start (even if with minor errors I have not investigated for now, but that don’t seem to be causing troubles):</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb18.png" border="0" alt="image" width="631" height="87" /></p>
<p>and here you can see it is finally running:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb19.png" border="0" alt="image" width="629" height="143" /></p>
<p>So let’s try to issue a few queries <a href="http://www.muscetta.com/2009/03/27/cross-platform-in-opsmgr-2007-r2-release-candidate/">as shown in a previous posts</a>:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb20.png" border="0" alt="image" width="627" height="630" /></p>
<p>IT WORKS!!!</p>
<p>But… there is a “but”: not all classes actually return instances and values just yet. Most notably the “<strong>SCX_OperatingSystem</strong>” class does not seem to return anything right awy. That is a very important class, because is the one we would use to first discover the Operating System object in the Management Packs. So we need to fix it. The reason why the class does not return anything, is that the SCX provider is looking into the <strong>/etc/redhat-release</strong> file to return what OS version/distribution the machine is running. And the file is obviously not there on Ubuntu.</p>
<p>On all Linuxes there is a similar file, called <strong>/etc/issue</strong>&#8230; which again, we can copy with the other name and trick the provider into working:</p>
<blockquote><p>cd /etc</p>
<p>cp issue redhat-release</p></blockquote>
<p>And NOW, the <strong>SCX_OperatingSystem</strong> Class also returns an instance:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image-thumb21.png" border="0" alt="image" width="635" height="407" /></p>
<p>The next step would be “cooking” an MP to discover Ubuntu. More on this on a later post (maybe). I did not test all classes and their implementation… you can try to poke at them by following <a href="http://www.muscetta.com/2009/03/27/cross-platform-in-opsmgr-2007-r2-release-candidate/">the instructions and commands on my previous post here</a>. But this should get you started.</p>
<p><strong>Disclaimer</strong></p>
<p>The information in this weblog is provided &#034;AS IS&#034; with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my own personal opinion. All code samples are provided &#034;AS IS&#034; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.<br />
THIS WORK IS NOT ENDORSED AND NOT EVEN CHECKED, AUTHORIZED, SCRUTINIZED NOR APPROVED BY MY EMPLOYER, AND IT ONLY REPRESENT SOMETHING WHICH I&#039;VE DONE IN MY FREE TIME. NO GUARANTEE WHATSOEVER IS GIVEN ON THIS. THE AUTHOR SHALL NOT BE MADE RESPONSIBLE FOR ANY DAMAGE YOU MIGHT INCUR WHEN USING THIS INFORMATION. The solution presented here IS NOT SUPPORTED by Microsoft.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2009/05/30/installing-the-opsmgr-2007-r2-scx-agent-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross Platform in OpsMgr 2007 R2 Release Candidate</title>
		<link>http://www.muscetta.com/2009/03/27/cross-platform-in-opsmgr-2007-r2-release-candidate/</link>
		<comments>http://www.muscetta.com/2009/03/27/cross-platform-in-opsmgr-2007-r2-release-candidate/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 21:55:46 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Cross Platform]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[xplat]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[cim]]></category>
		<category><![CDATA[openpegasus]]></category>
		<category><![CDATA[openwsman]]></category>
		<category><![CDATA[R2]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[scom]]></category>
		<category><![CDATA[scx]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=431</guid>
		<description><![CDATA[You have heard it all over the place, System Center Operations Manager 2007 R2 has reached the Release Candidate milestone and the RC bits have been made available on connect.microsoft.com.
As it is becoming a tradition for me with each new release, I want to take a look at the Unix Monitoring stuff like I did [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>You have heard it all over the place, <a href="http://blogs.technet.com/momteam/archive/2009/03/26/system-center-operations-manager-2007-r2-release-candidate-ready-for-download.aspx" target="_blank">System Center Operations Manager 2007 R2 has reached the Release Candidate milestone and the RC bits have been made available on connect.microsoft.com</a>.</p>
<p>As it is becoming a tradition for me with each new release, I want to take a look at the Unix Monitoring stuff like I did since <a href="http://www.muscetta.com/2008/05/04/testing-system-center-cross-plaform-extentions/" target="_blank">beta1 of Xplat</a>, passing thru <a href="http://www.muscetta.com/2008/11/23/centos-discovery-in-opsmgr2007-r2-beta/" target="_blank">beta2</a>. I am an integration freak and I have always insisted that interoperability is key. I will leave the most obvious “release notes” kind of things out of here, such as saying that there are now agents for the x64 version of linux distro’s, and so on…. you can read this stuff in the release notes already and in a zillion of other places.</p>
<p>Let’s instead look at my first impression ( = I am amazed: this product is really getting awesome) and let’s do a bit of digging, mostly to note what changed since my previous posts on Xplat (which, by the way, is the MOST visited post on this blog I ever published) – of course there is A LOT more that has changed under the hood… but those are code changes, improvements, polishing of the product itself… while that would be interesting from a code perspective, here I am more interested in what the final user (the System Administrator) will ultimately interact with directly, and what he might need to troubleshoot and understand how the pieces fit together to realize Unix Monitoring in OpsMgr.</p>
<p>After having hacked the RedHat MP to work on my CentOS box (as usual), I started to take a look at what is installed on the Linux box. Here are the new services:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ps -Af | grep scx" src="http://www.muscetta.com/wp-content/uploads/image21.png" border="0" alt="ps -Af | grep scx" width="993" height="89" /></p>
<p>You will notice the daemons have changed names and get launched with new parameters.</p>
<p>Of course when you see who uses port 1270 everything becomes clearer:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="netstat -anp | grep 1270" src="http://www.muscetta.com/wp-content/uploads/image22.png" border="0" alt="netstat -anp | grep 1270" width="862" height="75" /></p>
<p>Therefore I can place the two new names and understand that SCXCIMSERVER is the WSMAN implementation, while SCXCIMPROVAGT is the CIM/WBEM implementation.</p>
<p>There is one more difference at the “service” (or “daemon”) level: the fact that there is only ONE init script now: <strong>/etc/init.d/scx-cimd</strong></p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="/etc/init.d/scx-cimd" src="http://www.muscetta.com/wp-content/uploads/image23.png" border="0" alt="/etc/init.d/scx-cimd" width="434" height="70" /></p>
<p>So basically the SCX “Agent” will start and stop as a single thing, even if it is composed of multiple executables that will spawn various processes.</p>
<p>Another difference: if we look in “familiar” locations like <strong>/etc/opt/microsoft/scx/bin/tools/</strong> we see that a number of configuration files is either empty (0 bytes) or missing (<a href="http://contoso.se/blog/?p=276" target="_blank">like the one described on Ander’s blog to enable verbose logging of WSMan requests</a>), when compared to earlier versions:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="/etc/opt/microsoft/scx/conf" src="http://www.muscetta.com/wp-content/uploads/image24.png" border="0" alt="/etc/opt/microsoft/scx/conf" width="550" height="206" /></p>
<p>But that is because I have been told we now have a nice new tool called scxadmin under <strong>/opt/microsoft/scx/bin/tools/</strong> , which will let you configure those things:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="/opt/microsoft/scx/bin/tools/scxadmin" src="http://www.muscetta.com/wp-content/uploads/image25.png" border="0" alt="/opt/microsoft/scx/bin/tools/scxadmin" width="879" height="402" /></p>
<p>Therefore you would enable VERBOSE logging for all components by issuing the command</p>
<blockquote><p><strong>./scxadmin -log-set all verbose</strong></p></blockquote>
<p>and you will bring it back to a less noisy setting of logging only errors with</p>
<blockquote><p><strong>./scxadmin -log-set all errors</strong></p></blockquote>
<p>the logs will be written under <strong>/var/opt/microsoft/scx/log</strong> just like they did before.</p>
<p>Other than this, a lot of the troubleshooting techniques I showed <a href="http://www.muscetta.com/2008/11/23/centos-discovery-in-opsmgr2007-r2-beta/" target="_blank">in one of my previous posts</a>, like how to query CIM classes directly or thru WSMAN remotely by using winrm – they should really stay the same. I will mention them again here for reference.</p>
<p>SCXCIMCLI is a useful and simple tool used to query CIM directly. You can roughly compare it to <a href="http://technet.microsoft.com/en-us/library/cc180684.aspx" target="_blank">wbemtest.exe</a><strong></strong> in the WIndows world (other than not having a UI). This utility can also be found in <strong>/opt/microsoft/scx/bin/tools</strong></p>
<p>A couple of examples of the most common/useful things you would do with scxcimcli:</p>
<p>1) Enumerate all Classes whose name contains “SCX_” in the <strong>root/scx</strong> namespace (the classes our Management packs use):</p>
<blockquote><p><strong>./scxcimcli nc -n root/scx -di |grep SCX_ | sort</strong></p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="./scxcimcli nc -n root/scx -di |grep SCX | sort" src="http://www.muscetta.com/wp-content/uploads/image26.png" border="0" alt="./scxcimcli nc -n root/scx -di |grep SCX | sort" width="582" height="350" /></p></blockquote>
<p>2) Execute a Query</p>
<blockquote><p><strong>./scxcimcli xq &#034;select * from SCX_OperatingSystem&#034; -n root/scx</strong></p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="./scxcimcli xq &quot;select * from SCX_OperatingSystem&quot; -n root/scx" src="http://www.muscetta.com/wp-content/uploads/image27.png" border="0" alt="./scxcimcli xq &quot;select * from SCX_OperatingSystem&quot; -n root/scx" width="701" height="425" /></p></blockquote>
<p>Also another thing that you might want to test when troubleshooting discoveries, is running the same queries through WS-Man (possibly from the same Management Server that will or should be managing that unix box). I already showed this in the past, it is the following command:</p>
<p><strong>winrm enumerate </strong><strong><span style="color: #800000;">http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem?__cimnamespace=root/scx</span></strong><strong> -username:root -password:password -r:</strong><strong>https://linuxbox.mydomain.com:1270/wsman</strong><strong> -auth:basic –skipCACheck</strong></p>
<p>but if you launch it that way it will now return an error like the following (or at least it did in my test lab):</p>
<table border="1" cellspacing="0" cellpadding="2" width="761">
<tbody>
<tr>
<td width="759" valign="top">Fault<br />
Code<br />
Value = SOAP-ENV:Sender<br />
Subcode<br />
Value = wsman:EncodingLimit<br />
Reason<br />
Text = UTF-16 is not supported; Please use UTF-8<br />
Detail<br />
FaultDetail = <a href="http://schemas.dmtf.org/wbem/wsman/1/wsman/faultDetail/CharacterSet">http://schemas.dmtf.org/wbem/wsman/1/wsman/faultDetail/CharacterSet</a></p>
<p>Error number:  -2144108468 0&#215;8033804C<br />
The WS-Management service does not support the character set used in the request<br />
. Change the request to use UTF-8 or UTF-16.</td>
</tr>
</tbody>
</table>
<p>the error message is pretty self explanatory: you need to specify the UTF-8 Character set. You can do it by adding the “-encoding” qualifier:</p>
<p><strong>winrm enumerate </strong><strong>http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem?__cimnamespace=root/scx</strong><strong> -username:root -password:password -r:</strong><strong>https://linuxbox.mydomain.com:1270/wsman</strong><strong> -auth:basic –skipCACheck <span style="color: #ff0000;">–encoding:UTF-8</span></strong></p>
<p>Hope the above is useful to figure out the differences between the earlier beta releases of the System Center CrossPlatform extensions and the version built in OpsMgr 2007 R2 Release Candidate.</p>
<p>There are obviously a million of other things in R2 worth writing about (either related to the Unix monitoring or to everything else) and I am sure posts will start to appear on the many, more active, blogs out there (they have already started appearing, actually). I have not had time to dig further, but will likely do so AFTER Easter – as the next couple of weeks I will be travelling, working some of the time (but without my test environment and good connectivity) AND visiting relatives the rest of the time.</p>
<p>One last thing I noticed about the Unix/Cross Platform Management Packs in R2 Release Candidate… their current “release date” exposed by the <a href="http://www.muscetta.com/2008/11/29/programmatically-check-for-management-pack-updates-in-opsmgr-2007-r2/" target="_blank">MP Catalog Web Service</a> is the <strong>20th of March</strong>…</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://www.muscetta.com/wp-content/uploads/image28.png" border="0" alt="image" width="550" height="190" /></p>
<p>…which happens to be <a href="http://www.flickr.com/photos/dani3l3/3369447511/" target="_blank">my Birthday</a> &#8211; therefore they must be a present for me! <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>Disclaimer</strong></p>
<p>The information in this weblog is provided &#034;AS IS&#034; with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my own personal opinion. All code samples are provided &#034;AS IS&#034; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.<br />
THIS WORK IS NOT ENDORSED AND NOT EVEN CHECKED, AUTHORIZED, SCRUTINIZED NOR APPROVED BY MY EMPLOYER, AND IT ONLY REPRESENT SOMETHING WHICH I&#039;VE DONE IN MY FREE TIME. NO GUARANTEE WHATSOEVER IS GIVEN ON THIS. THE AUTHOR SHALL NOT BE MADE RESPONSIBLE FOR ANY DAMAGE YOU MIGHT INCUR WHEN USING THIS INFORMATION. The solution presented here IS NOT SUPPORTED by Microsoft.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2009/03/27/cross-platform-in-opsmgr-2007-r2-release-candidate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Early Adoptions, Health Checks and New Year Rants.</title>
		<link>http://www.muscetta.com/2008/12/30/early-adoptions-health-checks-and-new-year-rants/</link>
		<comments>http://www.muscetta.com/2008/12/30/early-adoptions-health-checks-and-new-year-rants/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 15:10:26 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[MOM]]></category>
		<category><![CDATA[MOM2005]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[HC]]></category>
		<category><![CDATA[Health Check]]></category>
		<category><![CDATA[HealthCheck]]></category>
		<category><![CDATA[Premier]]></category>
		<category><![CDATA[Premier Field Engineer]]></category>
		<category><![CDATA[RAP]]></category>
		<category><![CDATA[Risk Assessment Program]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[Support]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=390</guid>
		<description><![CDATA[
Two days ago I read the following Tweet by Hugh MacLeod:
&#034;[...] Early Adopter Problem: How to differentiate from the bandwagon, once the bandwagon starts moving faster than you are [...]&#034;
That makes me think of early adoption of a few technologies I have been working with, and how the community around those evolved. For example:
Operations Manager&#8230; [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/dani3l3/3150411409/"><img src="http://farm4.static.flickr.com/3258/3150411409_8ce3a8ea75.jpg" alt="Generations" width="500" height="333" /></a></p>
<p>Two days ago I read <a href="http://twitter.com/gapingvoid/status/1082816395">the following Tweet by Hugh MacLeod</a>:</p>
<blockquote><p>&#034;[...] Early Adopter Problem: How to differentiate from the bandwagon, once the bandwagon starts moving faster than you are [...]&#034;</p></blockquote>
<p>That makes me think of early adoption of a few technologies I have been working with, and how the community around those evolved. For example:</p>
<p><strong>Operations Manager</strong>&#8230; early adoption meant that I have been working with it since the beta, had posted <a href="http://www.muscetta.com/2007/05/10/create-a-script-based-unit-monitor-in-opsmgr2007-via-the-gui/">one of the earliest posts about how to use a script in a Unit Monitor back in may 2007</a> (the product was released in April 2007 and there was NO documentation back then, so we had to really try to figure out everything&#8230;), but <a href="http://contoso.se/blog/?p=305">someone seems to think it is worth repeating the very same lesson in November 2008</a>, with not a lot of changes, as <a href="http://twitter.com/dani3l3/status/1030704645">I wrote here</a>. I don&#039;t mean being rude to Anders&#8230; repeating things will surely help the late adopters finding the information they need, of course.</p>
<p>Also, I started playing early with <strong>Powershell</strong>. <a href="http://www.muscetta.com/2006/11/24/out-blog/">I posted my first (and only) cmdlet</a> back in 2006. It was not a lot more than a test for myself to learn how to write one, but that&#039;s just to say that I started playing early with it. I have been using it <a href="http://www.muscetta.com/2007/05/30/death-by-right-click-delete-nope-powershell/">to automate tasks</a> for example.</p>
<p>Going back to the quote above, everyone gets on the bandwagon posting <a href="http://www.systemcenterforum.org/news/advanced-example-using-powershell-and-the-opsmgr-sdk-creating-and-updating-groups/">examples and articles</a>. I had been asked a few times about writing articles on OpsMgr and Powershell usage (for example by <a href="http://www.powershell.it">www.powershell.it</a>) but I declined, as I was too busy using this knowledge to do stuff for work (where “work” is defined as in “work that pays your mortgage”), rather than seeking personal prestige through articles and blogs. Anyway, that kind of articles are appearing now all over the Internet and the blogosphere now. The above examples made me think of early adoption, and the bandwagon that follows later on… but even as an early adopter, I was never very noisy or visible.</p>
<p>Now, going back to what I do for work, (which <a href="http://blogs.msdn.com/dmuscett/archive/2005/09/02/459914.aspx">I mentioned here</a> and <a href="http://www.muscetta.com/2007/12/27/simply-works/">here in the past</a>), I work in the <a href="https://www.microsoft.com/emea/careers/technicalJobs/PremierFieldEngineer.mspx">Premier Field Engineering</a> organization of Microsoft Services, which provides Premier services to customers. <a href="http://www.microsoft.com/services/microsoftservices/srv_premier.mspx">Microsoft Premier customer have a wide range of Premier agreement features and components</a> that they can use to support their people, improve their processes, and improve the productive use of the Microsoft technology they have purchased. Some of these services we provide are known to the world as “<a href="http://www.google.com/search?hl=en&amp;q=health+check+site%3Amicrosoft.com&amp;btnG=Search">Health Checks</a>”, some as “<a href="http://www.google.com/search?hl=en&amp;q=risk+assessment+program+site%3Amicrosoft.com&amp;btnG=Search">Risk Assessment Programs</a>” (or, shortly, RAPs). These are basically services where one of our technology experts goes on the customer site and there he uses a custom, private Microsoft tool to gather a huge amount of data from the product we mean to look at (be it SQL, Exchange, AD or anything else….). The Health Check or RAP tool collects the data and outputs a draft of the report that will be delivered to the customer later on, with all the right sections and chapters. This is done so that every report of the same kind will look consistent, even if the engagement is performed by a different engineer in a different part of the world. The engineer will of course analyze the collected data and write recommendations about what is configured properly and/or about what could or should be changed and/or improved in the implementation to make it adhere to Best Practices. To make sure only the right people actually go onsite to do this job we have a strict internal accreditation process that must be followed; only accredited resources that know the product well enough and know exactly how to interpret the data that the tool collects are allowed to use it and to deliver the engagement, and present/write the findings to the customer.</p>
<p>So why am I telling you this here, and how have I been using my early knowledge of OpsMgr and Powershell for ?</p>
<p>I have used that to write the Operations Manager Health Check, of course!</p>
<p>We had a <a href="http://download.microsoft.com/download/f/9/7/f974f0df-66fd-47e9-a1ac-c6fdbe3c723a/Operations_Manager_Server_Health_Check.pdf">MOM 2005 Health Check </a>already, but since the technology has changed so much, from MOM to OpsMgr, we had to write a completely new tool. Jeff  (the original MOM2005 author, who does not have a blog that I can link to) and me are the main coders of this tool… and the tool itself is A POWERSHELL script. A longish one, of course (7000 lines, more or less), but nothing more than a Powershell script, at the end of the day. There are a few more colleagues that helped shape the features and tested the tool, including <a href="http://blogs.technet.com/kevinholman/">Kevin Holman</a>. Some of the <a href="http://blogs.technet.com/kevinholman/archive/2007/10/18/useful-operations-manager-2007-sql-queries.aspx">database queries on Kevin’s blog</a> are in fact what we use to extract some of the data (beware that some of those queries have recently been updated, in case you saved them and using your local copy!), while some other information are using internal and/or custom queries. Some other times we use OpsMgr cmdlets or go to the SDK service, but a lot of times we query the database directly (we really should use the SDK all the times, but for certain stuff direct database access is way faster). It took most of the past year to write it, test it, troubleshoot it, fix it, and deliver the first engagements as “beta” to some customers to help iron out the process&#8230; and now the delivery is available! If a year seems like a long time, you have to consider this is all work that gets done next to what we all have to normally do with customers, not replacing it (i.e. I am not free to sit on my butt all day and just write the tool&#8230; <a href="http://download.microsoft.com/download/e/9/d/e9df53f8-3069-4fe4-bdbd-0d7abd86488a/PremFieldEnginr_161107b.pdf">I still have to deliver services to customers day in day out, in the meantime</a>).</p>
<p>Occasionally, during this past calendar year, that is approaching its end, I have been willing and have found some extra time to disclose some bits and pieces, techniques and prototypes of how to use Powershell and OpsMgr together, <a href="http://www.muscetta.com/2008/11/29/programmatically-check-for-management-pack-updates-in-opsmgr-2007-r2/">such as innovative ways to use Powershell in OpsMgr against beta features</a>, but in general most of my early adopter’s investment went into the private tool for this engagement, and that is one of the reasons I couldn’t blog or write much about it, being it Microsoft Intellectual Property.</p>
<p>But it is also true that <a href="http://twitter.com/dani3l3/status/997620250">I did not care to write other stuff when I considered it too easy or it could be found in the documentation</a>. I like writing of ideas, thoughts, rants OR things that I discover and that are not well documented at the time I study them… so when I figure out things I might like leaving a trail for some to follow. But I am not here to spoon feed people like some in the bandwagon are doing. Now the bandwagon is busy blogging and writing continuously about some aspect of OpsMgr (known or unknown, documented or not), and the answer to <a href="http://twitter.com/gapingvoid/status/1082816395">the original question of Hugh</a> is, in my opinion, that it does not really matter what the bandwagon is doing right now. I was never here to do the same thing. I think <strong>that</strong> is my differentiator. I am not saying that what a bunch of colleagues and enthusiasts is doing is not useful: blogging and writing about various things they experiment with is interesting and it will be useful to people. But blogs are useful until a certain limit. I think that blogs are best suited for conversations and thoughts (rather than for &#034;howto&#039;s&#034;), and what I would love to see instead is: less marketing hype when new versions are announced and more real, official documentation.</p>
<p>But I think I should stop caring about what the bandwagon is doing, because that&#039;s just another ego trip at the end of the day. What I should more sensibly do, would be listening to <a href="http://freewillastrology.com/horoscopes/pisces.html">my horoscope</a> instead:</p>
<blockquote><p>[…] &#034;How do you slay the dragon?&#034; journalist Bill Moyers asked mythologist Joseph Campbell in an interview. By &#034;dragon,&#034; he was referring to the dangerous beast that symbolizes the most unripe and uncontrollable part of each of our lives. In reply to Moyers, Campbell didn&#039;t suggest that you become a master warrior, nor did he recommend that you cultivate high levels of sleek, savage anger. &#034;Follow your bliss,&#034; he said simply. Personally, I don&#039;t know if that&#039;s enough to slay the dragon &#8212; I&#039;m inclined to believe that you also have to take some defensive measures &#8212; but it&#039;s definitely worth an extended experiment. Would you consider trying that in 2009? […]</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/12/30/early-adoptions-health-checks-and-new-year-rants/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programmatically Check for Management Pack updates in OpsMgr 2007 R2</title>
		<link>http://www.muscetta.com/2008/11/29/programmatically-check-for-management-pack-updates-in-opsmgr-2007-r2/</link>
		<comments>http://www.muscetta.com/2008/11/29/programmatically-check-for-management-pack-updates-in-opsmgr-2007-r2/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 22:10:21 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Cross Platform]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[Interop]]></category>
		<category><![CDATA[R2]]></category>
		<category><![CDATA[scom]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2008/11/29/programmatically-check-for-management-pack-updates-in-opsmgr-2007-r2/</guid>
		<description><![CDATA[One of the cool new features of System Center Operations Manager 2007 R2 is the possibility to check and update Management Packs from the catalog on the Internet directly from the Operators Console:

Even if the backend for this feature is not yet documented, I was extremely curious to see how this had actually been implemented. [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>One of the cool new features of <a href="http://technet.microsoft.com/en-us/opsmgr/dd239186.aspx">System Center Operations Manager 2007 R2</a> is the possibility to check and update <a href="http://www.microsoft.com/technet/prodtechnol/scp/opsmgr07.aspx">Management Packs from the catalog on the Internet</a> directly from the Operators Console:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb12.png" border="0" alt="Select Management Packs from Catalog" width="640" height="406" /></p>
<p>Even if the backend for this feature is not yet documented, I was extremely curious to see how this had actually been implemented. Especially since it took a while to have this feature available for OpsMgr, I had the suspicion that it could not be as simple as one downloadable XML file, like <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=A24CEA3A-1920-4B18-8CF2-8BF78C94C917&amp;displaylang=en">the old MOM2005&#039;s MPNotifier</a> had been using in the past.</p>
<p>Therefore I observed the console&#039;s traffic through the lens of my proxy, and got my answer:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image18.png" border="0" alt="ISA Server Log" width="813" height="58" /></p>
<p>So that was it: a .Net Web Service.</p>
<p>I tried to ask the web service itself for discovery information, but failed:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image19.png" border="0" alt="WSDL" width="653" height="145" /></p>
<p>Since there is no WSDL available, but I badly wanted to interact with it, I had to figure out: what kind of requests would be allowed to it, how should they be written, what methods could they call and what parameters should I pass in the call. In order to get started on this, I thought I could just observe its network traffic. And so I did&#8230; I fired up <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=f4db40af-1e08-4a21-a26b-ec2f4dc4190d&amp;displaylang=en">Network Monitor</a> and captured the traffic:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/clip-image0025-thumb.jpg" border="0" alt="Microsoft Network Monitor 3.2" width="640" height="335" /></p>
<p><a href="http://blogs.technet.com/netmon/">Microsoft Network Monitor</a> is beautiful and useful for this kind of stuff, as it lets you easily identify which application a given stream of traffic belongs to, just like in the picture above. After I had isolated just the traffic from the Operations Console, I then saved those captures packets in CAP format and opened it again in <a href="http://www.wireshark.org/">Wireshark</a> for a different kind of analysis &#8211; &#034;Follow TCP Stream&#034;:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/clip-image0027-thumb.jpg" border="0" alt="Wireshark: Follow TCP Stream" width="640" height="450" /></p>
<p>This showed me the reassembled conversation, and what kind of request was actually done to the Web Service. That was the information I needed.</p>
<p>Ready to rock at this point, I came up with <a href="http://www.muscetta.org/Check-MPUpdates.zip"><strong>this Powershell script</strong></a> (to be run in OpsMgr Command Shell) that will:</p>
<p>1) connect to the web service and retrieve the complete MP list for R2 (this part is also useful on its own, as it shows how to interact with a SOAP web service in <a href="http://www.microsoft.com/powershell">Powershell</a>, invoking a method of the web service by issuing a specially crafted POST request. To give due credit, for this part I first looked at <a href="http://users.skynet.be/pascalbotte/rcx-ws-doc/perlpost.htm">this PERL code</a>, which I then adapted and ported to Powershell);</p>
<p>2) loop through the results of the &#034;Get-ManagementPack&#034; opsmgr cmdlet and compare each MP found in the Management Group with those pulled from the catalog;</p>
<p>3) display a table of all imported MPs with both the version imported in your Management Group AND the version available on the catalog:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb13.png" border="0" alt="Script output in OpsMgr Command Shell" width="596" height="480" /></p>
<p>Remember that this is just SAMPLE code, it is not meant to be used in production environment and it is worth mentioning again that OpsMgr2007 R2 this is BETA software at the time of writing, therefore this functionality (and its implementation) might change at any time, and the script will break. Also, at present, the MP Catalog web service still returns slightly older MP versions and it is not yet kept in sync and updated with MP Releases, but it will be ready and with complete/updated content by the time R2 gets released.</p>
<p><strong>Disclaimer</strong></p>
<p>The information in this weblog is provided &#034;AS IS&#034; with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my own personal opinion. All code samples are provided &#034;AS IS&#034; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.<br />
THIS WORK IS NOT ENDORSED AND NOT EVEN CHECKED, AUTHORIZED, SCRUTINIZED NOR APPROVED BY MY EMPLOYER, AND IT ONLY REPRESENT SOMETHING WHICH I&#039;VE DONE IN MY FREE TIME. NO GUARANTEE WHATSOEVER IS GIVEN ON THIS. THE AUTHOR SHALL NOT BE MADE RESPONSIBLE FOR ANY DAMAGE YOU MIGHT INCUR WHEN USING THIS INFORMATION. The solution presented here IS NOT SUPPORTED by Microsoft.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/11/29/programmatically-check-for-management-pack-updates-in-opsmgr-2007-r2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>CentOS discovery in OpsMgr2007 R2 beta</title>
		<link>http://www.muscetta.com/2008/11/23/centos-discovery-in-opsmgr2007-r2-beta/</link>
		<comments>http://www.muscetta.com/2008/11/23/centos-discovery-in-opsmgr2007-r2-beta/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 14:51:58 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Cross Platform]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MOM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[xplat]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[Interop]]></category>
		<category><![CDATA[management pack]]></category>
		<category><![CDATA[openpegasus]]></category>
		<category><![CDATA[openwsman]]></category>
		<category><![CDATA[R2]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[scom]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[unsupported]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=361</guid>
		<description><![CDATA[Here we go again. Now that the OpsMgr2007 R2 beta is out, with an improved and revamped version of the System Center Cross Platform Extensions, I faced the issue of how to upgrade my test lab.
I have to say that OpsMgr2007 R2 beta release notes explain the known issues, and I had no trouble whatsoever [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>Here we go again. Now that the <a href="http://technet.microsoft.com/en-us/opsmgr/dd239186.aspx" target="_blank">OpsMgr2007 R2 beta is out</a>, with an improved and revamped version of the <a href="http://blogs.msdn.com/scxplat/archive/2008/04/29/announcing-system-center-operations-manager-2007-cross-platform-extensions-and-connectors.aspx" target="_blank">System Center Cross Platform Extensions</a>, I faced the issue of how to upgrade my test lab.</p>
<p>I have to say that OpsMgr2007 R2 beta release notes explain the known issues, and I had no trouble whatsoever upgrading the windows part. It just took its time (I am running virtual machines in my test lab, that don&#039;t have the best performance), but it went smoothly and without a glitch. In a couple of hours I had everything upgraded: databases, RMS, reporting, agents, gateway. All right then. The new purple icons in System Center look cute, and <a href="http://contoso.se/blog/?p=304" target="_blank">the new UI has some great stuff</a>, such as a long-awaited way to update your management packs directly from the Internet, better display of Overrides (kind of what we used to rely on <a href="http://blogs.msdn.com/boris_yanushpolsky/archive/2007/08/09/override-explorer-v3-3.aspx" target="_blank">Override Explorer</a> for)&#8230; and  A LOT more new stuff that I won&#039;t be wasting my Sunday writing about since everybody else has already done it two days ago:</p>
<p><a href="http://twitter.com/opsmgr" target="_blank"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image4.png" border="0" alt="opsmgr aggregated feed on Twitter" width="630" height="480" /></a></p>
<p>Therefore let&#039;s get back to my upgrade, which is a lot more interesting (to me) than the marketing tam-tam <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>As part of the upgrade to R2, I had to first uninstall the Xplat beta refresh bits, which I had installed, including all Unix Management Packs. Including my <a href="http://www.muscetta.com/2008/05/04/testing-system-center-cross-plaform-extentions/" target="_blank">CentOS Management Pack</a> I had <a href="http://blogs.msdn.com/scxplat/archive/2008/05/06/another-first-experience-with-cpe.aspx" target="_blank">improvised</a>.</p>
<p>So this is the new start page of the integrated Discovery Wizard:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb.png" border="0" alt="Discovery Wizard" width="624" height="480" /></p>
<p>Looks nice and integrates the functionality of discovering and deploying Windows machines, SNMP Devices, and Unix/Linux machines.</p>
<p>Of course, my CentOS machine would not be discovered, and showed up as an unsupported platform. Of course my old Management Pack I had hacked together in XPlat Beta 1 did not work anymore. Therefore, I figured out I had to see what changes were there, and how to make it work again (of course it IS possible &#8211; It is NOT SUPPORTED, but I don&#039;t care, as long as it works).</p>
<p>Since the existing agent could not be discovered, the first step I took was logging on the Linux box, un-install the old agent, and install the new one:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb1.png" border="0" alt="XPlat Agent RPM Install on CentOS" width="617" height="480" /></p>
<p>There I tried to discover again, but of course it still failed.</p>
<p>At that point I started taking a look at the new layout of things on the unix side. Most stuff is located in the same directories where beta1 was installed, and there are a bunch of useful commands under <strong>/opt/microsoft/scx/bin/tools</strong>.<br />
You can check out the <a href="http://www.openpegasus.org/" target="_blank">Open Pegasus</a> version used:</p>
<p>[root@centos tools]# <strong>./scxcimconfig &#8211;version<br />
</strong>Version 2.7.0</p>
<p>Let&#039;s take a look at what SCX classes we have available:</p>
<p><strong>./scxcimcli nc -n root/scx -di |grep SCX | sort</strong></p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb2.png" border="0" alt="./scxcimcli nc -n root/scx -di |grep SCX | sort" width="640" height="439" /></p>
<p>Nice. That&#039;s the stuff we will be querying over WS-Man from the Management Server.</p>
<p>So let&#039;s look at the OS Discovery, and we test it from the OpsMgr 2007 box:</p>
<p><strong>winrm enumerate </strong><strong>http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem?__cimnamespace=root/scx</strong><strong> -username:root -password:password -r:</strong><strong>https://centos:1270/wsman</strong><strong> -auth:basic -skipCACheck</strong></p>
<p>it returns results:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb3.png" border="0" alt="OS WS-Man Query" width="610" height="480" /></p>
<p>At first I assumed this worked like in Beta1, therefore I exported RedHat management pack and I made my own version of it, replacing the strings it is expecting to find to discover CentOS instead than Redhat.</p>
<p>While the MP was syntactically correct and would import fine, the Discovery wizard still didn&#039;t work.</p>
<p>I took one more look at the discoveries in the MP, and I found there are two more, targeted to Management Server, which is probably what gets used by the Discovery Wizard to understand what kind of agent kit needs to be deployed.</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb4.png" border="0" alt="MP XML - Discoveries" width="640" height="472" /></p>
<p>So basically this discovery checks for the returned value from the module to determine if the discovered platform is a supported one:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb5.png" border="0" alt="Discovery Settings" width="640" height="467" /></p>
<p>But how does the module get its data?</p>
<p>Look at the layout of the <strong>/AgentManagement/UnixAgents</strong> folder on the Management Server:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb6.png" border="0" alt="/AgentManagement/unixAgents " width="640" height="291" /></p>
<p>That&#039;s it: <strong>GetOSVersion.sh</strong> &#8211; a shell script. A nice, open, clear text, hackable shell script. Let&#039;s take a look at it:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb7.png" border="0" alt="Discovery Script Hack" width="640" height="392" /></p>
<p>So that&#039;s it, and how my modification looks like. What happens during the discovery wizard is that we probably copy the script over SCP to the box, execute it, look at a number of things, and return the discovery data we need.</p>
<p>If you do those steps manually, you see how the script returns something very similar to a <a href="http://technet.microsoft.com/en-us/magazine/cc983816.aspx" target="_blank">PropertyBag, just like discoveries done by VBScript on Windows machines</a>:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb8.png" border="0" alt="Discovery Script Output" width="640" height="393" /></p>
<p>So after modifying the script&#8230; here we go. The Wizard now thinks CentOS is Red Hat, and can install an agent on it:</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb9.png" border="0" alt="Discovery Wizard" width="548" height="480" /></p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb10.png" border="0" alt="Deploying Agent" width="551" height="480" /></p>
<p>Only when the Management Server discovery finally considers the CentOS machine worth managing, then the other discoveries that use WS-Man queries start kicking in, like the old one did, and find the OS objects and all the other hosted objects. In order for this to work you don&#039;t only need to hack the shell script, but to have a hacked MP &#8211; the &#034;regular&#034; Red Har one won&#039;t find CentOS, which is and remains an UNSUPPORTED platform.</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.muscetta.com/wp-content/uploads/image-thumb11.png" border="0" alt="CentOS Health Model" width="640" height="454" /></p>
<p><strong>Disclaimer</strong></p>
<p>The information in this weblog is provided &#034;AS IS&#034; with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my own personal opinion. All code samples are provided &#034;AS IS&#034; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.<br />
THIS WORK IS NOT ENDORSED AND NOT EVEN CHECKED, AUTHORIZED, SCRUTINIZED NOR APPROVED BY MY EMPLOYER, AND IT ONLY REPRESENT SOMETHING WHICH I&#039;VE DONE IN MY FREE TIME. NO GUARANTEE WHATSOEVER IS GIVEN ON THIS. THE AUTHOR SHALL NOT BE MADE RESPONSIBLE FOR ANY DAMAGE YOU MIGHT INCUR WHEN USING THIS INFORMATION. The solution presented here IS NOT SUPPORTED by Microsoft.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/11/23/centos-discovery-in-opsmgr2007-r2-beta/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Protecting custom Resolution State in OpsMgr 2007</title>
		<link>http://www.muscetta.com/2008/09/13/protecting-custom-resolution-state-in-opsmgr-2007/</link>
		<comments>http://www.muscetta.com/2008/09/13/protecting-custom-resolution-state-in-opsmgr-2007/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 09:32:17 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[MOM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[resolution state]]></category>
		<category><![CDATA[scom]]></category>
		<category><![CDATA[unsupported]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=298</guid>
		<description><![CDATA[In System Center Operations Manager 2007, you can add and remove resolution states for your alerts at will. Other than states &#034;0&#034; (&#034;New&#034;) and &#034;255&#034; (&#034;Closed&#034;) you can create other 254 resolution states to suit your needs. This is a simple feature that was already present in previous MOM versions, and it is very useful [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>In System Center Operations Manager 2007, you can add and remove resolution states for your alerts at will. Other than states &#034;0&#034; (&#034;New&#034;) and &#034;255&#034; (&#034;Closed&#034;) you can create other 254 resolution states to suit your needs. This is a simple feature that was already present in previous MOM versions, and it is very useful to do a kind of tricks with your alerts. The amount of possible states you can create should be able to satisfy any kind of alert and incident management process you might have in place, and any kind of filtering or forwarding or escalation need you might want to perform by using resolution states.</p>
<p><img src="http://www.muscetta.com/wp-content/uploads/image.png" alt="image" width="810" height="350" /></p>
<p>By default, only OpsMgr Administrators can change these settings, with the exception of the two built-in states of &#034;New&#034; and &#034;Closed&#034;: those two states are REQUIRED if you want the product to continue working, therefore the GUI won&#039;t let you change, edit or delete them. Which is good.</p>
<p>This is not true for your own resolution states, which can be edited or even deleted any time. All that is really saved in an alert when you change an alert&#039;s resolution state is the NUMBER associated with it. In fact you even use that number when querying for alerts in the Command Shell:</p>
<p><img src="http://www.muscetta.com/wp-content/uploads/image1.png" alt="get-alert | where {$_.resolutionstate -eq 0}" width="718" height="122" /></p>
<p>That means that if by accident you delete a resolution state you have defined, you won&#039;t see its description anymore in the GUI. Also, if you try to re-organize your resolution state, you can easily change the IDs for existing ones&#8230; Sure, you need to have the permissions in order to change or delete them, but what if you have implemented your important Alert and Incident management process by using resolution states and you want a bit of extra protection from mistakes or unintended deletion for them?</p>
<p>Then you can protect them by making the product think they were &#034;built-in&#034; too, just like &#034;New&#034; and &#034;Closed&#034;.</p>
<p>How would you do this? In an UNSUPPORTED WAY: editing the database <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  In fact, those resolution states are written in a table in the database, called &#034;ResolutionState&#034; (who would have guessed it?), that looks like the following picture:</p>
<p><img src="http://www.muscetta.com/wp-content/uploads/image2.png" alt="dbo.ResolutionState" width="693" height="274" /></p>
<p>Can you see the &#034;IsPredefined&#034; column? That can be set to &#034;True&#034; or &#034;False&#034; and that value is used by the SDK service to tell the GUI if that Resolution State can be edited/deleted or not.</p>
<p>Of course changing the database directly IS NOT SUPPORTED by Microsoft. You do this at your own risk, and if it was me, I would *NEVER* touch, change or remove the default two states (&#034;New&#034; and &#034;Closed&#034;) as THAT really would BREAK the product. For example, Alerts that are not set to &#034;Closed&#034; (255) won&#039;t be ever groomed. And that is VERY BAD. NEVER, NEVER DO THAT.</p>
<p>On the other end, changing a custom Resolution State to make the product believe it is Predefined/Built-in has not had any negative impact in my (limited) testing so far, and has added the advantage of &#034;protecting&#034; my resolution state from unintended deletion, as shown below:</p>
<p><img src="http://www.muscetta.com/wp-content/uploads/image3.png" alt="image" width="623" height="162" /></p>
<p>As usual, do this at your own risk. Remember what&#039;s written in my <strong>Disclaimer</strong>:</p>
<p>The information in this weblog is provided &#034;AS IS&#034; with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my own personal opinion. All code samples are provided &#034;AS IS&#034; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.<br />
THIS WORK IS NOT ENDORSED AND NOT EVEN CHECKED, AUTHORIZED, SCRUTINIZED NOR APPROVED BY MICROSOFT, AND IT ONLY REPRESENT SOMETHING WHICH I&#039;VE DONE IN MY FREE TIME. NO GUARANTEE WHATSOEVER IS GIVEN ON THIS. THE AUTHOR SHALL NOT BE MADE RESPONSIBLE FOR ANY DAMAGE YOU MIGHT INCUR WHEN USING THIS HACK.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/09/13/protecting-custom-resolution-state-in-opsmgr-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS 5 Management Pack for OpsMgr SCX</title>
		<link>http://www.muscetta.com/2008/05/13/centos-5-management-pack-for-opsmgr-scx/</link>
		<comments>http://www.muscetta.com/2008/05/13/centos-5-management-pack-for-opsmgr-scx/#comments</comments>
		<pubDate>Tue, 13 May 2008 09:43:07 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Cross Platform]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MOM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[xplat]]></category>
		<category><![CDATA[Blogs]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Choice]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[management pack]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[scom]]></category>
		<category><![CDATA[screenshot]]></category>
		<category><![CDATA[scx]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=277</guid>
		<description><![CDATA[As I mentioned here, I have been testing the SCX beta.
Not having one of the &#034;supported&#034; platforms pushed me into playing with the provided Management Packs, and in turn I managed to use the MP for Red Hat Enterprise Linux 5 as a base, and replaced a couple of strings in the discoveries in order [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.muscetta.com/2008/05/04/testing-system-center-cross-plaform-extentions">As I mentioned here</a>, I have been testing the <a href="http://blogs.msdn.com/scxplat/">SCX</a> beta.</p>
<p>Not having one of the &#034;supported&#034; platforms pushed me into playing with the provided Management Packs, and in turn I managed to use the MP for Red Hat Enterprise Linux 5 as a base, and replaced a couple of strings in the discoveries in order to get a working <a href="http://www.centos.org">CentOS</a> 5 Management Pack.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://www.muscetta.com/wp-content/uploads/centos-healthexplorer01-new.jpg" border="0" alt="CentOS_HealthExplorer01_NEW" width="997" height="681" /></p>
<p>I still have not looked into the &#034;hardware&#034; monitors and health model / service model, so those are not currently monitored. But it is a start.</p>
<p>A lot of people have asked me a lot of information and would like to get the file &#8211; both in the blog&#039;s comment, on the newsgroup, or via mail. I am sorry, but I cannot provide you with the file, because it has not been throughly tested and might render your systems unstable, and also because there might be licensing and copyright issues that I have not checked within Microsoft.</p>
<p>Keep also in mind that using CentOS as a monitored platform <strong>is NOT a SUPPORTED scenario/platform for SCX</strong>. I only used it because I did not have a Suse or Redhat handy that day, and because I wanted to understand how the Management Packs using WS-Man worked.</p>
<p>This said, should you wish to try to do the same &#034;MP Hacking&#034; I did,  <a href="http://www.muscetta.com/2008/05/04/testing-system-center-cross-plaform-extentions/">I pretty much explained all you need to know in my previous post and its comments</a>, so that should not be that difficult.</p>
<p>Actually, I still think that the best way to figure out how things are done is by looking at the actual implementation, so I encourage you to look at the management packs and figure out how those work. There are a few mature tools out there that will help you author/edit Management Packs if you don&#039;t want to edit the XML directly: the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6c8911c3-c495-4a03-96df-9731c37aa6d7&amp;DisplayLang=en">Authoring Console</a>, and <a href="http://www.silect.com/solutions/opsmgr_Sol/opsmgr_Sol_studio2007_Lite.html">Silect MP Studio Lite</a>, for example. If you want to delve in the XML details, instead, then I suggest you read the <a href="http://download.microsoft.com/download/7/4/d/74deff5e-449f-4a6b-91dd-ffbc117869a2/OM2007_AuthGuide.doc">Authoring Guide</a> and peek at <a href="http://www.authormps.com/">Steve Wilson&#039;s AuthorMPs.com site</a>.</p>
<p><strong>Disclaimer<br />
</strong>The information in this weblog is provided &#034;AS IS&#034; with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my own personal opinion. All code samples are provided &#034;AS IS&#034; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.<br />
THIS WORK IS NOT ENDORSED AND NOT EVEN CHECKED, AUTHORIZED, SCRUTINIZED NOR APPROVED BY MY EMPLOYER, AND IT ONLY REPRESENT SOMETHING WHICH I&#039;VE DONE IN MY FREE TIME. NO GUARANTEE WHATSOEVER IS GIVEN ON THIS. THE AUTHOR SHALL NOT BE MADE RESPONSIBLE FOR ANY DAMAGE YOU MIGHT INCUR WHEN USING THIS PROGRAM.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/05/13/centos-5-management-pack-for-opsmgr-scx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing System Center Cross Plaform Extentions</title>
		<link>http://www.muscetta.com/2008/05/04/testing-system-center-cross-plaform-extentions/</link>
		<comments>http://www.muscetta.com/2008/05/04/testing-system-center-cross-plaform-extentions/#comments</comments>
		<pubDate>Sun, 04 May 2008 07:35:48 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Cross Platform]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MOM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[xplat]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Interop]]></category>
		<category><![CDATA[openpegasus]]></category>
		<category><![CDATA[openwsman]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[scx]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[suse]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[ws-man]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/?p=274</guid>
		<description><![CDATA[I am testing the beta bits of the cross-platform extensions that were released on Microsoft Connect&#160; 
This post wants to describe my limited testing so far &#8211; I hope this can benefit/help everyone testing the beta for some stuff that might currently not be incredibly clear &#8211; unless you attended the MMS class, at least [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>I am testing the beta bits of the cross-platform extensions that were released on <a href="http://connect.microsoft.com/">Microsoft Connect</a>&nbsp; </p>
<p>This post wants to describe my limited testing so far &#8211; I hope this can benefit/help everyone testing the beta for some stuff that might currently not be incredibly clear &#8211; <a href="http://blogs.msdn.com/scxplat/archive/2008/05/01/cross-platform-extensions-overview-session-at-mms.aspx">unless you attended the MMS class</a>, at least <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )  </p>
<p>I started out with <a href="http://download.microsoft.com/download/7/7/6/7762e198-cad4-4fac-9946-e8978e90823c/OpsMgr2007-CrossPlat-WP_CD_April2008.pdf">the White Paper that has been posted on the web, which describes the architecture pretty well</a>, but from a higher level (with diagrams and the like). Then I downloaded the beta bits, which contain another document about setting the thing up. It is pretty well done, to be honest (especially if you consider that it is beta documentation for a beta product!), but it does not really go all the way down to troubleshooting things a lot, yet. I will try to cover some of that here.  </p>
<p>I installed the agent manually &#8211; it’s just a RPM package, not much that can go wrong with that. There is a reason why I did not use the push discovery and deployment of the agent, which you will figure out reading later on. Once installed, I tried to figure out how things were looking like on the linux machine. It is all pretty understandable, after all, if you look around on the machine (documented or not, linux and open source stuff is easy to figure out by reading configuration files and the like, and by searching on the web).  </p>
<p>Basically the “agent” is not properly an &#034;agent&#034; the way the windows agent is, since it does not really &#034;sends&#034; stuff to the Management Server on its own: It consists of a&nbsp; couple of services/daemons, based on existing opensource projects, but configured in their own folder, with their own name, and using different ports than a standard install of those,&nbsp; not to conflict with possible existing ones on those machines.  </p>
<p>The Management Service uses these services remotely (similar to doing agentless monitoring towards a windows box) using these services. The two services are:
<ul>
<li><b>scx-cimd</b> which implements the CIM daemon (<a href="http://www.openpegasus.org">openpegasus.org</a>)  </li>
<li><b>scx-wsmand</b> which implements Ws-Man daemon (<a href="http://www.openwsman.org">openwsman.org</a>)</li>
</ul>
<p>&nbsp;<img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="245" alt="scx-services commands" src="http://www.muscetta.com/wp-content/uploads/image001.png" width="640" border="0"/> </p>
<p>It is easy to figure out how they are layed out. Even if undocumented, you look at the processes  </p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="130" alt="SCX processes" src="http://www.muscetta.com/wp-content/uploads/image002.png" width="640" border="0"/>  </p>
<p>and you can figure out WHERE they live (<b>/opt/microsoft/scx/bin/</b>….) and where their configuration files are located (/etc/opt/microsoft/scx/conf …).  </p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="169" alt="SCX Configuration" src="http://www.muscetta.com/wp-content/uploads/image003.png" width="640" border="0"/>  </p>
<p>The files are self explanatory, and the documentation of the opensource projects can be found on the Internet:&nbsp; </p>
<p>for <strong>wsmand</strong> </p>
<ul>
<li>at <a href="http://www.openwsman.org">openwsman.org</a> (for wsmand) </li>
</ul>
<p>for <strong>cimd</strong> </p>
<ul>
<li>at openpegasus site (<a href="http://www.openpegasus.org/documents.tpl?CALLER=doc.tpl&amp;dcat=">http://www.openpegasus.org/documents.tpl?CALLER=doc.tpl&amp;dcat=</a> )  </li>
<li>on the openpegasus wiki (<a href="http://wiki.opengroup.org/pegasus-wiki/doku.php?id=start">http://wiki.opengroup.org/pegasus-wiki/doku.php?id=start</a> )  </li>
<li>at the linux management IBM page <a href="http://www.ibm.com/developerworks/linux/library/os-ltc-systemsmanagement/">http://www.ibm.com/developerworks/linux/library/os-ltc-systemsmanagement/</a>&nbsp; </li>
</ul>
<p>&nbsp; </p>
<p>I still have to delve into them properly as I would like to, but I already figured out a bunch of interesting things by quickly looking at them.  </p>
<p>Agent Communication someone must have decided to “recycle” the <strong>1270</strong> port number that was used in MOM2005 <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Basically openwsman listens as a SSL listener (with basic auth – connected via PAM module with the “regular” unix /etc/passwd users, so you can authenticate as those without having to define specific users for the service). So all that happens is that the Management Server asks things/executes WS-Man queries and commands on this channel. The Management Server connects every time to the agent on port 1270 using SSL, authenticates as “root” (or as the specified &#034;Action Account&#034;) and does its stuff, or asks the agent to do it. So the communication is happening from the Management Server to the agent… not the other way around like it happens with Windows &#034;agents&#034;. That’s why it feels to me more like an “agentless” thing, at least for what concerns the “direction” of traffic and who does the actual querying.  </p>
<p>For the rest, the provided Management Packs have “normal” discoveries and “normal” monitors. Pretty much like the Windows Management Packs often discover thing by querying WMI, here they use WS-Man to run CIM queries against the Unix boxes.  </p>
<p>The Service Model is totally cool to actually *<b>SEE</b>* in action, don’t you think so ?  </p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="654" alt="Service Model" src="http://www.muscetta.com/wp-content/uploads/image004.png" width="451" border="0"/>  </p>
<p>&nbsp; </p>
<p>A few more debugging/troubleshooting information:  </p>
<p>I searched a bit and found the openwsman.org documentation and forum to be useful to figure some things out. For example I banged my head a few times before managing to actually TEST a query from windows to linux using WINRM. <a href="http://openwsman.org/openwsman-users-guide/vista-winrm-over-openwsman-setup">This document helped a lot</a>.  </p>
<p>Of course you have to solve some other things such as DNS resolution AND trusting the self-issued certificates that the agent uses, first. Once you have done that, you can run test queries from the Windows box towards the Unix ones by using WinRM.  </p>
<p>For example, this is how I tested what the discovery for a Linux RedHat Computer type should be returning (I read that by opening the MP in authoring console, as one would usually do for any MP):  </p>
<p><b>winrm enumerate http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/</b><b>SCX_OperatingSystem?__cimnamespace=root/scx</b><b> -username:root -password:password -r:https://centos:1270/wsman -auth:basic</b>  </p>
<p>If you need to test the query directly *<b>ON</b>* the linux box (querying the CIMD instead than WSMAND), the <b>WBEMEXEC</b> utility is packaged with the agent (under <b>/opt/microsoft/scx/bin/tools </b>). It is not as easy as some windows administrators (that have used WBEMTEST or WMI Tools in the past) would hope, but not even that bad. Just to run a few queries to the CIM daemon locally it is not really interactive, so you need to create a XML file that looks like the following (basically you build the RAW request the way the CIMD accepts it):  </p>
<p>&nbsp; </p>
<p>&nbsp; </p>
</p>
<p>&lt;?xml version=&#034;1.0&#034; ?&gt; </p>
<p>&lt;CIM CIMVERSION=&#034;2.0&#034; DTDVERSION=&#034;2.0&#034;&gt; </p>
<p>&lt;MESSAGE ID=&#034;50000&#034; PROTOCOLVERSION=&#034;1.0&#034;&gt; </p>
<p>&lt;SIMPLEREQ&gt; </p>
<p>&lt;IMETHODCALL NAME=&#034;EnumerateInstanceNames&#034;&gt; </p>
<p>&lt;LOCALNAMESPACEPATH&gt; </p>
<p>&lt;NAMESPACE NAME=&#034;root&#034;/&gt; </p>
<p>&lt;NAMESPACE NAME=&#034;scx&#034;/&gt; </p>
<p>&lt;/LOCALNAMESPACEPATH&gt; </p>
<p>&lt;IPARAMVALUE NAME=&#034;ClassName&#034;&gt; </p>
<p>&lt;CLASSNAME NAME=&#034;SCX_OperatingSystem&#034;/&gt; </p>
<p>&lt;/IPARAMVALUE&gt; </p>
<p>&lt;/IMETHODCALL&gt; </p>
<p>&lt;/SIMPLEREQ&gt; </p>
<p>&lt;/MESSAGE&gt; </p>
<p>&lt;/CIM&gt; </p>
<p>&nbsp; </p>
<p>&nbsp; </p>
<p>Once you have made such a file, you can execute the query in the file with the tool like the following:  </p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="296" alt="./wbemexec -d2 query.xml" src="http://www.muscetta.com/wp-content/uploads/image005.png" width="640" border="0"/>  </p>
<p>&nbsp; </p>
<p>As you can see from here, CIMD uses HTTP already. This differs from Windows&#039; WMI that uses RPC/DCOM. In a way, this is much simpler to troubleshoot, and more firewall-friendly.  </p>
<p>&nbsp; </p>
<p>I have not really found an activity or debug log for any of those components, yet… but in the end they are not doing anything ON THEIR OWN, unless asked by the MS…. So the “healthservice” logic is all on the MS anyway. Errors about failed discoveries, permissions of the Action Account user, and anything else will be logged by the HealthService on the Windows machine (the Management Server) that is actually performing monitoring towards the Unix box.  </p>
<p>It really is *<b>just</b>* getting the WMI and WinRM-equivalent layer on linux/Unix up and running– after that, everything is done from windows anyway!  </p>
<p>After this common management infrastructure has been provided, 3<sup>rd</sup> parties will be facilitated in writing *<b>just</b>* MPs, without having to worry about the TRANSPORT of information anymore.  </p>
<p>&nbsp; </p>
<p>As you have probably noticed from the screenshots and commandlines, I don’t have a “real” Redhat Enterprise Linux or “supported” linux distribution… Therefore I started my testing using CentOS 5 (which is very similar to RHEL 5) &#8211; the agent installed fine as you can see, but I was not getting anything really “discovered” &#8211; the MP had only found a “linux computer” but was not finding any “RedHat” or “SuSe” or any other &#034;Operating System&#034; instances… and if you are somewhat familiar with the way <a href="http://technet.microsoft.com/en-us/library/bb309476.aspx">Operations Manager targeting</a> works, <a href="http://blogs.technet.com/momteam/archive/2007/10/31/targeting-series-part-1-differences-between-2005-and-2007.aspx">you would understand that monitors are targeted at object classes</a>. <a href="http://support.microsoft.com/kb/938999">If I don&#039;t have any instance of those objects being discovered, NO MONITORING actually happens</a>, even if the infrastructure is in place and the pieces are talking to each other:  </p>
<p>&nbsp;<img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="93" alt="CentOS not discovered" src="http://www.muscetta.com/wp-content/uploads/image006.png" width="640" border="0"/>  </p>
<p>Therefore my machine was not being monitored.  </p>
<p>In the end, I actually even got it to work, but I had to create a new Management Pack (exporting and modifying the RHEL5 one as a base) that would actually search for different Property values and discover CentOS instead as if it were RedHat:  </p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="140" alt="CentOS Discovered" src="http://www.muscetta.com/wp-content/uploads/image007.png" width="640" border="0"/>&nbsp;</p>
<p>After importing my hacked Management Pack the machine started to be monitored. Here you can see Health Explorer in all of its glory:</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="680" alt="image008" src="http://www.muscetta.com/wp-content/uploads/image008.png" width="999" border="0"/> </p>
<p>Of course this is a hack I made just to have a test setup somewhat working and to familiarize myself with the SCX components. It is not guaranteed that my Management pack actually works on CentOS the way it is supposed to work and that there aren&#039;t other &#8211; more subtle &#8211; differences between RedHat and CentOS that will make it fail. I only modified a couple of Discoveries to let it discover the &#034;Operating System&#034; instance&#8230; everything else should follow, but not necessarily. One difference you see already in the screenshot above is that I am not yet seeing the hardware being monitored, so my hack is already only partially working and <strong>it is definitely something that won&#039;t be supported</strong>, so I cannot provide it here. Also, this is a beta, so I I think that the Management Packs will be re-released with following beta versions, and this change is something that would need to be re-done all over again. Also, the unsupported distribution is the reason why I installed the agent manually in the first place, as the &#034;Discovery Wizard&#034; would not really &#034;agree&#034; to go and let me install the agent remotely on an unsupported &#034;platform!&#034;. </p>
<p>But I could not wait to see this working, <a href="https://www.redhat.com/apps/webform.html?event_type=simple_form&amp;eid=871">while waiting two business days (we are on a weekend!) for confirmation that I am allowed to actually download a 30-day-unsupported-Trial of the &#034;real&#034; RedHat Enteprise Linux</a>, so I cheated <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Disclaimer</strong></p>
<p>The information in this weblog is provided &#034;AS IS&#034; with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my own personal opinion. All code samples are provided &#034;AS IS&#034; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.<br />THIS WORK IS NOT ENDORSED AND NOT EVEN CHECKED, AUTHORIZED, SCRUTINIZED NOR APPROVED BY MY EMPLOYER, AND IT ONLY REPRESENT SOMETHING WHICH I&#039;VE DONE IN MY FREE TIME. NO GUARANTEE WHATSOEVER IS GIVEN ON THIS. THE AUTHOR SHALL NOT BE MADE RESPONSIBLE FOR ANY DAMAGE YOU MIGHT INCUR WHEN USING THIS INFORMATION.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/05/04/testing-system-center-cross-plaform-extentions/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Conversation about Blogs with a customer</title>
		<link>http://www.muscetta.com/2008/03/28/conversation-about-blogs-with-a-customer/</link>
		<comments>http://www.muscetta.com/2008/03/28/conversation-about-blogs-with-a-customer/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 14:24:17 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Blogs]]></category>
		<category><![CDATA[Choice]]></category>
		<category><![CDATA[Funny]]></category>
		<category><![CDATA[gapingvoid]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2008/03/28/conversation-about-blogs-with-a-customer/</guid>
		<description><![CDATA[I usually don&#039;t like mentioning specific facts that happened to me at work. But work is part of life, so even if this is mostly a personal blog, I cannot help myself but write about certain things that make me think when they happen.
When I end up having conversations such as this, I get really [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>I usually don&#039;t like mentioning specific facts that happened to me at work. But work is part of life, so even if this is mostly a personal blog, I cannot help myself but write about certain things that make me think when they happen.</p>
<p>When I end up having conversations such as this, I get really sad: I thought we had finally passed the arrogant period where we had to spoon-feed customers, and I thought we were now mature enough to consider them smart people and providing <a href="http://www.microsoft.com/powershell">cool, empowering technologies</a> for them to use. I also thought that pretty much everybody liked Microsoft finally opening up and actually talking TO people&#8230; not only talking them INTO buying something, something &#8211; but having real conversations.</p>
<p>I get sad when I find that people still don&#039;t seem to be accepting that, and wanting back the old model, instead. Kinda weird.</p>
<p>&nbsp;</p>
<p>The conversation goes as follows (words are not exactly those &#8211; we were speaking Italian and I sort of reconstructed the conversation &#8211; you should get the sense of it anyway):</p>
<p>&nbsp;</p>
<blockquote><p>[...]</p>
<p><strong>Me:</strong> &#034;The SDK service allows you to do quite a lot of cool stuff. Unfortunately not all of that functionality is completely or always easily exposed in the GUI. That is, for example: it is very EASY to define overrides, but it can get very tricky to find them back once set. That&#039;s why you can use <a href="http://blogs.msdn.com/boris_yanushpolsky/archive/2007/08/09/override-explorer-v3-3.aspx">this little useful tool</a> that the developer of that SDK service has posted on his blog&#8230;&#034; </p>
<p><strong>Cust:</strong> &#034;&#8230;but we can&#039;t just read blogs here and there!&#034; </p>
<p><strong>Me:</strong> &#034;Well, I mean, then you may have to wait for the normal release cycle. It might be that those improvements will make it in to the product. That might happen in months, if you are lucky, or maybe never. What&#039;s wrong if he publishes that on his blog, bypassing the bureaucracy crap, and makes your life easier with it RIGHT NOW?&#034; </p>
<p><strong>Cust:</strong> &#034;It is not official, I want it in the product!&#034; </p>
<p><strong>Me:</strong> &#034;I see, and even understand that. But right now that feature just isn&#039;t there. But you can use this tool to have it. Don&#039;t worry: it is not made by some random guy who wants to trojan your server! It is made by the very same developer who wrote the product itself&#8230;&#034; </p>
<p><strong>Cust:</strong> &#034;It is not supported, what if it breaks something?&#034; </p>
<p><strong>Me: </strong>&#034;So are all resource kit tools, in general. written by some dev guy in his free five minutes, and usually unsupported. Still very useful, though. Most of them. And they usually do work, you know that much, don&#039;t you?&#034; </p>
<p><strong>Cust:</strong> &#034;But why on a blog?&#034; </p>
<p><strong>Me:</strong> &#034;What&#039;s wrong with this? People are just trying to make customer&#039;s life easier by <a href="http://www.gapingvoid.com/Moveable_Type/archives/001607.html">being transparent and open and direct in their communication, just talking RIGHT to the customers. People talking to people</a>, bypassing the prehistoric bureaucracy structure of companies&#8230; the same happens on many other sites, just think <a href="http://isatools.org/">isatools.org</a> for example&#8230; those are just tools that a support guy like me has written and wants to share because they might be useful&#8230;&#034; </p>
<p><strong>Cust:</strong> &#034;But I can&#039;t follow/read all the blogs out there! I don&#039;t have time for it&#034; </p>
<p><strong>Me:</strong> &#034;Why not? I have thousands of feeds in my aggregator and&#8230;&#034; </p>
<p><strong>Cust:</strong> &#034;I don&#039;t have time and I don&#039;t want to read them, because I pay for support, so I don&#039;t expect this stuff to be in blogs&#034; </p>
<p><strong>Me:</strong> &#034;Well, I see, since you pay for support, you are paying ME &#8211; in fact I am working with you on this product precisely as part of that paid support. That&#039;s why I am here to tell you that this tool exists, in case you had not heard of it, so you actually know about it without having to read that yourself on any blog&#8230; does that sound like a deal? Where&#039;s the issue?&#034; </p>
<p><strong>Cust:</strong> &#034;Sgrunt. I want something official, I don&#039;t like this blog stuff&#034; </p>
<p>[...]</p>
</blockquote>
<p>&nbsp;</p>
<p>I thought this was particularly interesting, not because I want to make fun of this person. I do respect him and I think he just has a different point of view. But in my opinion this conversation shows (and made me think about) an aspect of that &#034;generation gap&#034; inside Microsoft that <a href="http://www.gapingvoid.com/Moveable_Type/archives/004459.html">Hugh talks about here</a>: </p>
<blockquote><p><em>&#034;[...]4.30 Hugh talks about a conversation he had with a few people inside Microsoft- how there’s a generation gap growing within the company, between the Old Guard, and the new generation of Microsofties, who see their company in much more open, organic terms.[...]&#034;</em> </p>
</blockquote>
<p>Basically this tells me that the generation gap is not happening only INSIDE Microsoft: it invests our customers too. Which makes it even more <a href="http://www.gapingvoid.com/Moveable_Type/archives/004181.html">difficult to talk to some of them, as we change</a>. Traditions are hard to change.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/03/28/conversation-about-blogs-with-a-customer/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Looking at OpsMgr2007 Alert trend with Command Shell</title>
		<link>http://www.muscetta.com/2008/01/25/looking-at-opsmgr2007-alert-trend-with-command-shell/</link>
		<comments>http://www.muscetta.com/2008/01/25/looking-at-opsmgr2007-alert-trend-with-command-shell/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 20:01:02 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[MOM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[Alert]]></category>
		<category><![CDATA[Command Shell]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[trend]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2008/01/25/looking-at-opsmgr2007-alert-trend-with-command-shell/</guid>
		<description><![CDATA[It&#039;s friday night, I am quite tired and I can&#039;t be asked of writing a long post. But I have not written much all week, not even updated my Twitter, and now I want to finish the week with at least some goodies. So this is the turn of a couple of Powershell commands/snippets/scripts that [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>It&#039;s friday night, I am quite tired and I can&#039;t be asked of writing a long post. But I have not written much all week, not even updated my Twitter, and now I want to finish the week with at least some goodies. So this is the turn of a couple of <a href="http://www.microsoft.com/powershell">Powershell</a> commands/snippets/scripts that will count alerts and events generated each day: this information could help you understand the trends of events and alerts over time in a Management Group. It is nothing fancy at all, but they can still be useful to someone out there. In the past (MOM 2005) I used to gather this kind of information with SQL Queries against the operations database. But now, with Powershell, everything is exposed as objects and it is much easier to get information without really getting your hands dirty with the database <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>#Number of Alerts per day</strong></p>
<p><em>$alerttimes = Get-Alert | Select-Object TimeRaised<br />
$array=@() </em></p>
<p><em>foreach ($datetime in $alerttimes){<br />
$array += $datetime.timeraised.date<br />
} </em></p>
<p><em>$array | Group-Object Date</em></p>
<p><strong>#Number of Events per day</strong></p>
<p><em>$eventtimes = Get-Event | Select-Object TimeGenerated<br />
$array=@() </em></p>
<p><em>foreach ($datetime in $eventtimes){<br />
$array += $datetime.timegenerated.date<br />
} </em></p>
<p><em>$array | Group-Object Date</em></p>
<p>Beware that these &#034;queries&#034; might take a long time to execute (especially the events one) depending on the amount of data and your retention policy.</p>
<p>This is of course just scratching the surface of the amount of amazing things you can do with Powershell in Operations Manager 2007. For this kind of information you might want to keep an eye on the official &#034;System Center Operations Manager Command Shell&#034; blog: <a href="http://blogs.msdn.com/scshell/" title="http://blogs.msdn.com/scshell/">http://blogs.msdn.com/scshell/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/01/25/looking-at-opsmgr2007-alert-trend-with-command-shell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simply Works</title>
		<link>http://www.muscetta.com/2007/12/27/simply-works/</link>
		<comments>http://www.muscetta.com/2007/12/27/simply-works/#comments</comments>
		<pubDate>Thu, 27 Dec 2007 18:24:27 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[MOM]]></category>
		<category><![CDATA[MOM2005]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[Blogs]]></category>
		<category><![CDATA[Choice]]></category>
		<category><![CDATA[Energy]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[lifestream]]></category>
		<category><![CDATA[Risk]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2007/12/27/simply-works/</guid>
		<description><![CDATA[
Simply Works, uploaded by Daniele Muscetta on Flickr.
I don&#039;t know about other people, but I do get a lot to think when the end of the year approaches: all that I&#039;ve done, what I have not yet done, what I would like to do, and so on&#8230;
And it is a period when memories surface.
I found [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p class="flickr-frame"><a title="photo sharing" href="http://www.flickr.com/photos/dani3l3/2141526220/"><img src="http://farm3.static.flickr.com/2222/2141526220_7754fa3134.jpg" alt="Simply Works" class="flickr-photo" /></a></p>
<p><span class="flickr-caption"><a href="http://www.flickr.com/photos/dani3l3/2141526220/">Simply Works</a>, uploaded by <a href="http://www.flickr.com/people/dani3l3/">Daniele Muscetta</a> on Flickr.</span></p>
<p class="flickr-yourcomment">I don&#039;t know about other people, but I do get a lot to think when the end of the year approaches: all that I&#039;ve done, what I have not yet done, what I would like to do, and so on&#8230;</p>
<p>And it is a period when memories surface.</p>
<p>I found the two old CD-ROMs you can see in the picture. And those are memories.<br />
missioncritical software was the company that invented a lot of stuff that became Microsoft&#039;s products: for example <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6f86937b-533a-466d-a8e8-aff85ad3d212&amp;displaylang=en">ADMT</a> and <a href="http://www.microsoft.com/systemcenter/opsmgr/default.mspx">Operations Manager</a>.</p>
<p>The black CD contains SeNTry, the &#034;enterprise event manager&#034;, what later became Operations Manager.<br />
On the back of the CD, the company motto at the time: &#034;software that works simply and simply works&#034;.<br />
So true. I might digress on this concept, but I won&#039;t do that right now.</p>
<p>I have already explained in my other blog <a href="http://blogs.msdn.com/dmuscett/archive/2005/09/02/459914.aspx">what I do for work</a>. Well, that was a couple of years ago anyway. Several things have changed, and we are moving towards offering services that are more measurable and professional. So, since it happens that in a certain job you need to be an &#034;expert&#034; and &#034;specialize&#034; in order to be &#034;seen&#034; or &#034;noticed&#034;.<br />
You know <a href="http://www.muscetta.com/2006/05/29/specialization-is-bullshit/">I don&#039;t really believe in specialization</a>. I have written it <a href="http://www.muscetta.com/2006/11/05/more-on-specialization/">all over the place</a>. But you need to make other people happy as well and let them believe what they want, so when you &#034;specialize&#034; they are happier. No, really, it might make a difference in your carrer <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>In this regard, I did also mention my <a href="http://blogs.msdn.com/dmuscett/archive/2004/11/18/263280.aspx">&#034;meeting again&#034; with Operations Manager</a>.<br />
That&#039;s where Operations manager helped me: it let me &#034;specialize&#034; in systems and applications management&#8230; a field where you need to know a bit of everything anyway: infrastructure, security, logging, scripting, databases, and so on&#8230; <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
This way, everyone wins.</p>
<p>Don&#039;t misunderstand me, this does not mean I want to know everything. One cannot possibly know everything, and the more I learn the more I believe I know nothing at all, to be honest. I don&#039;t know everything, <a href="http://thedailywtf.com/Articles/Classic-WTF-Lock-In-Key-Security.aspx">so please don&#039;t ask me everything &#8211; I work with mainframes</a> <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
While that can be a great excuse to avoid neighbours and relatives annoyances with their PCs though, on the serious side I still believe that any intelligent individual cannot be locked into doing a narrow thing and know only that one bit just because it is common thought that you have to act that way.</p>
<p>If I would <a href="http://twitter.com/gapingvoid/statuses/535752142">stop where I have to stop</a> I would be the standard &#034;IT Pro&#034;. I would be fine, sure, but I would get bored soon. I would not learn anything. <a href="http://www.muscetta.com/2007/09/11/itpro-vs-dev-there-is-no-such-a-thing/">But I don&#039;t feel I am the standard &#034;IT Pro&#034;</a>. In fact, funnily enough, <a href="http://www.google.com/search?hl=en&amp;q=link:www.muscetta.com&amp;btnG=Search">on some other blogs out there I have been referenced as a &#034;Dev&#034;</a> (find it on your own, look at their blogrolls <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). But I am not a Dev either then&#8230; I don&#039;t write code for work. I would love to, but I rarely actually do, other than some scripts. Anyway, I tend to escape the definition of the usual &#034;expert&#034; on something&#8230; mostly because I want to escape it. I don&#039;t see myself represented by those generalization.</p>
<p>As <a href="http://haacked.com/archive/2007/12/21/faceoff-haack-vs-hanselman-it-gets-real.aspx">Phil puts it</a>, when asked &#034;Are software developers &#8211; engineers or artists?&#034;:</p>
<blockquote><p>&#034;[...] Don’t take this as a copout, but a little of both. I see it more as craftsmanship. Engineering relies on a lot of science. Much of it is demonstrably empirical and constrained by the laws of physics. Software is less constrained by physics as it is by the limits of the mind. [...]&#034;</p></blockquote>
<p>Craftmanship. Not science.<br />
And stop calling me an &#034;engineer&#034;. I am not an engineer. I was even crap in math, in school!</p>
<p>Anyway, what does this all mean? In practical terms, it means that in the end, wether I want it or not, I do get considered an &#034;expert&#034; on MOM and OpsMgr&#8230; and that I will mostly work on those products for the next year too. But that is not bad, because, as I said, working on that product means working on many more things too. Also, I can point to different audiences: those believing in &#034;experts&#034; and those going beyond schemes. It also means that I will have to continue teaching a couple of scripting classes (both VBScript and PowerShell) that nobody else seems to be willing to do (because they are all *expert* in something narrow), and that I will still be hacking together my other stuff (my facebook apps, my wordpress theme and plugins, my server, etc) and even continue to have strong opinions in those other fields that I find interesting and where I am not considered an *expert* <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Well, I suppose I&#039;ve been ranting enough for today&#8230;and for this year <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
I really want to wish everybody again a great beginning of 2008!!! What are you going to be busy with, in 2008 ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2007/12/27/simply-works/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Monitoring Syslog with OpsMgr 2007</title>
		<link>http://www.muscetta.com/2007/11/09/monitoring-syslog-with-opsmgr-2007/</link>
		<comments>http://www.muscetta.com/2007/11/09/monitoring-syslog-with-opsmgr-2007/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 12:45:05 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[MOM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[Cross Post]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Interop]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2007/11/09/monitoring-syslog-with-opsmgr-2007/</guid>
		<description><![CDATA[I had missed it&#8230; finally guidance on how to collect and monitor UNIX syslog in System Center Operations Manager 2007 has been published!
This is much more sysadmin-oriented than what was availble before (that remais of course still relevant, but more from a Management Pack developer&#039;s point of view, who wants to know how things work [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>I had missed it&#8230; finally guidance on <a href="http://support.microsoft.com/kb/942863">how to collect and monitor UNIX syslog in System Center Operations Manager 2007</a> has been published!</p>
<p>This is much more sysadmin-oriented than <a href="http://blogs.msdn.com/komal/archive/2007/10/05/syslog-module-enhanced.aspx">what was availble before</a> (that remais of course still relevant, but more from a Management Pack developer&#039;s point of view, who wants to know how things work &#034;behind the hood&#034;).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2007/11/09/monitoring-syslog-with-opsmgr-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a Script-Based Unit Monitor in OpsMgr2007 via the GUI</title>
		<link>http://www.muscetta.com/2007/05/10/create-a-script-based-unit-monitor-in-opsmgr2007-via-the-gui/</link>
		<comments>http://www.muscetta.com/2007/05/10/create-a-script-based-unit-monitor-in-opsmgr2007-via-the-gui/#comments</comments>
		<pubDate>Thu, 10 May 2007 20:31:40 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[MOM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA["Management Packs"]]></category>
		<category><![CDATA[authoring]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[management pack]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[MP]]></category>
		<category><![CDATA[MPs]]></category>
		<category><![CDATA[opsmgr]]></category>
		<category><![CDATA[scom]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2007/05/10/create-a-script-based-unit-monitor-in-opsmgr2007-via-the-gui/</guid>
		<description><![CDATA[Warning for people who landed here: this post is VERY OLD. It was written in the early days of struggling with OpsMgr 2007, and when nobody really knew how to do things.
I found that this way was working &#8211; and it surely does &#8211; but what is described here is NOT the recommended way to [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p><span style="color: red;"><strong>Warning for people who landed here: this post is VERY OLD. It was written in the early days of struggling with OpsMgr 2007, and when nobody really knew how to do things.<br />
I found that this way was working &#8211; and it surely does &#8211; but what is described here is NOT the recommended way to do things nowadays. This post was only meant to fill in a gap I was feeling existed, back in 2007.<br />
But as time passes, and documentation gets written, knowledge improves.<br />
Therefore, I recommend you read the newly released Composition chapter of the MP Authoring Guide instead<br />
<a href="http://technet.microsoft.com/en-us/library/ff381321.aspx">http://technet.microsoft.com/en-us/library/ff381321.aspx</a> &#8211; and start building your custom modules to embed scripts as <a href="http://blogs.technet.com/brianwren">Brian Wren</a> describes in there, so that you can share them between multiple rules and monitors.</strong></span><br />
This said, below is the original post.</p>
<p><!--  .flickr-photo { border: solid 2px #000000; } .flickr-yourcomment { } .flickr-frame { text-align: left; padding: 3px; } .flickr-caption { font-size: 0.8em; margin-top: 0px; }  --></p>
<p class="flickr-frame"><a title="photo sharing" href="http://www.flickr.com/photos/dani3l3/492786198/"><img class="flickr-photo" src="http://farm1.static.flickr.com/221/492786198_d85d81a5b4.jpg" alt="Create a Script-Based Unit Monitor in OpsMgr2007 via the GUI" /></a><span class="flickr-caption"><a href="http://www.flickr.com/photos/dani3l3/492786198/"></a></span></p>
<p class="flickr-yourcomment">There is not a lot of documentation for System Center Operations Manager 2007 yet.<br />
It is coming, but there&#039;s a lot of things that changed since the previous release and I think some more would only help. Also, a lot of the content I am seeing is either too newbie-oriented or too developer-oriented, for some reason.</p>
<p>I have not yet seen a tutorial, webcast or anything that explains how to create a simple unit monitor that uses a VBS script using the GUI.</p>
<p>So this is how you do it:</p>
<p>Go to the <strong>&#034;Authoring&#034;</strong> space of OpsMgr 2007 Operations Console.<br />
Select the <strong>&#034;Management Pack objects&#034;</strong>, then <strong>&#034;Monitors&#034;</strong> node. Right click and choose <strong>&#034;Create a monitor&#034;</strong> -&gt; <strong>&#034;Unit Monitor&#034;</strong>.</p>
<p>You get the &#034;Create a monitor&#034; wizard open:<br />
<a href="http://www.flickr.com/photos/dani3l3/492786202/"><img src="http://farm1.static.flickr.com/202/492786202_861b4818fa.jpg" alt="wizard02" width="500" height="444" /></a></p>
<p>Choose to create a two-states unit monitor based on a script. Creating a three- state monitor would be pretty similar, but I&#039;ll show you the most simple one.<br />
Also, choose a Management pack that will contain your script and unit monitor, or create a new management pack.<br />
<a href="http://www.flickr.com/photos/dani3l3/492786204/"><img src="http://farm1.static.flickr.com/220/492786204_57fb878a47.jpg" alt="wizard03" width="500" height="444" /></a></p>
<p>Choose a &#034;monitor target&#034; (object classes or instances &#8211; see this webcast about targeting rules and monitors: <a href="http://www.microsoft.com/winme/0703/28666/Target_Monitoring_Edited.asx">www.microsoft.com/winme/0703/28666/Target_Monitoring_Edit&#8230;</a> ) and the aggregate rollup monitor you want to roll the state up to.</p>
<p>Choose a schedule, that is: how often would you like your script to run. For demonstration purposes I usually choose a very short interval such a two or three minutes. For production environments, tough, choose a longer time range.<br />
<a href="http://www.flickr.com/photos/dani3l3/492786208/"><img src="http://farm1.static.flickr.com/231/492786208_b48ef74259.jpg" alt="wizard04" width="500" height="444" /></a></p>
<p>Choose a name for your script, complete with a .VBS extension, and write the code of the script in the rich text box:<br />
<a href="http://www.flickr.com/photos/dani3l3/492786212/"><img src="http://farm1.static.flickr.com/196/492786212_60a675bdf5.jpg" alt="wizard05" width="500" height="444" /></a></p>
<p>As the sample code and comments suggest, you should use a script that checks for the stuff you want it to check, and returns a &#034;Property Bag&#034; that can be later interpreted by OpsMgr workflow to change the monitor&#039;s state.<br />
This is substantially different than scripting in MOM 2005, where you could only launch scripts as responses, loosing all control over their execution.</p>
<p>For demonstration purpose, use the following script code:<br />
<em> </em></p>
<p><em>On Error Resume Next<br />
Dim oAPI, oBag<br />
Set oAPI = CreateObject(&#034;MOM.ScriptAPI&#034;)<br />
Set oBag = oAPI.CreateTypedPropertyBag(StateDataType)<br />
Const FOR_APPENDING = 8<br />
strFileName = &#034;c:\testfolder\testfile.txt&#034;<br />
strContent = &#034;test &#034;<br />
Set objFS = CreateObject(&#034;Scripting.FileSystemObject&#034;)<br />
Set objTS = objFS.OpenTextFile(strFileName,FOR_APPENDING)<br />
If Err.Number &lt;&gt; 0 Then<br />
Call oBag.AddValue(&#034;State&#034;,&#034;BAD&#034;)<br />
Else<br />
Call oBag.AddValue(&#034;State&#034;,&#034;GOOD&#034;)<br />
objTS.Write strContent<br />
End If<br />
Call oAPI.Return(oBag)</em><em><br />
</em></p>
<p>[edited on 29th of May as <a href="http://ianblythmanagement.wordpress.com/2007/05/27/scripting-in-2007/">pointed out by Ian</a>: if you cut and paste the example script you might need to change the apostrophes (“) as that causes the script to fail when run - it is an issue with the template of this blog.] [edited on 30th of May: I fixed the blog so that now post content shows just plain, normal double quotes instead than fancy ones. It seems like a useful thing when from time to time I post code...]</p>
<p>The script will try to write into the file c:\testfolder\testfile.txt.<br />
If it finds the file and manages to write (append text) to it, it will return the property &#034;State&#034; with a value of &#034;GOOD&#034;.<br />
If it fails (for example if the file does not exist), it will return the property &#034;State&#034; with a value of &#034;BAD&#034;.</p>
<p>In MOM 2005 you could only let script generate Events or Alerts directly as a mean to communicate their results back to the monitoring engine. In OpsMgr 2007 you can let your script spit out a property bag and then continue the monitoring workflow and decide what to do depending on the script&#039;s result.</p>
<p><a href="http://www.flickr.com/photos/dani3l3/492786214/"><img src="http://farm1.static.flickr.com/225/492786214_96af0cc463.jpg" alt="wizard06" width="500" height="444" /></a></p>
<p>So the next step is to go and check for the value of the property we return in the property bag, to determine which status the monitor will have to assume.</p>
<p>We use the syntax <strong>Property[@Name='State']</strong> in the parameter field, and we search for a content that means an unhealthy condition:</p>
<p><a href="http://www.flickr.com/photos/dani3l3/492787088/"><img src="http://farm1.static.flickr.com/217/492787088_3b3107fb59.jpg" alt="wizard07" width="500" height="444" /></a></p>
<p>Or for the healty one:<br />
<a href="http://www.flickr.com/photos/dani3l3/492787092/"><img src="http://farm1.static.flickr.com/207/492787092_a8559eecf5.jpg" alt="wizard08" width="500" height="444" /></a></p>
<p>Then we decide which status will the monitor have to assume in the healty and unhealty conditions (Green/Yellow or Green/Red usually)<br />
<a href="http://www.flickr.com/photos/dani3l3/492787094/"><img src="http://farm1.static.flickr.com/223/492787094_fac28573d3.jpg" alt="wizard09" width="500" height="444" /></a></p>
<p>Optionally, we can decide to raise an Alert when the status changes to unhealthy, and close it again when it goes back to healty.</p>
<p><a href="http://www.flickr.com/photos/dani3l3/492787098/"><img src="http://farm1.static.flickr.com/194/492787098_72d6ad227f.jpg" alt="wizard10" width="500" height="444" /></a></p>
<p>Now our unit monitor is done.<br />
All we have to do is waiting it gets pushed down to the agent(s) that should execute it, and wait for its status to change.<br />
In fact it should go to the unhealthy state first.<br />
To test that it works, just create the text file it will be searching for, and wait for it to run again, and the state should be reset to Healthy.</p>
<p>Have fun with more complex scripts!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2007/05/10/create-a-script-based-unit-monitor-in-opsmgr2007-via-the-gui/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
<enclosure url="http://www.microsoft.com/winme/0703/28666/Target_Monitoring_Edited.asx" length="126" type="video/x-ms-asf" />
		</item>
		<item>
		<title>MOM2005 vs. OpsMgr2007 and ITIL ?</title>
		<link>http://www.muscetta.com/2007/04/27/mom2005-vs-opsmgr2007-and-itil/</link>
		<comments>http://www.muscetta.com/2007/04/27/mom2005-vs-opsmgr2007-and-itil/#comments</comments>
		<pubDate>Fri, 27 Apr 2007 13:05:30 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
				<category><![CDATA[MOM]]></category>
		<category><![CDATA[MOM2005]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpsMgr2007]]></category>
		<category><![CDATA[System Center Operations Manager 2007]]></category>
		<category><![CDATA[Choice]]></category>
		<category><![CDATA[Cross Post]]></category>
		<category><![CDATA[Interop]]></category>
		<category><![CDATA[ITIL]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2007/04/27/mom2005-vs-opsmgr2007-and-itil/</guid>
		<description><![CDATA[&#160;
MOM has always been a great tool out of the box because it sort of FORCED you to implement an Incident Management Process to deal with Alerts, as described here:http://ianblythmanagement.wordpress.com/2006/07/27/mom-2005-and-itil-part-1/In fact, Alerts had to be actually set to &#034;Resolved&#034;, and this had to be done manually. 
I have now been wondering for a while: &#034;How [...]<hr /><a href="http://www.muscetta.com/about-me/">About Daniele Muscetta</a><hr />]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>MOM has always been a great tool out of the box because it sort of FORCED you to implement an Incident Management Process to deal with Alerts, as described here:<br /><a href="http://ianblythmanagement.wordpress.com/2006/07/27/mom-2005-and-itil-part-1/">http://ianblythmanagement.wordpress.com/2006/07/27/mom-2005-and-itil-part-1/</a><br />In fact, Alerts had to be actually set to &#034;Resolved&#034;, and this had to be done manually. </p>
<p>I have now been wondering for a while: &#034;How is OpsMgr2007 going to affect this?&#034; I refer to the fact that now OpsMgr2007 does something customers have been asking for a while: it can auto-resolve alerts as soon as the incident/issue is fixed, by monitoring the state of the component rather than waiting for people to resolve it!  </p>
<p>Practically, people were often the bottleneck, due to a missing Incident Management Process. MOM has tried for nearly 8 years to push them to implement one&#8230; and I feel that it finally gave up even trying. </p>
<p>All the other stuff described in the other <a href="http://ianblythmanagement.wordpress.com/2006/07/27/mom-2005-and-itil-part-2/">two</a> <a href="http://ianblythmanagement.wordpress.com/2006/07/27/mom-2005-and-itil-part-3/">articles</a> of Ian&#039;serie do still apply.  </p>
<p>For Capacity Management nothing substantially changes.<br />Availability Management is greatly improved, with the generic &#034;availability report&#034; and the state roll-up feature provided by the new Health Service and the new ways object are discovered and instantiated and the way their health models work.  </p>
<p>Problem Management can also still be done, and Alert tuning will be still required (but it should be slightly easier now, with the improved &#034;overrides&#034; kind of thing).<br />Service Level Management can also be done &#8211; this will actually be done much better: if the system <strong>knows</strong> you&#039;ve fixed the incident and it closes the alert for you, SLA calculations will be done on the REAL down/up-times of services, not on people keeping the Alerts open forever like I have seen in many places.<br />This means it will be done better, WITHOUT relying on people.  </p>
<p>All in all there are substantial changes in OpsMgr2007, most of them are for the good&#8230;. but still, I think, I will be missing the fact that people have to actively look at their consoles and manage Alerts the way they were asked to do before. I will miss all the talks I used to do about &#034;you HAVE to manage your Alerts/Incidents&#034;, now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2007/04/27/mom2005-vs-opsmgr2007-and-itil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
