<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Operating-Quadrant</title>
	<atom:link href="http://operatingquadrant.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://operatingquadrant.com</link>
	<description>Living in the I.T. Operating Quadrant. Useful articles on real world solutions involving Monitoring (System Center Operations Manager), Virtualization, Reporting, Scripting (PowerShell), and much more.</description>
	<lastBuildDate>Fri, 27 Jan 2012 19:05:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='operatingquadrant.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Operating-Quadrant</title>
		<link>http://operatingquadrant.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://operatingquadrant.com/osd.xml" title="Operating-Quadrant" />
	<atom:link rel='hub' href='http://operatingquadrant.com/?pushpress=hub'/>
		<item>
		<title>OpsMgr 2012 UNIX/Linux Authoring Templates:  Process Monitoring</title>
		<link>http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/</link>
		<comments>http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 19:05:13 +0000</pubDate>
		<dc:creator>Kristopher Bash</dc:creator>
				<category><![CDATA[System Center Operations Manager]]></category>
		<category><![CDATA[UNIX/LInux]]></category>

		<guid isPermaLink="false">http://operatingquadrant.com/?p=655</guid>
		<description><![CDATA[In Operations Manager, custom rules and monitors can be used to extensively build on the out-of-the-box Management Pack contents. Unfortunately, this kind of custom authoring for UNIX/Linux monitoring carried a steep learning curve with OpsMgr 2007 R2. However, the 2012 release of Operations Manager has some new features to enable many common UNIX/Linux authoring scenarios [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=655&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In Operations Manager, custom rules and monitors can be used to extensively build on the out-of-the-box Management Pack contents. Unfortunately, this kind of custom authoring for UNIX/Linux monitoring carried a steep learning curve with OpsMgr 2007 R2. However, the 2012 release of Operations Manager has some new features to enable many common UNIX/Linux authoring scenarios using templates, <em>directly from the console</em>.  The first of these new templates I wanted to cover is the new process monitoring template.</p>
<h3><strong>UNIX/Linux Process Monitoring Template</strong></h3>
<p>Operations Manager 2007 R2 included the Unix Service Monitoring template for custom monitoring of daemons on UNIX and Linux agents.   This template has been replaced in the System Center 2012 release of Operations Manager with the far more capable UNIX/Linux Process Monitoring template.   The new UNIX/Linux Process Monitoring template allows more flexibility in process/daemon monitoring, including the ability to monitor for minimum and maximum process count thresholds, and the ability to filter processes on arguments in addition to the process name. For this example, I will walk through the use the UNIX/Linux Process Monitoring template to monitor a Tomcat daemon.</p>
<p>The UNIX/Linux Process Monitoring template is accessible in the Authoring Pane of the Operations Console.   It can be launched with the “Add Monitoring Wizard” task under the Management Pack Templates view.</p>
<p><a href="http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/template1/" rel="attachment wp-att-656"><img class="alignnone  wp-image-656" title="Process Template: Add Monitoring Wizard" src="http://operatingquadrant.files.wordpress.com/2012/01/template1.jpg?w=400&#038;h=257" alt="" width="400" height="257" /></a></p>
<p><span id="more-655"></span></p>
<p>Input a name, description, and select the target management pack (where the template-created MP elements will be saved).</p>
<p><a href="http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/template2-2/" rel="attachment wp-att-663"><img class="alignnone size-medium wp-image-663" title="Process Template Name and Description" src="http://operatingquadrant.files.wordpress.com/2012/01/template21-e1327550026555.jpg?w=400&#038;h=318" alt="" width="400" height="318" /></a></p>
<p>The next page is the details page, where process information is input.   If you already know the process name, you can just type that in and select the group to target.  Alternatively, you can click <strong>Select a Process</strong> to connect to an agent and list the currently running processes.</p>
<p><a href="http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/template3/" rel="attachment wp-att-664"><img class="alignnone size-medium wp-image-664" title="Process Template Details Page" src="http://operatingquadrant.files.wordpress.com/2012/01/template3-e1327550140140.png?w=400&#038;h=314" alt="" width="400" height="314" /></a></p>
<p>In this case, I will connect to an agent and enumerate the running processes.  The Tomcat daemon is a Java process, so I select the process named: <em>java</em>.</p>
<p><a href="http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/template4/" rel="attachment wp-att-665"><img class="alignnone size-medium wp-image-665" title="Process Template Details Page 2" src="http://operatingquadrant.files.wordpress.com/2012/01/template4-e1327550327767.png?w=400&#038;h=316" alt="" width="400" height="316" /></a></p>
<p>In the bottom field of the details dialog, the running processes on the agent that match the selected name are listed.   This particular agent is also running WebSphere, and its process also has the name: java, which is why two java processes are listed in this field.   As I only want to monitor the Tomcat daemon with this particular monitor, I don’t want the WebSphere process to affect the monitoring.   While the two processes share the same name, they have different process arguments.  The <strong>Regular expression to filter process arguments</strong> field allows me to input a regular expression that will be evaluated against the process arguments.   Only processes that match the regular expression will be included in this monitor.   So, I can input a regular expression of <strong>^.+tomcat.+</strong> and only processes with a name of “java” that have the string: tomcat in their arguments list will be evaluated by the monitor.   The wizard filters the list of running processes on the fly to show what will be evaluated with a given regular expression.</p>
<p>A few notes on this functionality:</p>
<ul>
<li>The regular expression filtering by arguments is an optional function.  If you just want to monitor processes by name, you can leave this field blank.</li>
<li>The regular expression is evaluated against all arguments as one long string.  That is, the arguments (argv[0] – argv[&lt;max&gt;]) are concatenated with a  space separator, and the regular expression is evaluated against this concatenated string.</li>
<li>The regular expression filtering is performed on the Windows-side (Health Service), not on the UNIX/Linux agent. Thus, .NET regular expressions are used (this differs from the log file monitoring template where the regular expression matching is performed on the UNIX/Linux agent).</li>
<li>If you know the regular expression that you want to use, and you are targeting a group, you can just select a group, and type the process name and regular expression into the field without connecting to an agent.   However, if you want to test the regular expression in the wizard, you need to use the <strong>Select a process</strong> function to connect to an agent and list running processes that match the selected name.   Once you are satisfied with the arguments filter, you can retarget the monitor to a group by clicking <strong>Select a group</strong>.    The filtering by arguments functionality works whether you are targeting a single agent or a group, but testing it requires connecting to an agent to list the running processes.</li>
</ul>
<p><a href="http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/template5/" rel="attachment wp-att-666"><img class="alignnone size-medium wp-image-666" title="Process Template Details Page 3" src="http://operatingquadrant.files.wordpress.com/2012/01/template5-e1327550478428.png?w=400&#038;h=311" alt="" width="400" height="311" /></a></p>
<p><a href="http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/template6/" rel="attachment wp-att-667"><img class="alignnone size-medium wp-image-667" title="Process Template Details Page 4" src="http://operatingquadrant.files.wordpress.com/2012/01/template6-e1327550591950.png?w=400&#038;h=312" alt="" width="400" height="312" /></a></p>
<p>On the next page, optional minimum and maximum thresholds can be set for the acceptable count of processes that match the name and optional arguments filter.  For example, to monitor that at least one instance of a process is running, set a minimum threshold of 1, to alert if any instances of a process are running, set a maximum threshold of 0.  To monitor that no less than 5 and no more than 10 instances of a process is running, set a minimum threshold of 5 and a maximum of 10.   Note:  the process count is calculated after the optional arguments filter is applied.   So in this example, the WebSphere “java” process will not be included in the process count, because the ^.+tomcat.+ filter was applied to the arguments.</p>
<p><a href="http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/template7/" rel="attachment wp-att-668"><img class="alignnone size-medium wp-image-668" title="Process Template Settings Page" src="http://operatingquadrant.files.wordpress.com/2012/01/template7-e1327550705956.png?w=400&#038;h=319" alt="" width="400" height="319" /></a></p>
<p>All done:</p>
<p><a href="http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/template8/" rel="attachment wp-att-669"><img class="alignnone size-medium wp-image-669" title="Process Template Summary Page" src="http://operatingquadrant.files.wordpress.com/2012/01/template8-e1327551034163.png?w=400&#038;h=312" alt="" width="400" height="312" /></a></p>
<p>When I kill the Tomcat daemon, this is what the alert looks like:</p>
<p><a href="http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/template9/" rel="attachment wp-att-670"><img class="alignnone size-medium wp-image-670" title="Process Template Alert" src="http://operatingquadrant.files.wordpress.com/2012/01/template9-e1327551136746.png?w=400&#038;h=368" alt="" width="400" height="368" /></a></p>
<p><strong>Note:</strong></p>
<p>Despite similar functionality to the Unix Service Template from 2007 R2, the new UNIX/Linux Process Monitoring template is an entirely new template. If you are upgrading from 2007 R2 to 2012, both templates will be available. To make use of the new functionality in the process template, you will need to create new instances to replace the previous instances created by the Unix Service Template.</p>
<h3>Performance and Cookdown Considerations</h3>
<p>Each unique process name that is specified in a process template will involve one WSMan query to the agent per polling interval.  Multiple template instances that inspect a single process name but implement unique regular expression filtering will cookdown into a single WSMan query to the agent per polling interval. For example, if ten process template instances target a single host and all monitor a process named java with distinct process argument filters (RegExp), only one WSMan query will be sent to the agent per polling interval.  If ten process template instances target a single host and each monitors a unique process name (processA, processB, etc.), ten WSMan queries will be sent to the agent per polling interval.</p>
<p>In cases where a large number of unique process names need to be monitored, process argument filtering is not required, and the monitored agents do not have a large number of running processes (with sizable parameter strings), custom MP authoring can be used to create a cookdown-optimized monitor type that enumerates SCX_UnixProcess with the filter: Select Name, Parameters from SCX_UnixProcess. This would allow all of the process monitors to cookdown to a single WSMan query assuming all other configuration parameters (such as Interval) are aligned.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/operatingquadrant.wordpress.com/655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/operatingquadrant.wordpress.com/655/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/operatingquadrant.wordpress.com/655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/operatingquadrant.wordpress.com/655/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/operatingquadrant.wordpress.com/655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/operatingquadrant.wordpress.com/655/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/operatingquadrant.wordpress.com/655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/operatingquadrant.wordpress.com/655/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/operatingquadrant.wordpress.com/655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/operatingquadrant.wordpress.com/655/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/operatingquadrant.wordpress.com/655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/operatingquadrant.wordpress.com/655/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/operatingquadrant.wordpress.com/655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/operatingquadrant.wordpress.com/655/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=655&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://operatingquadrant.com/2012/01/27/opsmgr-2012-unixlinux-authoring-templates-process-monitoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/26f47dda05ea2d756f1f83f1164605aa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">KB</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2012/01/template1.jpg?w=400" medium="image">
			<media:title type="html">Process Template: Add Monitoring Wizard</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2012/01/template21-e1327550026555.jpg?w=400" medium="image">
			<media:title type="html">Process Template Name and Description</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2012/01/template3-e1327550140140.png?w=400" medium="image">
			<media:title type="html">Process Template Details Page</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2012/01/template4-e1327550327767.png?w=400" medium="image">
			<media:title type="html">Process Template Details Page 2</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2012/01/template5-e1327550478428.png?w=400" medium="image">
			<media:title type="html">Process Template Details Page 3</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2012/01/template6-e1327550591950.png?w=400" medium="image">
			<media:title type="html">Process Template Details Page 4</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2012/01/template7-e1327550705956.png?w=400" medium="image">
			<media:title type="html">Process Template Settings Page</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2012/01/template8-e1327551034163.png?w=400" medium="image">
			<media:title type="html">Process Template Summary Page</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2012/01/template9-e1327551136746.png?w=400" medium="image">
			<media:title type="html">Process Template Alert</media:title>
		</media:content>
	</item>
		<item>
		<title>OpsMgr: UNIX/Linux Heartbeat Failures After Applying KB2585542</title>
		<link>http://operatingquadrant.com/2012/01/12/opsmgr-unixlinux-heartbeat-failures-after-applying-kb2585542/</link>
		<comments>http://operatingquadrant.com/2012/01/12/opsmgr-unixlinux-heartbeat-failures-after-applying-kb2585542/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 22:27:14 +0000</pubDate>
		<dc:creator>Kristopher Bash</dc:creator>
				<category><![CDATA[SCOM]]></category>
		<category><![CDATA[SCX]]></category>
		<category><![CDATA[System Center Operations Manager]]></category>
		<category><![CDATA[UNIX/LInux]]></category>

		<guid isPermaLink="false">http://operatingquadrant.com/?p=644</guid>
		<description><![CDATA[The OpsMgr UNIX/Linux monitoring team at Microsoft is currently investigating an issue that results in heartbeat failures on Operations Manager UNIX/Linux agents after the security update KB2585542 is applied to a Management Server or Gateway.  This update fixes a vulnerability in SSL/TLS1.0, but appears to cause WS-Management connections to UNIX/Linux agents to fail.  The vulnerability is described [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=644&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The OpsMgr UNIX/Linux monitoring team at Microsoft is currently investigating an issue that results in heartbeat failures on Operations Manager UNIX/Linux agents after the security update KB2585542 is applied to a Management Server or Gateway.  This update fixes a vulnerability in SSL/TLS1.0, but appears to cause WS-Management connections to UNIX/Linux agents to fail. </p>
<p>The vulnerability is described in bulletin <a href="http://technet.microsoft.com/en-us/security/bulletin/ms12-006">MS12-006</a>, and more information can be found in the <a href="http://support.microsoft.com/kb/2643584">KB article</a>.  While we continue to investigate options for resolving this issue, there are two viable workarounds (which must be applied to all Mgmt Servers and Gateways that manage UNIX/Linux agents):</p>
<ol>
<li>Uninstall the update KB2585542 </li>
<li>Make a registry modification to disable the SecureChannel changes implemented in the update</li>
</ol>
<p>Note: the registry modification described here and in the KB article effectively disables the security fix that the update implements, so the modified system is subject to the same vulnerability as an unpatched system.</p>
<p><strong>Modifying the registry to disable the SecureChannel changes:</strong></p>
<ul>
<li>A &#8220;FixIt&#8221; package is available in the <a href="http://support.microsoft.com/kb/2643584">KB article</a> under the <strong>Known Issues</strong> section that can be used to disable the security update</li>
<li>Alternatively, you can add the 32bit DWORD value:<br />
<em>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control<br />
\SecurityProviders\SCHANNEL\</em><br />
<em> SendExtraRecord = 2</em></li>
</ul>
<p>These changes take effect immediately and do not require a reboot.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/operatingquadrant.wordpress.com/644/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/operatingquadrant.wordpress.com/644/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/operatingquadrant.wordpress.com/644/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/operatingquadrant.wordpress.com/644/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/operatingquadrant.wordpress.com/644/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/operatingquadrant.wordpress.com/644/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/operatingquadrant.wordpress.com/644/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/operatingquadrant.wordpress.com/644/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/operatingquadrant.wordpress.com/644/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/operatingquadrant.wordpress.com/644/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/operatingquadrant.wordpress.com/644/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/operatingquadrant.wordpress.com/644/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/operatingquadrant.wordpress.com/644/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/operatingquadrant.wordpress.com/644/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=644&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://operatingquadrant.com/2012/01/12/opsmgr-unixlinux-heartbeat-failures-after-applying-kb2585542/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/26f47dda05ea2d756f1f83f1164605aa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">KB</media:title>
		</media:content>
	</item>
		<item>
		<title>Operations Manager UNIX/Linux Agent Certificates (and using a PKI)</title>
		<link>http://operatingquadrant.com/2011/11/23/operations-manager-unixlinux-agent-certificates-and-using-a-pki/</link>
		<comments>http://operatingquadrant.com/2011/11/23/operations-manager-unixlinux-agent-certificates-and-using-a-pki/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 05:05:01 +0000</pubDate>
		<dc:creator>Kristopher Bash</dc:creator>
				<category><![CDATA[System Center Operations Manager]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[UNIX/LInux]]></category>

		<guid isPermaLink="false">http://operatingquadrant.com/?p=638</guid>
		<description><![CDATA[Introduction UNIX and Linux agent monitoring in Operations Manager requires certificates to secure the SSL communication channel between the Management Servers and agents.  In this post, I will provide some background information on this communication and the certificates, as well as describe an optional approach to replace the default Operations Manager certificate infrastructure with your organization’s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=638&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>UNIX and Linux agent monitoring in Operations Manager requires certificates to secure the SSL communication channel between the Management Servers and agents.  In this post, I will provide some background information on this communication and the certificates, as well as describe an optional approach to replace the default Operations Manager certificate infrastructure with your organization’s Public Key Infrastructure.</p>
<h2>The Protocols</h2>
<p>The Operations Manager UNIX/Linux agent is a very lightweight agent implementation, comprising a CIM Object Manager (OpenPegasus) and CIM Providers.   Unlike Operations Manager Windows agents, the UNIX/Linux agent doesn’t have a health service, and doesn’t run workflows locally.  Rather, the Management Server (or Gateway) that manages the agent runs the workflows and remotely connects to the UNIX/Linux agent to retrieve current data.  </p>
<p>There are two protocols involved in the communication between the Management Server and the UNIX/Linux agent:  ssh and WS-Management.   </p>
<p>Ssh is used purely for agent maintenance activities, and is not used for any monitoring.   Operations like agent installation, uninstallation, upgrade, or agent daemon restart (through a recovery task) are executed over ssh.    Ssh facilitates the transfer of files and execution of remote commands for these operations when the agent daemon is unavailable.  </p>
<p>WS-Management (or WSMan) is the core protocol used in UNIX/Linux monitoring.   WSMan is a SOAP-based protocol for cross-platform management.   All monitoring operations (e.g. enumerating CIM providers for data on file systems, memory, etc, execution of commands/scripts for monitoring, executing log file reads for monitoring) are implemented over WSMan.   As WSMan is a web service protocol, the OpenPegasus-based CIMOM functions as a secure web server (user credentials are authenticated through PAM).  This is where the agent certificate comes in to play.</p>
<h2>The Certificate</h2>
<p>The UNIX/Linux agent certificate is quite simply used to secure the WSMan connection using SSL and provide authentication for the remote agent host.   The requirements for this certificate are:</p>
<ul>
<li>The certificate is a server authentication certificate (Enhanced Key Usage: 1.3.6<strong>.</strong>1.5.5.7.3.1)</li>
<li>The CN of the certificate matches the FQDN that the Management Server uses to connect to the agent</li>
<li>The certificate is signed by a trusted authority (and can be checked for revocation)</li>
</ul>
<p>When the Operations Manager UNIX/Linux agent is installed, it generates a certificate (using openssl) at the path:  /etc/opt/microsoft/ssl.  The file name of the certificate is scx-host-&lt;hostname&gt;.pem and the corresponding private key is named scx-key.pem.   The agent actually looks for the certificate at /etc/opt/microsoft/scx/ssl/scx.pem, which is initially configured as a symbolic link pointing to scx-host-&lt;hostname&gt;.pem.</p>
<p>Upon initial agent installation, the certificate is not signed, and is not usable for securing the WSMan SSL communication.</p>
<p>Note:  when initially creating the certificate, the agent attempts to determine the agent hostname for use as the CN value of the certificate.   In cases where the DNS name known to the local host does not match the FQDN that OpsMgr will use to communicate with the agent, additional steps are required to establish a valid certificate.  More information can be found here: <a href="http://technet.microsoft.com/en-us/library/dd891009.aspx">http://technet.microsoft.com/en-us/library/dd891009.aspx</a></p>
<h2>Certificates and Management Servers</h2>
<p>When a Management Server discovers a UNIX or Linux agent, the server uses its certificate to sign the agent certificate, acting like a standalone Certificate Authority.  In the discovery process, this actually involves securely transferring the certificate from the agent to the Management Server, signing it, copying it back to the agent, and restarting the agent daemon.  </p>
<p>In order to move an agent between Management Servers, the new Management Server must trust the certificate that was used to sign the agent’s certificate.  This becomes particularly important in the 2012 version of Operations Manager, where agents will move automatically between the Management Servers that are members of the Resource Pool managing the agent.  For more information on the procedure to trust a server’s certificate from another server, review this document: <a href="http://technet.microsoft.com/en-us/library/hh287152.aspx">http://technet.microsoft.com/en-us/library/hh287152.aspx</a>.</p>
<h2>Using a PKI Instead of Management Servers for Signing</h2>
<p>Because the certificates used for securing the agent SSL channel are not proprietary, a separate Public Key Infrastructure can be used to manage the agent certificates, if the PKI option is appealing for your organization.  While this requires some additional resources in the environment (a Certificate Authority) and customization, there are a few benefits to using a PKI: </p>
<ul>
<li>Certificate policies are controlled by the PKI and customizable to meet your organization’s security requirements</li>
<li>Migrations of agents between Management Servers (within or between Resource Pools) can be done without exporting/importing Management Server certificates – simplifying the provisioning of Management Servers.</li>
<li>More options exist for automation of agent deployment and certificate signing</li>
</ul>
<p>The procedure to use a PKI instead of Management Server signed certificates varies with different requirements and environments, but I will describe the steps required for one example approach.  This example assumes that the Certificate Authority is a Windows 2008 Certificate Authority. </p>
<p><strong>Prerequisites:</strong></p>
<ol>
<li>Configure the certificate template on the Certificate Authority – you can use the “Web Server” template or a copy of it – configure options and permissions, publish the template.</li>
<li>Import the CA certificate from the signing CA  to the trusted authorities list <em>on every management server</em>that will manage the UNIX/Linux agents:
<ol>
<li>certutil -f -config &#8220;&lt;CAHostname&gt;\&lt;CAName&gt;&#8221; -ca.cert &lt;CACertFile&gt;</li>
<li>certutil -addstore Root &lt;CACertFile&gt;</li>
</ol>
</li>
</ol>
<p><strong>Per-Agent steps:</strong></p>
<ol>
<li>Install the agent – this can be done through the OpsMgr Discovery Wizard, manually, or with another package distribution tool.  If you use the OpsMgr Discovery Wizard to install the agent, the agent will generate a certificate that is signed by the management server, but this can be replaced with your PKI CA signed certificate.</li>
<li>Generate a cert signing request – either create a new private key with OpenSSL or use the private key generated during the agent install</li>
<ol>
<li><em>a.      </em>Command to generate a CSR using the key generated during agent install:<br />
openssl req -new -key /etc/opt/microsoft/scx/ssl/scx-key.pem  -subj /CN=&lt;FQDN of agent host&gt; -text -out &lt;OutputPath&gt;<em></em></li>
<li><em>3.       </em>Copy the CSR back to a Windows machine<em></em></li>
<li><em>4.       </em>Submit the CSR to the CA – this command assumes auto-enrollment is enabled and authorized:<em></em></li>
<ol>
<li>certreq.exe -submit -config &lt;CAHostName&gt;\&lt;CAName&gt; -attrib &#8220;CertificateTemplate:&lt;TemplateName&gt;” &lt;CSR FileName&gt; &lt;OutputCertName&gt;</li>
<li>Copy the signed cert back to the UNIX/Linux agent using  a secure copy method.  If auto-enrollment was used in step 4, the value for &lt;OutputCertName&gt;  specifies the file name of the signed certificate to copy to the agent.</li>
<li>Update the symbolic link: /etc/opt/microsoft/scx/ssl/scx.pem to point to your new signed certificate</li>
<li>Restart the agent:  /opt/microsoft/scx/bin/tools/scxadmin –restart</li>
<li>Discover the agent using the Operations Console or PowerShell Cmdlet</li>
</ol>
</ol>
</ol>
<h3>Automation and Customization Opportunities</h3>
<p>All of the per-agent steps described above can be executed from a command line, meaning that this procedure can be automated through scripting.  Using a script on a Windows server, the UNIX/Linux commands and file copying actions can be executed with SSH utilities like PuTTY’s plink and pscp.  For really robust automation capabilities, all of the steps can be implemented in a PowerShell script – I like the plink.exe integration example described on this blog: <a href="http://www.christowles.com/2011/06/how-to-ssh-from-powershell-using.html">http://www.christowles.com/2011/06/how-to-ssh-from-powershell-using.html</a>.</p>
<p>Aside from the primary benefits of automating these steps in terms of reducing manual interactions, other customization opportunities are exposed with using this scripting approach.  For example, if your DNS infrastructure and UNIX/Linux agent hostnames don’t neatly correlate, you could modify step 2 of the per-agent steps to also generate a new certificate with openssl using the desired FQDN as the certificate’s CN (<a href="http://technet.microsoft.com/en-us/library/dd891009.aspx">http://technet.microsoft.com/en-us/library/dd891009.aspx</a>).  Alternatively, if you are using Operations Manager 2007 R2 and want to implement agent deployment and certificate signing using sudo elevation instead of root credentials, the UNIX/Linux host commands in the per-agent steps could be prepended with the sudo command (this functionality is built into the 2012 version of Operations Manager).</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/operatingquadrant.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/operatingquadrant.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/operatingquadrant.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/operatingquadrant.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/operatingquadrant.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/operatingquadrant.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/operatingquadrant.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/operatingquadrant.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/operatingquadrant.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/operatingquadrant.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/operatingquadrant.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/operatingquadrant.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/operatingquadrant.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/operatingquadrant.wordpress.com/638/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=638&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://operatingquadrant.com/2011/11/23/operations-manager-unixlinux-agent-certificates-and-using-a-pki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/26f47dda05ea2d756f1f83f1164605aa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">KB</media:title>
		</media:content>
	</item>
		<item>
		<title>Operations Manager Releases</title>
		<link>http://operatingquadrant.com/2011/08/18/operations-manager-releases/</link>
		<comments>http://operatingquadrant.com/2011/08/18/operations-manager-releases/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 16:25:30 +0000</pubDate>
		<dc:creator>Kristopher Bash</dc:creator>
				<category><![CDATA[System Center Operations Manager]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://operatingquadrant.com/?p=633</guid>
		<description><![CDATA[In case you missed it&#8230; Operations Manager 2012 Beta http://www.microsoft.com/systemcenter/en/us/om-vnext-beta.aspx Operations Manager 2012 Beta is available.   Exciting new features for UNIX/Linux monitoring include: Discovery Wizard:  All new Discovery Wizard, making it easier to deploy and discover UNIX and Linux agents Sudo support:  Privileged operations (monitoring and agent maintenance) can now be performed without root privileges [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=633&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In case you missed it&#8230;</p>
<h2><strong>Operations Manager 2012 Beta</strong></h2>
<p><a href="http://www.microsoft.com/systemcenter/en/us/om-vnext-beta.aspx">http://www.microsoft.com/systemcenter/en/us/om-vnext-beta.aspx</a></p>
<p>Operations Manager 2012 Beta is available.   Exciting new features for UNIX/Linux monitoring include:</p>
<ul>
<li>Discovery Wizard:  All new Discovery Wizard, making it easier to deploy and discover UNIX and Linux agents</li>
<li>Sudo support:  Privileged operations (monitoring and agent maintenance) can now be performed <em>without</em> root privileges by using a non-privileged credential and sudo elevation.</li>
<li>SSH Key support:  Agent maintenance operations (via SSH) can be authenticated with an SSH key instead of password</li>
<li>High Availability for UNIX/Linux agent monitoring:   Resource Pools implement highly-available UNIX/Linux monitoring with automatic failover and load distribution.</li>
<li>RHEL 6 and AIX 7.1 support</li>
</ul>
<h2><strong>Operations Manager 2007 R2 CU5</strong></h2>
<p><a href="http://support.microsoft.com/kb/2495674">http://support.microsoft.com/kb/2495674</a></p>
<p>Operations Manager 2007 R2 Cumulative Update 5 is also now available.   Fixes for UNIX/Linux monitoring include:</p>
<ul>
<li>Performance data for LVM managed volumes not available</li>
<li>Process monitoring does not keep name if run by using symbolic link</li>
<li>AIX with large number of running processes crashes with bad alloc</li>
</ul>
<p>CU5 also implements RHEL 6 support for Operations Manager 2007 R2.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/operatingquadrant.wordpress.com/633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/operatingquadrant.wordpress.com/633/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/operatingquadrant.wordpress.com/633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/operatingquadrant.wordpress.com/633/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/operatingquadrant.wordpress.com/633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/operatingquadrant.wordpress.com/633/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/operatingquadrant.wordpress.com/633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/operatingquadrant.wordpress.com/633/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/operatingquadrant.wordpress.com/633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/operatingquadrant.wordpress.com/633/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/operatingquadrant.wordpress.com/633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/operatingquadrant.wordpress.com/633/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/operatingquadrant.wordpress.com/633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/operatingquadrant.wordpress.com/633/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=633&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://operatingquadrant.com/2011/08/18/operations-manager-releases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/26f47dda05ea2d756f1f83f1164605aa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">KB</media:title>
		</media:content>
	</item>
		<item>
		<title>Operations Manager – Extending UNIX/Linux Monitoring with MP Authoring – Part IV</title>
		<link>http://operatingquadrant.com/2011/03/27/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-iv/</link>
		<comments>http://operatingquadrant.com/2011/03/27/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-iv/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 23:06:10 +0000</pubDate>
		<dc:creator>Kristopher Bash</dc:creator>
				<category><![CDATA[Management Packs]]></category>
		<category><![CDATA[SCX]]></category>
		<category><![CDATA[System Center Operations Manager]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://operatingquadrant.com/?p=610</guid>
		<description><![CDATA[Introduction In Part III of this series, I walked through creation of data sources, a discovery, and a rule for discovering dynamically-named log files and implementing an alert-generating rule for log file monitoring.  In this post, I will continue to expand this Management Pack to implement performance collection rules, using WSMan Invoke methods to collect [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=610&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>In Part III of this series, I walked through creation of data sources, a discovery, and a rule for discovering dynamically-named log files and implementing an alert-generating rule for log file monitoring.  In this post, I will continue to expand this Management Pack to implement performance collection rules, using WSMan Invoke methods to collect numerical performance data from a shell command. </p>
<h1>Using Shell Commands to Collect Performance Data</h1>
<p>Whether it is system performance data from the /proc or /sys file systems, or application performance metrics in other locations, performance data for UNIX and Linux systems can often be found in flat files.   In this example Management Pack, I wanted to demonstrate using a WSMan Invoke module with the script provider to gather a numeric value from a file and publish the data as performance data.   In many cases, this would be slightly more complex than is represented in this example (e.g. if the performance metric value should be the delta between data points in the file over time), but this example should provide the framework for using the contents of a file to drive performance collection rules.   The root of these workflows is a shell command using the cat command to parse the file, which could be piped to grep, awk, and sed to filter for specific lines and columns.  </p>
<p>Additionally, if the performance data (e.g. hardware temperature or fan speed, current application user or connection count) that you are looking for is not stored in a file, but available in the output of a utility command, the same method could be used by using the utility command instead of cat.</p>
<h2>Collecting Performance Data from a File</h2>
<p>In this example, the MyApp application stores three performance metrics in flat files in the subdirectory ./perf.   I have built three rules that cat these files, and map the values to performance data.  The three rules are functionally identical, so I will only describe one of them.</p>
<h3>Performance Collection Rule:  MyApp.Monitoring.Rule.CollectMyAppMem</h3>
<p><span id="more-610"></span></p>
<p>This rule collects the value from the ./perf/mem file in the application directory, which represents the current memory used by the application in KB.   The rule targets the MyApp.Monitoring.MyApp application class.</p>
<h4>Rule Data Source:</h4>
<p>The rule uses the MyApp.Monitoring.ShellCommandMonitoring data source, described in Post I of this series, with the configuration:</p>
<pre>&lt;Interval&gt;300&lt;/Interval&gt;
&lt;TargetSystem&gt;
$Target/Host/Property[Type="MicrosoftUnixLibrary!
Microsoft.Unix.Computer"]/NetworkName$&lt;/TargetSystem&gt;
&lt;ShellCommand&gt;
cat $Target/Property[Type="MyApp.Monitoring.MyApp"]
  /InstallPath$/perf/mem
&lt;/ShellCommand&gt;
&lt;Timeout&gt;120&lt;/Timeout&gt;</pre>
<p>Notice that the ShellCommand is our cat command:  <em>cat $Target/Property[Type="MyApp.Monitoring.MyApp"]/InstallPath$/perf/mem</em></p>
<h4>Rule Condition Detection:</h4>
<p>A System.Performance.DataGenericMapper is used as the condition detection module to map the StdOut to performance data, with the configuration:</p>
<pre>&lt;ObjectName&gt;
$Target/Property[Type="MyApp.Monitoring.MyApp"]
  /Name$
&lt;/ObjectName&gt;
&lt;CounterName&gt;Memory used (KB)&lt;/CounterName&gt;
&lt;InstanceName&gt;Total&lt;/InstanceName&gt;
&lt;Value&gt;
  $Data///*[local-name()="StdOut"]$
&lt;/Value&gt;</pre>
<h4>Write Actions:</h4>
<p>The rule defines two write actions:  Microsoft.SystemCenter.CollectPerformanceData and Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData to collect the data and publish it to the DW.   These require no configuration.</p>
<p><a rel="attachment wp-att-612" href="http://operatingquadrant.com/2011/03/27/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-iv/writeactions/"><img class="alignnone size-medium wp-image-612" title="writeactions" src="http://operatingquadrant.files.wordpress.com/2011/03/writeactions.png?w=400&#038;h=398" alt="" width="400" height="398" /></a></p>
<p>The end result is that the scheduled rule grabs the value from the text file, maps it to performance data, collects and publishes the performance data to the OM and DW databases.  This mechanism can be used for nearly any numerical performance metric that is accessible (in a timely fashion) from a shell command pipeline or script.</p>
<p><a rel="attachment wp-att-617" href="http://operatingquadrant.com/2011/03/27/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-iv/perf/"><img class="alignnone size-medium wp-image-617" title="Memory Performance" src="http://operatingquadrant.files.wordpress.com/2011/03/perf-e1300740967244.jpg?w=400&#038;h=379" alt="" width="400" height="379" /></a></p>
<h3>Stay tuned for more in this series….</h3>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/operatingquadrant.wordpress.com/610/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/operatingquadrant.wordpress.com/610/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/operatingquadrant.wordpress.com/610/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/operatingquadrant.wordpress.com/610/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/operatingquadrant.wordpress.com/610/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/operatingquadrant.wordpress.com/610/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/operatingquadrant.wordpress.com/610/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/operatingquadrant.wordpress.com/610/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/operatingquadrant.wordpress.com/610/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/operatingquadrant.wordpress.com/610/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/operatingquadrant.wordpress.com/610/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/operatingquadrant.wordpress.com/610/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/operatingquadrant.wordpress.com/610/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/operatingquadrant.wordpress.com/610/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=610&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://operatingquadrant.com/2011/03/27/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-iv/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/26f47dda05ea2d756f1f83f1164605aa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">KB</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2011/03/writeactions.png?w=400" medium="image">
			<media:title type="html">writeactions</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2011/03/perf-e1300740967244.jpg?w=400" medium="image">
			<media:title type="html">Memory Performance</media:title>
		</media:content>
	</item>
		<item>
		<title>Operations Manager – Extending UNIX/Linux Monitoring with MP Authoring – Part III</title>
		<link>http://operatingquadrant.com/2011/03/24/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-iii/</link>
		<comments>http://operatingquadrant.com/2011/03/24/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-iii/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 03:45:10 +0000</pubDate>
		<dc:creator>Kristopher Bash</dc:creator>
				<category><![CDATA[Management Packs]]></category>
		<category><![CDATA[SCX]]></category>
		<category><![CDATA[System Center Operations Manager]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://operatingquadrant.com/?p=601</guid>
		<description><![CDATA[Introduction In Part II of this series, I walked through creation of data sources, a discovery, a monitor type, and a monitor for customized &#8221;Process Count&#8221; monitoring for discovered instances of a &#8221;Service&#8221; class. In this post, I will continue to build on this example MP to implement dynamic log file discovery and monitoring. Dynamic Log File Discovery and Monitoring ﻿﻿Log file [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=601&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>In Part II of this series, I walked through creation of data sources, a discovery, a monitor type, and a monitor for customized &#8221;Process Count&#8221; monitoring for discovered instances of a &#8221;Service&#8221; class. In this post, I will continue to build on this example MP to implement dynamic log file discovery and monitoring.</p>
<h1>Dynamic Log File Discovery and Monitoring</h1>
<p>﻿﻿Log file monitoring of a single known log file can be easily implemented with the Microsoft.Unix.SCXLog modules, but in some cases, the full path to a log file isn’t static.   For example, if an application maintains multiple log files in a directory, the file name portion of the log file path may not be known ahead of time.    To handle this monitoring scenario, we can implement dynamic log file discovery – using a shell command execution, and then pass the full path of the log file to the SCXLog module for standard log file monitoring. This requires a new class instance, a discovery data source, a discovery rule, and a rule that actually implements the log file monitoring.</p>
<h2><strong>Defining the Log File Class and Hosting Relationship</strong></h2>
<p>Firstly, a new custom class is required to represent the log file objects.   Instances of this class will be discovered by the discovery rule.  </p>
<h4>Definition </h4>
<ul>
<li>ID:  MyApp.Monitoring.LogFile</li>
<li>Base Class:  Microsoft.Unix.ApplicationComponent</li>
<li>Name:  MyApp Log file</li>
</ul>
<p><strong>Properties</strong></p>
<ul>
<li>Name (String)</li>
<li>Path (String) – <em>Key</em></li>
</ul>
<p>The properties for the log file class represent the file name and full path.   The full path is assured to be unique, so I have specified that as the key property of the class.</p>
<p>The log file class needs to be hosted by the MyApp class, to maintain the relationship between the log files and the application.  </p>
<p><a rel="attachment wp-att-606" href="http://operatingquadrant.com/2011/03/24/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-iii/relationship-2/"><img class="alignnone size-medium wp-image-606" title="Hosting Relationship" src="http://operatingquadrant.files.wordpress.com/2011/03/relationship1-e1300738052875.jpg?w=400&#038;h=390" alt="" width="400" height="390" /></a></p>
<h3>Discovery Data Source:  MyApp.Monitoring.DataSource.DiscoverLogFiles</h3>
<p>This data source will use the MyApp.Monitoring.DataSource.ShellCommandDiscovery probe action to find files in a given directory that match a pattern.   The output from this command execution will then be passed to a Microsoft.Windows.PowerShellDiscoveryProbe.   The reason that I am using a PowerShellDiscoveryProbe is that the listing of matched files will be returned as a single data item, the StdOut from the command.   Using a PowerShellDiscoveryProbe provides an easy way to split each line from the output and discover an instance per line. </p>
<h4>Configuration Parameters:</h4>
<ul>
<li>Interval (integer):  Scheduler interval in seconds &#8211; overridable</li>
<li>TargetSystem (string):  UNIX/Linux agent computer to execute the discovery</li>
<li>Appname (string):   The name of the application object (which is the key property for the hosting class instance)</li>
<li>LogFileNamePattern (string): The pattern that will be used in the grep operation to identify log files to discovery</li>
<li>LogFilepath (string):  The path to search for log files at (via an ls command)</li>
</ul>
<h4>Member Modules:</h4>
<p>The first member modules is a MyApp.Monitoring.DataSource.ShellCommandDiscovery probe action, that executes the following command:<br />
<em>ls $Config/LogFilepath$ |grep $Config/LogFileNamePattern$.  </em>This simply enumerates the contents of the specified directory path, and pipes the results to grep, to match a specified pattern, which could be a string match or regular expression.</p>
<h4>Module Configuration:</h4>
<pre>&lt;Interval&gt;$Config/Interval$&lt;/Interval&gt;
&lt;TargetSystem&gt;$Config/TargetSystem$&lt;/TargetSystem&gt;
&lt;ShellCommand&gt;ls $Config/LogFilepath$
   |grep $Config/LogFileNamePattern$&lt;/ShellCommand&gt;
&lt;Timeout&gt;120&lt;/Timeout&gt;</pre>
<p>The output of this shell command then needs to be parsed so that each valid line in the output is discovered as an instance of a log file object.   This is most easily done with a PowerShellDiscoveryProbe:</p>
<blockquote><p>param ([string]$CmdOutput,[string]$AppName,[string]$LogFilePath, [string] $TargetSystem,[string] $SourceID,[string]$ManagedEntityID)</p>
<p>$api = New-Object -comObject &#8216;Mom.ScriptAPI&#8217;<br />
$discoveryData = $api.CreateDiscoveryData(0, $SourceID, $ManagedEntityID)</p>
<p>if ($CmdOutput -ne $null){<br />
        $CmdOutput = $CmdOutput.Replace([Environment]::newline,&#8221; &#8220;)<br />
 [array]$arList = $CmdOutput.Split(&#8221; &#8220;)<br />
 $arList | ForEach-Object{<br />
  [string]$sFile = $_<br />
 if([int]$sFile.Length -ge [int]1){<br />
  $SFilePath = $LogFilePath + &#8220;/&#8221; + $sFile<br />
  $oInst = $discoveryData.CreateClassInstance(&#8220;$MPElement[Name='MyApp.Monitoring.Logfile']$&#8221;)<br />
  $oInst.AddProperty(&#8220;$MPElement[Name='MyApp.Monitoring.Logfile']/Name$&#8221;, $sFile)<br />
  $oInst.AddProperty(&#8220;$MPElement[Name='System!System.Entity']/DisplayName$&#8221;, $sFile)<br />
  $oInst.AddProperty(&#8220;$MPElement[Name='MyApp.Monitoring.Logfile']/Path$&#8221;, $sFilePath)<br />
  $oInst.AddProperty(&#8220;$MPElement[Name='MyApp.Monitoring.MyApp']/Name$&#8221;, $AppName)<br />
  $oInst.AddProperty(&#8220;$MPElement[Name='MicrosoftUnixLibrary!Microsoft.Unix.Computer']/PrincipalName$&#8221;, $TargetSystem)</p>
<p>  $discoveryData.AddInstance($oInst)<br />
 }     <br />
}<br />
 $discoveryData<br />
}</p>
<p>Remove-variable api<br />
Remove-variable discoveryData</p></blockquote>
<p>The PowerShell script loads the Mom.ScriptAPI, creates a Discovery Data instance, and then walks through each line of the ouptut.   If the file name is a valid string (not empty), a class instance is created for the MyApp.Monitoring.Logfile class, and the path and file name properties are set.   The PrincipalName property of the Microsoft.Unix.Computer object, and the AppName property of the MyApp.Monitoring.MyApp class ares included in the DiscoveryData, so that the discovery mapping process can map the hosting relationships. </p>
<p>Parameters are passed from the module configuration to the script using the Parameters XML fragment in the module configuration:</p>
<pre>&lt;Parameters&gt;
&lt;Parameter&gt;
 &lt;Name&gt;TargetSystem&lt;/Name&gt;
 &lt;Value&gt;$Config/TargetSystem$&lt;/Value&gt;
 &lt;/Parameter&gt;
&lt;Parameter&gt;
 &lt;Name&gt;AppName&lt;/Name&gt;
 &lt;Value&gt;$Config/Appname$&lt;/Value&gt;
 &lt;/Parameter&gt;
&lt;Parameter&gt;
 &lt;Name&gt;LogFilePath&lt;/Name&gt;
 &lt;Value&gt;$Config/LogFilepath$&lt;/Value&gt;
 &lt;/Parameter&gt;
&lt;Parameter&gt;
 &lt;Name&gt;CmdOutput&lt;/Name&gt;
 &lt;Value&gt;
 $Data///*[local-name()="StdOut"]$
&lt;/Value&gt;
 &lt;/Parameter&gt;
&lt;Parameter&gt;
 &lt;Name&gt;ManagedEntityID&lt;/Name&gt;
 &lt;Value&gt;$Target/Id$&lt;/Value&gt;
 &lt;/Parameter&gt;
&lt;Parameter&gt;
 &lt;Name&gt;SourceID&lt;/Name&gt;
 &lt;Value&gt;$MPElement$&lt;/Value&gt;
 &lt;/Parameter&gt;
 &lt;/Parameters&gt;</pre>
<p>This data source can then be used to discover log files matching a pattern, in a specified directory.  </p>
<h3>Discovery Rule:  MyApp.Monitoring.Discovery.LogFile</h3>
<p>This discovery will discover dynamically-named log files, in a specified path, using a regular expression to filter by file name.   It discovers instances of the MyApp.Monitoring.LogFile class, and uses the MyApp.Monitoring.DataSource.DiscoverLogFiles data source.  The discovery targets  MyApp.Monitoring.MyApp</p>
<p>Data Source Configuration:</p>
<ul>
<li>&lt;Interval&gt;14400&lt;/Interval&gt;</li>
<li>&lt;TargetSystem&gt;$Target/Host/Property[Type="MicrosoftUnixLibrary!Microsoft.Unix.Computer"]/PrincipalName$&lt;/TargetSystem&gt;</li>
<li>&lt;Appname&gt;$Target/Property[Type="MyApp.Monitoring.MyApp"]/Name$&lt;/Appname&gt;</li>
<li>&lt;LogFileNamePattern&gt;‘^log[0-9]+’&lt;/LogFileNamePattern&gt;</li>
<li>&lt;LogFilepath&gt;$Target/Property[Type="MyApp.Monitoring.MyApp"]/InstallPath$/logs&lt;/LogFilepath&gt;</li>
</ul>
<p>The two parameters to note are the LogFilepath (which is defined as the application path discovered for the MyApp application, appended with “/logs”) and the LogFileNamePattern (which is a regular expression &#8211; ‘^log[0-9]+’ – that will match log files named:  logxxx, where xxx is a number).  </p>
<h2>Monitoring the Discovered Log Files</h2>
<h3>Log File Monitoring Rule:   MyApp.Monitoring.Rule.AlertOnLogError</h3>
<p>Now that the dynamically-named log files will be discovered, we need a rule to alert when an error is found in one of the logs.   The rule will target all instances of the MyApp.Monitoring.LogFile class, so that when a new log file instance is discovered, it is automatically monitored.  The rule uses the MicrosoftUnixLibrary!Microsoft.Unix.SCXLog.Privileged.Datasource (assuming the log files require privileged credentials to access).</p>
<h4>Data source configuration:</h4>
<ul>
<li>&lt;Host&gt;$Target/Host/Host/Property[Type="MicrosoftUnixLibrary!Microsoft.Unix.Computer"]/NetworkName$&lt;/Host&gt;</li>
<li>&lt;LogFile&gt;$Target/Property[Type="MyApp.Monitoring.Logfile"]/Path$&lt;/LogFile&gt; &lt;RegExpFilter&gt;^.*(e|E)rror.*$&lt;/RegExpFilter&gt;</li>
</ul>
<p>The discovered path to the logfile instance is input as the LogFile parameter value, and a Regular Exprssion (^.*(e|E)rror.*$) is defined to match any log entries with the string:  error or Error in the message.  </p>
<h4>Condition Detection configuration:</h4>
<p>A System!System.Event.GenericDataMapper condition detection is then configured to map the data to EventData, for consumption by OpsMgr.  The configuration of this module is:</p>
<ul>
<li>&lt;EventOriginId&gt;$MPElement$&lt;/EventOriginId&gt;</li>
<li>&lt;PublisherId&gt;$MPElement$&lt;/PublisherId&gt;</li>
<li>&lt;PublisherName&gt;MyApp&lt;/PublisherName&gt;</li>
<li>&lt;Channel&gt;Application&lt;/Channel&gt;</li>
<li>&lt;LoggingComputer&gt;$Target/Host/Host/Property[Type="MicrosoftUnixLibrary!Microsoft.Unix.Computer"]/NetworkName$&lt;/LoggingComputer&gt;</li>
<li>&lt;EventNumber&gt;8001&lt;/EventNumber&gt;</li>
<li>&lt;EventCategory&gt;0&lt;/EventCategory&gt;</li>
<li>&lt;EventLevel&gt;1&lt;/EventLevel&gt;</li>
<li>&lt;UserName/&gt;</li>
<li> &lt;Params/&gt;</li>
<li> &lt;/ConditionDetection&gt;</li>
</ul>
<h4>Write Actions:</h4>
<p>In this rule, I have configured two write actions, for collecting the event, and generating an alert.  The CollectEvent (SC!Microsoft.SystemCenter.CollectEvent) module requires no additional configuration, and the alert can be configured to provide details about the logged error message:</p>
<p> <a rel="attachment wp-att-607" href="http://operatingquadrant.com/2011/03/24/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-iii/rulealertconfig/"><img class="alignnone size-medium wp-image-607" title="Rule Alert Config" src="http://operatingquadrant.files.wordpress.com/2011/03/rulealertconfig.png?w=400&#038;h=402" alt="" width="400" height="402" /></a></p>
<h3>Stay tuned for more in this series&#8230;</h3>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/operatingquadrant.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/operatingquadrant.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/operatingquadrant.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/operatingquadrant.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/operatingquadrant.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/operatingquadrant.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/operatingquadrant.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/operatingquadrant.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/operatingquadrant.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/operatingquadrant.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/operatingquadrant.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/operatingquadrant.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/operatingquadrant.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/operatingquadrant.wordpress.com/601/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=601&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://operatingquadrant.com/2011/03/24/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/26f47dda05ea2d756f1f83f1164605aa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">KB</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2011/03/relationship1-e1300738052875.jpg?w=400" medium="image">
			<media:title type="html">Hosting Relationship</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2011/03/rulealertconfig.png?w=400" medium="image">
			<media:title type="html">Rule Alert Config</media:title>
		</media:content>
	</item>
		<item>
		<title>Operations Manager – Extending UNIX/Linux Monitoring with MP Authoring – Part II</title>
		<link>http://operatingquadrant.com/2011/03/24/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-ii/</link>
		<comments>http://operatingquadrant.com/2011/03/24/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-ii/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 04:04:01 +0000</pubDate>
		<dc:creator>Kristopher Bash</dc:creator>
				<category><![CDATA[Management Packs]]></category>
		<category><![CDATA[SCX]]></category>
		<category><![CDATA[System Center Operations Manager]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://operatingquadrant.com/?p=589</guid>
		<description><![CDATA[Introduction In Part I of this series, I walked through creation of a custom Management Pack for monitoring an application hosted on a UNIX or Linux server, as well as the creation of some base data sources and application discovery.   In this post, I will build on this MP to implement custom process monitoring &#8211; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=589&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<div>In Part I of this series, I walked through creation of a custom Management Pack for monitoring an application hosted on a UNIX or Linux server, as well as the creation of some base data sources and application discovery.   In this post, I will build on this MP to implement custom process monitoring &#8211; monitoring the count of instances of a running daemon/process to check that the count is within a range.   While the standard process monitoring provider (SCX_UnixProcess) is the best source for process information in OpsMgr UNIX and Linux monitoring, it does not support this level of customized monitoring.</div>
<h1>Advanced Service Monitoring</h1>
<div><span style="font-size:small;"><span style="font-family:Calibri;">Continuing this custom application monitoring scenario, our hypothetical app has a single daemon associated with the app, but we will build the classes and data sources so that they could easily be extended to add more services/daemons to monitor.    In this example, we can suppose that we want to monitor a daemon that may have multiple instances running, and drive an alert if too many or too few instances of that process are running.   This monitoring will be implemented by using the <em>ps</em> command in a WSMan Invoke module.   To implement monitoring of a daemon for a discovered, custom application, there are two approaches that are viable: </span></span></div>
<div><span style="font-size:small;"><span style="font-family:Calibri;"> </span></span></div>
<ol>
<li>
<div>Define a custom service class, and discover an instance of this class for each service to monitor, configure monitor types and monitors targeting this class</div>
</li>
<li>
<div>Create a monitor for each service to monitor, targeting the custom application class</div>
</li>
</ol>
<p>Both methods are completely viable, and in most cases, it is appropriate to take the simpler approach and target the custom monitors to the application, providing static inputs into the monitor.   There are some cases where discovering a class instance for the service makes sense though.  Facilitating dynamic discovery of services or thresholds (read from a config file), using the service class in a Distributed Application model in OpsMgr, or maintaining logical seperation (in terms of monitoring) between the application and its subsystems are all scenarios that would benefit from discovering the monitored services as class instances.   For the purpose of illustration, I will discover the daemon to monitor in this example Management Pack as a class instance.</p>
<h2>Class Definition</h2>
<h3>Class:  MyApp.Monitoring.Service</h3>
<h4>Definition</h4>
<ul>
<li>
<div>ID:  MyApp.Monitoring.Service</div>
</li>
<li>
<div>Base Class:  Microsoft.Unix.ApplicationComponent</div>
</li>
<li>
<div>Name:  MyApp Service</div>
</li>
</ul>
<h4>Properties</h4>
<ul>
<li>
<div>Name (String) – <em>Key</em></div>
</li>
<li>
<div>MinRunning (Integer)</div>
</li>
<li>
<div>MaxRunning (Integer)</div>
</li>
</ul>
<h2>Discovery</h2>
<p>Then we can define the data source to discover a service.   In this case, we know the name of the service and the value of the properties, so we don’t need to actually poll the agent to return data.   We can simply combine a Discovery Scheduler with a Discovery Data Mapper module to implement the data source.  However, we want to be able to override the values of MinRunning and MaxRunning, so these will need to be exposed as overridable configuration parameters.</p>
<p>Therefore, I’ve chosen to implement this data source in two parts.   The first data source, will simply combine a System.Discovery.Scheduler module and a System.Discovery.ClassSnapshotDataMapper module.   This data source will accept Interval, ClassId and InstanceSettings parameters as inputs.  The second data source will reference the first data source, but implement parameters for Service Name, MinRunning, and MaxRunning.    By breaking this into two data sources, the first data source can be used for other simple discoveries.</p>
<h3>Discovery Data Source:  MyApp.Monitoring.DataSource.DiscoverObject</h3>
<p>This is the data source that simply combines a scheduler and a discovery data mapper.  It requires that the MapperSchema be added to the Configuration:</p>
<pre>&lt;Configuration&gt;
&lt;IncludeSchemaTypes&gt;
&lt;SchemaType&gt;
 System!System.Discovery.MapperSchema
&lt;/SchemaType&gt;
&lt;/IncludeSchemaTypes&gt;
…
<span id="more-589"></span></pre>
<h4>Configuration Parameters:</h4>
<ul>
<li>Interval (integer):  Scheduler interval in seconds</li>
<li>ClassId (string):  ID of the Class to discover</li>
<li>InstanceSettings (SettingsType):  Discovery Instance Settings</li>
</ul>
<h4>Member Modules:</h4>
<p>The first member module is the System.Discovery.Scheduler module, with the configuration:</p>
<pre>&lt;Scheduler&gt;
&lt;SimpleReccuringSchedule&gt;
&lt;Interval&gt;$Config/Interval$&lt;/Interval&gt;
&lt;SyncTime/&gt;
&lt;/SimpleReccuringSchedule&gt;
&lt;ExcludeDates/&gt;
&lt;/Scheduler&gt;</pre>
<p>This is followed by a System.Discovery.ClassSnapshotDataMappermodule, with the configuration:</p>
<pre>&lt;ClassId&gt;$Config/ClassId$&lt;/ClassId&gt;
&lt;InstanceSettings&gt;
 $Config/InstanceSettings$
&lt;/InstanceSettings&gt;</pre>
<p>So this data source accepts the arbitrary Instance Settings and Class Id and maps the inputs to Discovery Data.</p>
<h3>Discovery Data Source:  MyApp.Monitoring.DataSource.DiscoverService</h3>
<p>This data source uses the MyApp.Monitoring.DataSource.DiscoverObject data source that we just created, but supports overridable inputs for the MinRunning and MaxRunning service class properties, by embedding the $Config/$ variables in the Instance Settings definition.</p>
<h4>Configuration Parameters:</h4>
<ul>
<li>Interval (integer):  Scheduler interval in seconds &#8211; overridable</li>
<li>TargetSystem (string):  UNIX/Linux agent computer to execute the discovery</li>
<li>AppName (string):   The name of the application object (which is the key property for the hosting class instance)</li>
<li>ServiceName (string): The name of the service to discover</li>
<li>MinRunning (integer):  The minimum threshold of running processes expected &#8211; overridable</li>
<li>MaxRunning (integer):  The maximum threshold of running processes expected &#8211; overridable</li>
</ul>
<h4>Member Modules</h4>
<p>This data source only has one member module:  MyApp.Monitoring.DataSource.DiscoverObject, with the configuration:</p>
<pre>&lt;Interval&gt;$Config/Interval$&lt;/Interval&gt;
&lt;ClassId&gt;
 $MPElement[Name="MyApp.Monitoring.Service"]$
&lt;/ClassId&gt;
&lt;InstanceSettings&gt;
&lt;Settings&gt;
&lt;Setting&gt;
&lt;Name&gt;
 $MPElement[Name='MyApp.Monitoring.MyApp']/Name$
&lt;/Name&gt;
&lt;Value&gt;$Config/AppName$&lt;/Value&gt;
&lt;/Setting&gt; 
&lt;Setting&gt;
&lt;Name&gt;
 $MPElement[Name='MyApp.Monitoring.Service']/Name$
&lt;/Name&gt;
&lt;Value&gt;$Config/ServiceName$&lt;/Value&gt;
&lt;/Setting&gt;
&lt;Setting&gt;
&lt;Name&gt;
 $MPElement[Name='MyApp.Monitoring.Service']/MinRunning$
&lt;/Name&gt;
&lt;Value&gt;$Config/MinProcesses$&lt;/Value&gt;
&lt;/Setting&gt;
&lt;Setting&gt;
&lt;Name&gt;
 $MPElement[Name='MyApp.Monitoring.Service']/MaxRunning$
&lt;/Name&gt;
&lt;Value&gt;$Config/MaxProcesses$&lt;/Value&gt;
&lt;/Setting&gt;
&lt;Setting&gt;
&lt;Name&gt;
 $MPElement[Name='MicrosoftUnixLibrary!
  Microsoft.Unix.Computer']/PrincipalName$
&lt;/Name&gt;
&lt;Value&gt;$Config/TargetSystem$&lt;/Value&gt;
&lt;/Setting&gt;
&lt;Setting&gt;
&lt;Name&gt;
$MPElement[Name='System!System.Entity']/DisplayName$
&lt;/Name&gt;
&lt;Value&gt;$Config/ServiceName$&lt;/Value&gt;
&lt;/Setting&gt;
&lt;/Settings&gt;
&lt;/InstanceSettings&gt;</pre>
<p>Note that the key properties for the hosting class instances (MyApp.Monitoring.MyApp, and Microsoft.Unix.Computer) are included in the Instance Settings so that the relationships can be mapped.  With the data sources in place, the next step is to configure the Discovery Rule (one for each service to discover).</p>
<h3>Discovery Rule:  MyApp.Monitoring.Discovery.MyAppDService</h3>
<p>This rule discovers the MyAppD daemon, using the data source just created.  It is targeted to instances of the MyApp class, and provides the name of the service and process count thresholds.</p>
<h4>Data Source Configuration:</h4>
<pre>&lt;Interval&gt;28800&lt;/Interval&gt;
&lt;TargetSystem&gt;
 $Target/Host/Property[Type="MicrosoftUnixLibrary!
  Microsoft.Unix.Computer"]/PrincipalName$
&lt;/TargetSystem&gt;
&lt;AppName&gt;
 $Target/Property[Type="MyApp.Monitoring.MyApp"]/Name$
&lt;/AppName&gt;
&lt;ServiceName&gt;myappd&lt;/ServiceName&gt;
&lt;MinProcesses&gt;1&lt;/MinProcesses&gt;
&lt;MaxProcesses&gt;3&lt;/MaxProcesses&gt;</pre>
<p>Once the MP is imported and the dicsovery has run, we can see the discovered service in the Discovered Inventory view in the Ops Console:</p>
<p><a rel="attachment wp-att-592" href="http://operatingquadrant.com/2011/03/24/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-ii/service/"><img class="alignnone size-medium wp-image-592" title="Service" src="http://operatingquadrant.files.wordpress.com/2011/03/service-e1300736559901.png?w=348&#038;h=299" alt="" width="348" height="299" /></a></p>
<h2>Building the Monitor Type</h2>
<p>In this example, we are going to monitor the process/daemon and generate an alert if the count of running instances is outside of the threshold range.   To do this, we can use the Shell Command monitoring data source to execute a  <em>ps h -e |grep &lt;process name&gt; grep -v grep |wc –l</em> command string.  This calls the <em>ps</em> command, with switches to suppress the header row, and show all processes.   Grep is used to find the process name, and exclude the grep process itself.  Finally, the results are piped to <em>wc –l</em> to return a line count.   The result of this command string is that the running count of processes matching the process name is returned as a numeric value.</p>
<h3>Monitor Type: MyApp.Monitoring.MonitorType.ProcessCount</h3>
<p>This monitor type will use the MyApp.Monitoring.DataSource.ShellCommandMonitoring data source, to call the ps command string described above.  A set of condition detection modules are used to determine if the process count is below or above the minimum and maximum thresholds.</p>
<h4>Configuration Parameters</h4>
<ul>
<li>Interval (integer):  Scheduler interval in seconds &#8211; overridable</li>
<li>TargetSystem (string):  UNIX/Linux agent computer to monitor</li>
<li>ServiceName (string): The name of the service to monitor</li>
<li>MinRunning (integer):  The minimum threshold of running processes expected</li>
<li>MaxRunning (integer):  The maximum threshold of running processes expected</li>
</ul>
<h4>Health States</h4>
<ul>
<li>ProcessCountOK</li>
<li>ProcessCountNotOK</li>
</ul>
<h4>Member Modules</h4>
<pre>The data source for this monitor type is: MyApp.Monitoring.DataSource.ShellCommandMonitoring, with the configuration:
&lt;Interval&gt;$Config/Interval$&lt;/Interval&gt;
&lt;TargetSystem&gt;
 $Config/TargetSystem$
&lt;/TargetSystem&gt;
&lt;ShellCommand&gt;
 <em>ps h -e |grep $Config/ProcessName$|grep -v grep |wc –l</em>
&lt;/ShellCommand&gt;
&lt;Timeout&gt;120&lt;/Timeout&gt;</pre>
<p>Two configuration detection modules are required to detect the OK and NotOK states, comparing the returned StdOut to the thresholds:</p>
<pre>&lt;ConditionDetection ID="CDProcessCountOK"
  TypeID="System!System.ExpressionFilter"&gt;
&lt;Expression&gt;
&lt;And&gt;
&lt;Expression&gt;
&lt;SimpleExpression&gt;
&lt;ValueExpression&gt;
 &lt;XPathQuery Type="Double"&gt;
 //*[local-name()="StdOut"]
&lt;/XPathQuery&gt;
&lt;/ValueExpression&gt;
&lt;Operator&gt;GreaterEqual&lt;/Operator&gt;
&lt;ValueExpression&gt;
&lt;Value Type="Double"&gt;$Config/MinCount$&lt;/Value&gt;
&lt;/ValueExpression&gt;
&lt;/SimpleExpression&gt;
&lt;/Expression&gt;
&lt;Expression&gt;
&lt;SimpleExpression&gt;
&lt;ValueExpression&gt;
&lt;XPathQuery Type="Double"&gt;
 //*[local-name()="StdOut"]
&lt;/XPathQuery&gt;
&lt;/ValueExpression&gt;
&lt;Operator&gt;LessEqual&lt;/Operator&gt;
&lt;ValueExpression&gt;
&lt;Value Type="Double"&gt;$Config/MaxCount$&lt;/Value&gt;
&lt;/ValueExpression&gt;
&lt;/SimpleExpression&gt;
&lt;/Expression&gt;
&lt;/And&gt;
&lt;/Expression&gt;
&lt;/ConditionDetection&gt;</pre>
<p>And</p>
<pre>&lt;ConditionDetection ID="CDProcessCountNotOK"
  TypeID="System!System.ExpressionFilter"&gt;
&lt;Expression&gt;
&lt;Or&gt;
&lt;Expression&gt;
&lt;SimpleExpression&gt;
&lt;ValueExpression&gt;
&lt;XPathQuery Type="Double"&gt;
 //*[local-name()="StdOut"]
&lt;/XPathQuery&gt;
&lt;/ValueExpression&gt;
&lt;Operator&gt;Greater&lt;/Operator&gt;
&lt;ValueExpression&gt;
&lt;Value Type="Double"&gt;$Config/MaxCount$&lt;/Value&gt;
&lt;/ValueExpression&gt;
&lt;/SimpleExpression&gt;
&lt;/Expression&gt;
&lt;Expression&gt;
&lt;SimpleExpression&gt;
&lt;ValueExpression&gt;
&lt;XPathQuery Type="Double"&gt;
 //*[local-name()="StdOut"]
&lt;/XPathQuery&gt;
&lt;/ValueExpression&gt;
&lt;Operator&gt;Less&lt;/Operator&gt;
&lt;ValueExpression&gt;
&lt;Value Type="Double"&gt;$Config/MinCount$&lt;/Value&gt;
&lt;/ValueExpression&gt;
&lt;/SimpleExpression&gt;
&lt;/Expression&gt;
&lt;/Or&gt;
&lt;/Expression&gt;
&lt;/ConditionDetection&gt;</pre>
<h4>Regular Detections</h4>
<p>The regular detections just need to be configured to map the Condition Detection member modules to the defined Health States:</p>
<pre>&lt;RegularDetections&gt;
&lt;RegularDetection
  MonitorTypeStateID="ProcessCountOK"&gt;
&lt;Node ID="CDProcessCountOK"&gt;
&lt;Node ID="DS1"/&gt;
&lt;/Node&gt;
&lt;/RegularDetection&gt;
&lt;RegularDetection
  MonitorTypeStateID="ProcessCountNotOK"&gt;
&lt;Node ID="CDProcessCountNotOK"&gt;
&lt;Node ID="DS1"/&gt;
&lt;/Node&gt;
&lt;/RegularDetection&gt;
&lt;/RegularDetections&gt;</pre>
<p>In summary, this monitor type will execute our <em>ps</em> command, for a given service name, and compare the count of running/matched process instances  to the defined thresholds (defined during service discovery).</p>
<h2>Building the Custom Process Monitor</h2>
<p>In this step, we will create a monitor, of the type that we just created: MyApp.Monitoring.MonitorType.ProcessCount</p>
<p><a rel="attachment wp-att-594" href="http://operatingquadrant.com/2011/03/24/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-ii/monitorservice-2/"><img class="alignnone size-medium wp-image-594" title="Service Monitor" src="http://operatingquadrant.files.wordpress.com/2011/03/monitorservice1-e1300737092706.png?w=400&#038;h=397" alt="" width="400" height="397" /></a></p>
<div>As for the monitor configuration, the service name, and minimum and maximum thresholds were discovered in the service discovery rule, so we can simply provide those target parameters to the monitor configuration.</div>
<pre>&lt;Configuration&gt;
&lt;Interval&gt;180&lt;/Interval&gt;
&lt;TargetSystem&gt;
 $Target/Host/Host/Property[Type="MicrosoftUnixLibrary!
     Microsoft.Unix.Computer"]/NetworkName$
&lt;/TargetSystem&gt;
&lt;ProcessName&gt;
 $Target/Property[Type="MyApp.Monitoring.Service"]/Name$
&lt;/ProcessName&gt;
&lt;MinCount&gt;
 $Target/Property[Type="MyApp.Monitoring.Service"]/MinRunning$
&lt;/MinCount&gt;
&lt;MaxCount&gt;
 $Target/Property[Type="MyApp.Monitoring.Service"]/MaxRunning$
&lt;/MaxCount&gt;
&lt;/Configuration&gt;</pre>
<div>For the actual alert, we can embed the parameters from the configuration and shell script output, to create an alert message detailing the current count of running processes as well as the minimum and maximum expected range.</div>
<blockquote>
<div><em>The MyApp Service: $Target/Property[Type="MyApp.Monitoring.Service"]/Name$, currently has too many or too few processes running. </em></div>
<div><em>Current process count:  $Data/Context///*[local-name()="StdOut"]$. </em></div>
<div><em>Expected range: </em><br />
<em>$Target/Property[Type="MyApp.Monitoring.Service"]/MinRunning$ &#8211; $Target/Property[Type="MyApp.Monitoring.Service"]/MaxRunning$.</em></div>
</blockquote>
<h3>Stay tuned for more in this series&#8230;</h3>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/operatingquadrant.wordpress.com/589/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/operatingquadrant.wordpress.com/589/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/operatingquadrant.wordpress.com/589/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/operatingquadrant.wordpress.com/589/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/operatingquadrant.wordpress.com/589/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/operatingquadrant.wordpress.com/589/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/operatingquadrant.wordpress.com/589/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/operatingquadrant.wordpress.com/589/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/operatingquadrant.wordpress.com/589/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/operatingquadrant.wordpress.com/589/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/operatingquadrant.wordpress.com/589/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/operatingquadrant.wordpress.com/589/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/operatingquadrant.wordpress.com/589/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/operatingquadrant.wordpress.com/589/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=589&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://operatingquadrant.com/2011/03/24/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/26f47dda05ea2d756f1f83f1164605aa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">KB</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2011/03/service-e1300736559901.png?w=348" medium="image">
			<media:title type="html">Service</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2011/03/monitorservice1-e1300737092706.png?w=400" medium="image">
			<media:title type="html">Service Monitor</media:title>
		</media:content>
	</item>
		<item>
		<title>Operations Manager &#8211; Extending UNIX/Linux Monitoring with MP Authoring &#8211; Part I</title>
		<link>http://operatingquadrant.com/2011/03/23/operations-manager-extending-unixlinux-monitoring-with-mp-authoring-part-i/</link>
		<comments>http://operatingquadrant.com/2011/03/23/operations-manager-extending-unixlinux-monitoring-with-mp-authoring-part-i/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 16:11:56 +0000</pubDate>
		<dc:creator>Kristopher Bash</dc:creator>
				<category><![CDATA[Management Packs]]></category>
		<category><![CDATA[SCX]]></category>
		<category><![CDATA[System Center Operations Manager]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://operatingquadrant.com/?p=575</guid>
		<description><![CDATA[Introduction The OpsMgr UNIX and Linux monitoring implementation can be extended through MP authoring to implement robust system and application monitoring for UNIX/Linux servers.   The most direct mechanism of extension comes in the form of the script provider, accessed with WSMan Invoke modules.   The WSMan Invoke modules support three methods of invoking actions: ExecuteCommand – [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=575&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>The OpsMgr UNIX and Linux monitoring implementation can be extended through MP authoring to implement robust system and application monitoring for UNIX/Linux servers.   The most direct mechanism of extension comes in the form of the script provider, accessed with WSMan Invoke modules.   The WSMan Invoke modules support three methods of invoking actions:</p>
<ul>
<li>ExecuteCommand – execute a command (e.g. a script already on the file system ) and return the results</li>
<li>ExecuteShellCommand – execute a command through sh (with pipeline support) and return the results</li>
<li>ExecuteScript  &#8211; download and execute an embedded script and return the results</li>
</ul>
<p>Of these three methods, I prefer to use ExecuteShellCommand in most cases, as it allows for the use of complex one-liner shell commands, embedded in the MP.</p>
<p>In a series of posts, I will describe the creation of an example Management Pack for monitoring an application, featuring dynamic application discovery, discovery of multiple log files, and advanced monitoring implementations.</p>
<h2><strong>Example Application Details</strong></h2>
<p>The example MP described in these blog posts implements monitoring for a hypothetical application (MyApp).  The application involves a daemon, a set of log files, and application performance counters where the metrics are accessible as the contents of files.</p>
<h1>Part I &#8211; Discovering an Application</h1>
<h2>Setting up the MP</h2>
<p>I am a big fan of the R2 Authoring Console and will be using it to create this example MP.   The first step then is to create a new MP in the Authoring Console (ID:  MyApp.Monitoring).    Once the MP is created and saved, references are needed.   References I am adding are:</p>
<ul>
<li>Microsoft.Unix.Library – contains UNIX/Linux classes and modules</li>
<li>Microsoft.SystemCenter.DataWarehouse.Library – required for publishing performance data to the DW</li>
<li>System.Image.Library – contains icon images referenced in class definition</li>
</ul>
<p><a rel="attachment wp-att-576" href="http://operatingquadrant.com/2011/03/23/operations-manager-extending-unixlinux-monitoring-with-mp-authoring-part-i/ref/"><img class="alignnone size-medium wp-image-576" title="References" src="http://operatingquadrant.files.wordpress.com/2011/03/ref-e1300730156221.jpg?w=400&#038;h=255" alt="" width="400" height="255" /></a></p>
<h2>Configuring the Base Composite Modules<br />
<span id="more-575"></span></h2>
<p>Most monitoring and discovery workflows used in this MP example will involve the execution of a shell command through the Microsoft.Unix.WSMan.Invoke.ProbeAction ExecuteShellCommand method.   Therefore, setting up a new composite probe action and a couple of base data sources will make further module implementation much simpler.</p>
<h3>Probe Action:  MyApp.Monitoring.ProbeAction.ShellCommand</h3>
<p>This probe action simply wraps the Microsoft.Unix.WSMan.Invoke.ProbeAction in a way that makes it easier to use for shell command execution.</p>
<h5>Configuration Parameters:</h5>
<ul>
<li>TargetSystem (string)  – the UNIX/Linux agent computer that will execute the command</li>
<li>ShellCommand (string) – the shell command to execute</li>
<li>Timeout (integer) – the command timeout, in seconds</li>
</ul>
<h5>Member Modules:</h5>
<p>This probe action will only include one member module:  Microsoft.Unix.WSMan.Invoke.ProbeAction.  The configuration of the module looks like:</p>
<pre>&lt;TargetSystem&gt;$Config/TargetSystem$&lt;/TargetSystem&gt;
&lt;Uri&gt;

http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/

 SCX_OperatingSystem?__cimnamespace=root/scx
&lt;/Uri&gt;
&lt;Selector/&gt;
&lt;InvokeAction&gt;ExecuteShellCommand&lt;/InvokeAction&gt;
&lt;Input&gt;
&lt;p:ExecuteShellCommand_INPUT xmlns:p="http://schemas.
 microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem"&gt;
&lt;p:command&gt;$Config/ShellCommand$&lt;/p:command&gt;
&lt;p:timeout&gt;$Config/Timeout$&lt;/p:timeout&gt;
&lt;/p:ExecuteShellCommand_INPUT&gt;
&lt;/Input&gt;</pre>
<p>Note that the configuration parameters for ShellCommand and Timeout are embedded in the “Input” parameter XML fragment.</p>
<h3>Data Source: MyApp.Monitoring.DataSource.ShellCommandMonitoring</h3>
<p>The probe action created in the previous step will be used in a number of monitoring workflows, so creating a data source that combines the probe action with a scheduler will make monitoring workflow configuration simpler.</p>
<h5>Configuration Parameters:</h5>
<ul>
<li>Interval (integer) – timer interval in seconds</li>
<li>TargetSystem (string)  – passed to the probe action module</li>
<li>ShellCommand (string) – passed to the probe action module</li>
<li>Timeout (integer) – passed to the probe action module</li>
</ul>
<h5>Member Modules:</h5>
<p>The first module in this composite data source is a System.Scheduler module, with a basic configuration:</p>
<pre>&lt;Scheduler&gt;
&lt;SimpleReccuringSchedule&gt;
&lt;Interval&gt;$Config/Interval$&lt;/Interval&gt;
&lt;SyncTime/&gt;
&lt;/SimpleReccuringSchedule&gt;
&lt;ExcludeDates/&gt;
&lt;/Scheduler&gt;</pre>
<p>This scheduler module is followed by the ShellComand probe action, with the configuration:</p>
<pre>&lt;TargetSystem&gt;$Config/TargetSystem$&lt;/TargetSystem&gt;
&lt;ShellCommand&gt;$Config/ShellCommand$&lt;/ShellCommand&gt;
&lt;Timeout&gt;$Config/Timeout$&lt;/Timeout&gt;</pre>
<h3>Data Source: MyApp.Monitoring.DataSource.ShellCommandDiscovery</h3>
<p>This data source is identical to the MyApp.Monitoring.DataSource.ShellCommandMonitoring data source, except it features a System.Discovery.Scheduler scheduler module instead of a System.Scheduler module.  Discovery workflows must use a Discovery scheduler in order to prevent problems with cookdown (i.e. discovery workflows ‘cooking-down’ along with monitoring workflows).   So this data source combines the ShellCommand probe action with a Discovery scheduler.</p>
<p>Additionally, I have added a System.ExpressionFilter module to the ShellCommandDiscovery data source to prevent the discovery workflows from continuing if an error is encountered (either WSMan error or ShellCommand StdErr output).   The ExpressionFilter configuration is:</p>
<pre>&lt;Expression&gt;
&lt;And&gt;
&lt;Expression&gt;
&lt;RegExExpression&gt;
&lt;ValueExpression&gt;
 &lt;XPathQuery&gt;//*[local-name()="StdErr"]&lt;/XPathQuery&gt;
&lt;/ValueExpression&gt;
 &lt;Operator&gt;DoesNotMatchRegularExpression&lt;/Operator&gt;
 &lt;Pattern&gt;^.+&lt;/Pattern&gt;
 &lt;/RegExExpression&gt;
 &lt;/Expression&gt;
&lt;Expression&gt;
&lt;Not&gt;&lt;Expression&gt;&lt;Exists&gt;
&lt;ValueExpression&gt;
 &lt;XPathQuery&gt;WsManData/ErrorCode&lt;/XPathQuery&gt;
&lt;/ValueExpression&gt;
&lt;/Exists&gt; &lt;/Expression&gt; &lt;/Not&gt;
&lt;/Expression&gt;
&lt;/And&gt;
&lt;/Expression&gt;</pre>
<h2>Class Definition</h2>
<p>With the base composite modules configured, we can move on to the actual application discovery, starting with the definition of the application class.  The Microsoft.Unix.LocalApplication is an ideal base class for the application class, and already has a hosting relationship defined so that Microsoft.Unix.Computer hosts Microsoft.Unix.LocalApplication.</p>
<p><a rel="attachment wp-att-577" href="http://operatingquadrant.com/2011/03/23/operations-manager-extending-unixlinux-monitoring-with-mp-authoring-part-i/classdefinition/"></a></p>
<p><a rel="attachment wp-att-578" href="http://operatingquadrant.com/2011/03/23/operations-manager-extending-unixlinux-monitoring-with-mp-authoring-part-i/classdefinition-2/"><img class="alignnone size-medium wp-image-578" title="Class Definition" src="http://operatingquadrant.files.wordpress.com/2011/03/classdefinition1-e1300730705273.jpg?w=400&#038;h=397" alt="" width="400" height="397" /></a></p>
<h5>Class Definition:</h5>
<ul>
<li>ID:  MyApp.Monitoring.MyApp</li>
<li>Base Class:  Microsoft.Unix.LocalApplication</li>
<li>Name:  MyApp</li>
</ul>
<h5>Properties:</h5>
<ul>
<li>Name (String) – <em>Key</em></li>
<li>InstallPath (String)</li>
</ul>
<h2>Discovering the Application</h2>
<p>When discovering a Windows application in OpsMgr, we would typically use a registry probe.  In UNIX/Linux application discovery, probing the existence or contents of a file is typically the most effective way to identify the instance of an application.   In this example, the MyApp application has a configuration file named: myapp.conf in the installation path of /opt/myapp.  Thus, a shell command:  ls /opt/myapp/myapp.conf | wc –l would return a 1 if the file exists, or 0 if the file doesn’t exist.   We can use this logic in the application discovery.</p>
<h3>Discovery Data Source: MyApp.Monitoring.DataSource.MyAppDiscovery</h3>
<p>To implement this application discovery, I will create a new data source, building on the ShellCommandDiscovery data source previously created.</p>
<h5>Configuration Parameters:</h5>
<ul>
<li>Interval (integer):  Scheduler interval in seconds</li>
<li>TargetSystem (string):  UNIX/Linux agent computer to execute the discovery</li>
<li>AppPath (string):  File system path to the application, overrideable</li>
</ul>
<h5>Member Modules:</h5>
<p>The first module in this data source is the ShellCommandDiscovery data source (MyApp.Monitoring.DataSource.ShellCommandDiscovery).   This will be used to query the file system for the application configuration file, to determine if the app is present.  The configuration for this module is:</p>
<pre>&lt;Interval&gt;$Config/Interval$&lt;/Interval&gt;
&lt;TargetSystem&gt;$Config/TargetSystem$&lt;/TargetSystem&gt;
&lt;ShellCommand&gt;
 ls $Config/AppPath$/myapp.conf | wc -l
&lt;/ShellCommand&gt;
&lt;Timeout&gt;120&lt;/Timeout&gt;</pre>
<p>In order to return discovery data from this data source, a Discovery Mapper module is required.   In this case, I will use a System.Discovery.FilteredClassSnapshotDataMapper module to filter the results (only return discovery data if the app is found).   An output of 1 from the shell command indicates that the configuration file was found, while an output of 0 indicates that the configuration file was not found.  The configuration for the FilteredClassSnapShotDataMapperModule would be:</p>
<pre>&lt;Expression&gt;
&lt;SimpleExpression&gt;
&lt;ValueExpression&gt;
 &lt;XPathQuery Type="String"&gt;
  //*[local-name()="StdOut"]
 &lt;/XPathQuery&gt;
&lt;/ValueExpression&gt;
&lt;Operator&gt;Equal&lt;/Operator&gt;
&lt;ValueExpression&gt;
 &lt;Value Type="String"&gt;1&lt;/Value&gt;
&lt;/ValueExpression&gt;
&lt;/SimpleExpression&gt;
&lt;/Expression&gt;
&lt;ClassId&gt;
 $MPElement[Name='MyApp.Monitoring.MyApp']$
&lt;/ClassId&gt;
&lt;InstanceSettings&gt;
&lt;Settings&gt;
&lt;Setting&gt;
&lt;Name&gt;
$MPElement[Name='MyApp.Monitoring.MyApp']/Name$
&lt;/Name&gt;
&lt;Value&gt;MyApp&lt;/Value&gt;
&lt;/Setting&gt;
&lt;Setting&gt;
&lt;Name&gt;
 $MPElement[Name='MyApp.Monitoring.MyApp']/InstallPath$
&lt;/Name&gt;
&lt;Value&gt;$Config/AppPath$&lt;/Value&gt;
&lt;/Setting&gt;
&lt;Setting&gt;
&lt;Name&gt;
 $MPElement[Name='System!System.Entity']/DisplayName$
&lt;/Name&gt;
&lt;Value&gt;MyApp - $Config/TargetSystem$&lt;/Value&gt;
&lt;/Setting&gt;
&lt;Setting&gt;
&lt;Name&gt;
 $MPElement[Name='MicrosoftUnixLibrary!
 Microsoft.Unix.Computer']/PrincipalName$
&lt;/Name&gt;
&lt;Value&gt;$Config/TargetSystem$&lt;/Value&gt;
&lt;/Setting&gt;
&lt;/Settings&gt;
&lt;/InstanceSettings&gt;</pre>
<p>Note that the Key Property (PrincipalName) for the hosting Microsoft.Unix.Computer object is included in the DiscoveryData.</p>
<h3>Discovery Rule:  MyApp.Monitoring.Discovery.MyApp</h3>
<p>With the discovery data source implemented, finishing the discovery just requires creation of the discovery rule, which targets Microsoft.Unix.Computer objects.</p>
<p><a rel="attachment wp-att-579" href="http://operatingquadrant.com/2011/03/23/operations-manager-extending-unixlinux-monitoring-with-mp-authoring-part-i/myappdiscovery/"><img class="alignnone size-medium wp-image-579" title="MyApp Discovery" src="http://operatingquadrant.files.wordpress.com/2011/03/myappdiscovery-e1300731095833.png?w=400&#038;h=396" alt="" width="400" height="396" /></a></p>
<h5>Data Source Configuration:</h5>
<ul>
<li>Interval:  14400</li>
<li>TargetSystem: $Target/Property[Type="MicrosoftUnixLibrary!Microsoft.Unix.Computer"]/PrincipalName$</li>
<li>AppPath: /opt/myapp</li>
</ul>
<p>This is a good time to create the MP’s presentation folder and a state view targeting MyApp objects.   Once the discovery has executed, discovered instances of the app can be viewed in the state view or Discovered Inventory view:</p>
<p><a rel="attachment wp-att-580" href="http://operatingquadrant.com/2011/03/23/operations-manager-extending-unixlinux-monitoring-with-mp-authoring-part-i/stateview/"><img class="alignnone size-medium wp-image-580" title="State View" src="http://operatingquadrant.files.wordpress.com/2011/03/stateview-e1300731358443.jpg?w=337&#038;h=339" alt="" width="337" height="339" /></a></p>
<p><em>Stay tuned for more posts on completing this example Management Pack</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/operatingquadrant.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/operatingquadrant.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/operatingquadrant.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/operatingquadrant.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/operatingquadrant.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/operatingquadrant.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/operatingquadrant.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/operatingquadrant.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/operatingquadrant.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/operatingquadrant.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/operatingquadrant.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/operatingquadrant.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/operatingquadrant.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/operatingquadrant.wordpress.com/575/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=575&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://operatingquadrant.com/2011/03/23/operations-manager-extending-unixlinux-monitoring-with-mp-authoring-part-i/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/26f47dda05ea2d756f1f83f1164605aa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">KB</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2011/03/ref-e1300730156221.jpg?w=400" medium="image">
			<media:title type="html">References</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2011/03/classdefinition1-e1300730705273.jpg?w=400" medium="image">
			<media:title type="html">Class Definition</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2011/03/myappdiscovery-e1300731095833.png?w=400" medium="image">
			<media:title type="html">MyApp Discovery</media:title>
		</media:content>

		<media:content url="http://operatingquadrant.files.wordpress.com/2011/03/stateview-e1300731358443.jpg?w=400" medium="image">
			<media:title type="html">State View</media:title>
		</media:content>
	</item>
		<item>
		<title>Announcements!</title>
		<link>http://operatingquadrant.com/2010/11/23/announcements/</link>
		<comments>http://operatingquadrant.com/2010/11/23/announcements/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 20:39:29 +0000</pubDate>
		<dc:creator>Kristopher Bash</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://operatingquadrant.com/?p=571</guid>
		<description><![CDATA[In October 2010, I started employment with Microsoft, where I am working as a Program Manager on the System Center Operations Manager Cross-Platform team.  This is an opportunity that I am very excited about and I am working with a team that I am really proud to be a part of.  I will continue to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=571&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In October 2010, I started employment with Microsoft, where I am working as a Program Manager on the System Center Operations Manager Cross-Platform team.  This is an opportunity that I am very excited about and I am working with a team that I am really proud to be a part of.  I will continue to blog at this site, and I will focus primarily on OpsMgr Cross-Platform topics. </p>
<p>Additionally, I am excited to announce some new developments regarding the xSNMP and Manage-X for Oracle Management Pack projects.   After developing these Management Pack projects as a solo effort for some time, these projects are now being converted to community-driven projects.  Pete Zerger, of SystemCenterCentral.com, has assembled a fantastic team of MP authoring experts, with a remarkable depth of OpsMgr knowledge,  to drive continued development of these management packs.   </p>
<p>The xSNMP and Manage-X for Oracle MP projects are now homed at:  <a href="http://xsnmp.codeplex.com" target="_blank">http://xsnmp.codeplex.com</a>.   General download, source code, documentation, and discussion can be found at this CodePlex site.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/operatingquadrant.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/operatingquadrant.wordpress.com/571/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/operatingquadrant.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/operatingquadrant.wordpress.com/571/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/operatingquadrant.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/operatingquadrant.wordpress.com/571/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/operatingquadrant.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/operatingquadrant.wordpress.com/571/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/operatingquadrant.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/operatingquadrant.wordpress.com/571/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/operatingquadrant.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/operatingquadrant.wordpress.com/571/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/operatingquadrant.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/operatingquadrant.wordpress.com/571/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=571&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://operatingquadrant.com/2010/11/23/announcements/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/26f47dda05ea2d756f1f83f1164605aa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">KB</media:title>
		</media:content>
	</item>
		<item>
		<title>xSNMP Reports 1.1.1 Now Available!</title>
		<link>http://operatingquadrant.com/2010/09/11/xsnmp-reports-1-1-1-now-available/</link>
		<comments>http://operatingquadrant.com/2010/09/11/xsnmp-reports-1-1-1-now-available/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 15:15:38 +0000</pubDate>
		<dc:creator>Kristopher Bash</dc:creator>
				<category><![CDATA[Management Packs]]></category>
		<category><![CDATA[Reporting]]></category>
		<category><![CDATA[SNMP]]></category>
		<category><![CDATA[System Center Operations Manager]]></category>

		<guid isPermaLink="false">http://operatingquadrant.com/?p=563</guid>
		<description><![CDATA[The xSNMP Reports version 1.1.1 package is now available at manage-x.net.   This suite of management pack adds value to the xSNMP suite by implementing OpsMgr reports for data collected by performance rules in the xSNMP management packs.   Reporting management packs included are: xSNMP for APC Reports xSNMP for APC NetBotz Reports xSNMP for Brocade Reports [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=563&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The xSNMP Reports version 1.1.1 package is now available at <a href="http://manage-x.net/download.aspx">manage-x.net</a>.   This suite of management pack adds value to the xSNMP suite by implementing OpsMgr reports for data collected by performance rules in the xSNMP management packs.   Reporting management packs included are:</p>
<ul>
<li>xSNMP for APC Reports</li>
<li>xSNMP for APC NetBotz Reports</li>
<li>xSNMP for Brocade Reports</li>
<li>xsNMP for Check Point Secure Platform Reports</li>
<li>xSNMP for Cisco Reports</li>
<li>xSNMP for Data Domain Reports</li>
<li>xSNMP for Dell PowerEdge Reports</li>
<li>xSNMP for HP ProCurve Reports</li>
<li>xSNMP for IBM AIX Reports</li>
<li>xSNMP for Juniper Networks Reports</li>
<li>xSNMP for Juniper-NetScreen Reports</li>
<li>xSNMP for NetApp Reports</li>
<li>xSNMP for Net-SNMP Reports</li>
<li>xSNMP for SonicWALL Reports</li>
</ul>
<p>Requirements are:   OpsMgr 2007 R2, xSNMP suite, OpsMgr reporting implementation.   Like the xSNMP suite, the reports MP&#8217;s are licensed with the GNU-GPL and unsealed versions are provided.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/operatingquadrant.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/operatingquadrant.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/operatingquadrant.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/operatingquadrant.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/operatingquadrant.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/operatingquadrant.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/operatingquadrant.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/operatingquadrant.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/operatingquadrant.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/operatingquadrant.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/operatingquadrant.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/operatingquadrant.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/operatingquadrant.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/operatingquadrant.wordpress.com/563/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=operatingquadrant.com&amp;blog=8969466&amp;post=563&amp;subd=operatingquadrant&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://operatingquadrant.com/2010/09/11/xsnmp-reports-1-1-1-now-available/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/26f47dda05ea2d756f1f83f1164605aa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">KB</media:title>
		</media:content>
	</item>
	</channel>
</rss>
