<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Sanjeev's System Center Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/sgopi/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/sgopi/feed.xml</link>
    <description>Getting creative with SCOM!</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:34:55 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Creating UNIX Diagnostic &amp; Recovery Tasks in SCOM</title>
      <link>https://docs.microsoft.com/archive/blogs/sgopi/creating-unix-diagnostic-recovery-tasks-in-scom</link>
      <pubDate>Tue, 15 Dec 2015 16:24:28 GMT</pubDate>
      <dc:creator><![CDATA[Sanjeev Gopinath V]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sgopi/2015/12/15/creating-unix-diagnostic-recovery-tasks-in-scom/</guid>
      <description><![CDATA[&nbsp; Hello All!  Recently, I got an opportunity to work with J Powell from Nine Virtual...]]></description>
      <content:encoded><![CDATA[<p>&nbsp; <p><em>Hello All!</em>  <p><em>Recently, I got an opportunity to work with J Powell from Nine Virtual Technologies. We worked on implementing a diagnostic &amp; recovery solution for some of the critical UNIX workloads in their environment. The challenging part of the problem is that the SCOM 2012 R2 console does not have a UI interface for creating UNIX recoveries &amp; diagnostics. We had to fall back to writing the tasks using MP authoring techniques.</em>  <p><em>We researched a lot and spent quite some time understanding the various nuances. When our tasks worked, it was a eureka moment for both of us! J &amp; myself thought that it would be a great idea to share the steps with you all. And in no time, J wrote this article to be published in my blog.</em>  <p><em>Thank you, J for sharing your expertise with the System Center community.</em>  <p><em>Hope this post helps you save time in creating your UNIX recovery &amp; diagnostic tasks. If you would like to contact J, you can email him at <a href="mailto:j.powell@ninevirtualtech.com">j.powell@ninevirtualtech.com</a>.</em>  <p><em><strong>Sanjeev</strong></em>  <p><strong><em>----</em></strong>  <p>Creating Recovery and Diagnostic Tasks for Linux is not as easy as it is for Windows. I knew from creating Recovery and Diagnostic tasks for Windows servers that I could run a command or script. Turns out this is the same for Linux. I can run a script (bash, python, perl, etc) or a single command.  <p>From researching the topic, I could tell that you had to create a custom Management Pack and edit the XML. However, I could not determine how to put the parts together. Also, I could not find anything specific to SCOM 2012 R2. I wanted to provide a write up on how to manage a Linux process and highlight the pitfalls and how to avoid them.  <p>As an example, let’s monitor the sleep process in Linux. If the sleep process stops, I want it to start back automatically and reset the health of the monitor.  <p>First, login to a Linux shell and issue the command ‘sleep 5000’. This will cause the sleep process to run for 5 minutes.  <p>Now, let’s login to the SCOM Admin Console and go to <b>Authoring &gt; Management Pack Templates &gt; UNIX/Linux Process monitoring</b>  <p>Follow the steps below to create the monitor for the sleep process:  <p>1. Right click on <b>UNIX/Linux Process Monitoring</b> and select <b>Add Monitoring Wizard</b>  <p>2. Select <b>UNIX/Linux Process Monitoring</b> and click <b>Next</b>  <p>3. Under <b>Name</b>, Type a description. For this example, we will use <i>Sleep</i>  <p>4. Under <b>Management Pack</b>, select <b>New</b>. <i>This step is very important</i>. Do not add this monitor to any existing Management Packs, as we will need to export and edit this one in later steps.  <p>5. Once you click <b>New</b>, a new wizard will appear. Name the new Management Pack <i>Sleep</i> and click <b>Next</b>.  <p>6. Under <b>Knowledge</b>, you can leave this part blank. Click <b>Create</b> and you will be returned to the previous Unix/Linux Process Monitoring window. Click <b>Next</b> to continue  <p>7. Under <b>process name</b>, click the <b>Select a process</b> button. You will be prompted to browse for a computer. Clicking the <b>Browse</b> button will display all of the Linux/Unix Computers with the SCOM agent installed. Select the one you executed the <i>sleep 5000</i> command, and hit <b>Select</b>  <p>8. In a few moments, SCOM will display all of the active processes on the Linux server. Select <i>sleep</i> from the list and hit the <b>Select</b> button  <p>9. You will be returned to the Process Monitor window. Notice that the <b>Process Name</b> and <b>Computer to Target</b> fields are now filled in. Also note, the full command is located under the <b>Expression matching Results</b> field. Select it and click <b>Next</b>.  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/32/metablogapi/clip_image002_5C8596A7.gif" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-32-metablogapi/clip_5F00_image002_5F00_5C8596A7.gif"><img title="clip_image002" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/32/metablogapi/clip_image002_thumb_1532D166.gif" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-32-metablogapi/clip_5F00_image002_5F00_thumb_5F00_1532D166.gif" width="513" height="428" /></a>  <p>10. On the <b>Configure process monitoring settings</b>, take the default. This will alert us if the sleep process drops to zero. Hit <b>Next</b>  <p>11. On the Summary screen, hit <b>Create</b>.  <p>After a moment, you will see the process named Sleep appear under the <b>UNIX/Linux Process Monitoring </b>section. Now, that we have created a monitor to keep tabs on the sleep process, we need to export the Management Pack. Go to <b>Administration &gt; Management Packs</b> and search for the one you created named <b>Sleep</b>.  <p>Click on <b>Sleep</b>, then click on <b>Export Management Pack</b> in the upper right-hand corner. You will be prompted to save the file. Save it to your desktop.  <p>Now, with a text editor (I use Notepad ++), open the file and let’s go over some of the parts we need to manually edit:  <p>Notice the version highlighted below:  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/32/metablogapi/clip_image004_395ABCA6.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-32-metablogapi/clip_5F00_image004_5F00_395ABCA6.jpg"><img title="clip_image004" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/32/metablogapi/clip_image004_thumb_6B54EDE1.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-32-metablogapi/clip_5F00_image004_5F00_thumb_5F00_6B54EDE1.jpg" width="344" height="241" /></a>  <p>You will have to change this number in order to import the Management Pack again. Let’s change it to 1.0.0.0.  <p>Scrolling down a bit further, you will see a section of References. You will need to add the portion highlighted below:  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/32/metablogapi/clip_image006_1AA6636C.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-32-metablogapi/clip_5F00_image006_5F00_1AA6636C.jpg"><img title="clip_image006" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="clip_image006" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/32/metablogapi/clip_image006_thumb_3ECE4EAC.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-32-metablogapi/clip_5F00_image006_5F00_thumb_5F00_3ECE4EAC.jpg" width="340" height="349" /></a>  <p>You likely do not have the Unix Authoring Management pack installed. Download it from this link and install it: <a href="https://gallery.technet.microsoft.com/UNIXLinux-Authoring-b16fd2e4">https://gallery.technet.microsoft.com/UNIXLinux-Authoring-b16fd2e4</a>  <p>You also need to view the Unix/Linux Authoring MP in a text editor and make certain the Public Key Token and version numbers match up with the section highlighted in the previous screen shot.  <p>Before we get to the Diagnostic and Recovery Task edits, lets take note of one more item. It is the interval in which the monitor evaluates. For this particular one, the default is to run every 5 minutes. For testing, you may want to change this value to 60, which means it will run every minute. Look for the section to edit based on the screen shot below:  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/32/metablogapi/clip_image008_297329F5.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-32-metablogapi/clip_5F00_image008_5F00_297329F5.jpg"><img title="clip_image008" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="clip_image008" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/32/metablogapi/clip_image008_thumb_6FF2AAAE.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-32-metablogapi/clip_5F00_image008_5F00_thumb_5F00_6FF2AAAE.jpg" width="434" height="153" /></a>  <p>Now, on to the edits that will make a Diagnostic or Recovery Task possible.  <p>To help simplify things, in the following sections I will provide four examples: 2 Diagnostic Tasks and 2 Recovery Tasks. The difference between them will be if you are running a command or a shell script. These examples could be cut-n-pasted into your management pack. Be sure not to change the order of items listed or remove any of the parts below, unless otherwise stated. Doing so will cause errors when you try to import the Management Pack.  <p><b><font size="2">Diagnostic Task for Executing a Command:</font></b>  <p>The following should be inserted between the &lt;/Monitors&gt; and &lt;Overrides&gt; section. Notice the GUID that follows ProcessTemplate and the monitor are the same. This must match the GUID in the &lt;UnitMonitor ID = section of your Management Pack. It will be different from the one below: <pre class="brush: xml; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: true; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">&lt;Diagnostics&gt; 
  &lt;Diagnostic 
      Accessibility=&quot;Public&quot;
      ID=&quot;RunSleep.Diagnostic&quot;
      Remotable=&quot;true&quot;
      Target=&quot;ProcessTemplate_15f945f92c2e467d94742c41989abfa0&quot;
      Enabled=&quot;true&quot;
      Timeout=&quot;300&quot;
      ExecuteOnState=&quot;Error&quot;
      Monitor=&quot;Microsoft.Unix.Generic.ProcessCount.Monitor.ProcessTemplate_15f945f92c2e467d94742c41989abfa0&quot;
      Comment=&quot;In response&quot;&gt;
      &lt;Category&gt;Maintenance&lt;/Category&gt;
      &lt;ProbeAction ID=&quot;ExecuteRecoveryCommandWA&quot; TypeID=&quot;UNIXAuthoring!Unix.Authoring.ShellCommand.ProbeAction&quot;&gt;                          
          &lt;TargetSystem&gt;$Target/Host/Property[Type=&quot;Unix!Microsoft.Unix.Computer&quot;]/PrincipalName$&lt;/TargetSystem&gt;
	 &lt;ShellCommand&gt;export TERM=vt100; sleep 5000&lt;/ShellCommand&gt;
	 &lt;Timeout&gt;30&lt;/Timeout&gt;
          &lt;UserName&gt;$RunAs[Name=&quot;Unix!Microsoft.Unix.ActionAccount&quot;]/UserName$&lt;/UserName&gt;
          &lt;Password&gt;$RunAs[Name=&quot;Unix!Microsoft.Unix.ActionAccount&quot;]/Password$&lt;/Password&gt;
       &lt;/ProbeAction&gt;
  &lt;/Diagnostic&gt;
&lt;/Diagnostics&gt;
</pre>


<p>At the bottom of the Management Pack, in the &lt;DisplayString&gt; section, add the following: <pre class="brush: xml; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: true; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">&lt;DisplayString ElementID=&quot;RunSleep.Diagnostic&quot;&gt;
    &lt;Name&gt;Run the sleep command&lt;/Name&gt;
 &lt;/DisplayString&gt;</pre>


<p>This is how it will look once you reimport the Management Pack: 
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/32/metablogapi/clip_image010_1824E3C1.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-32-metablogapi/clip_5F00_image010_5F00_1824E3C1.jpg"><img title="clip_image010" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="clip_image010" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/32/metablogapi/clip_image010_thumb_157EB8C1.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-32-metablogapi/clip_5F00_image010_5F00_thumb_5F00_157EB8C1.jpg" width="396" height="195" /></a> 
<p><b><font size="2"></font></b>&nbsp; <p><b><font size="2">Diagnostic Task for Executing a Script:</font></b> 
<p>The only two differences between executing a script and a command is substituting the word Command with Script and adding &lt;ScriptArguments&gt;. See the highlighted portion where we changed Command to Script as well as where to add the XML <pre class="brush: xml; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: true; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">&lt;Diagnostics&gt; 
  &lt;Diagnostic Accessibility=&quot;Public&quot; ID=&quot;RunSleep.Diagnostic&quot; Remotable=&quot;true&quot; Target=&quot;ProcessTemplate_15f945f92c2e467d94742c41989abfa0&quot; Enabled=&quot;true&quot; Timeout=&quot;300&quot; ExecuteOnState=&quot;Error&quot; Monitor=&quot;Microsoft.Unix.Generic.ProcessCount.Monitor.ProcessTemplate_15f945f92c2e467d94742c41989abfa0&quot; Comment=&quot;In response&quot;&gt;
    &lt;Category&gt;Maintenance&lt;/Category&gt;
    &lt;ProbeAction ID=&quot;ExecuteRecoveryScriptWA&quot; TypeID=&quot;UNIXAuthoring!Unix.Authoring.ShellScript.ProbeAction&quot;&gt;                          
       &lt;TargetSystem&gt;$Target/Host/Property[Type=&quot;Unix!Microsoft.Unix.Computer&quot;]/PrincipalName$&lt;/TargetSystem&gt;
       &lt;ShellScript&gt;export TERM=vt100; ./sleep.sh&lt;/ShellScript&gt;
       &lt;ScriptArguments&gt; &lt;/ScriptArguments&gt;
       &lt;Timeout&gt;30&lt;/Timeout&gt;
       &lt;UserName&gt;$RunAs[Name=&quot;Unix!Microsoft.Unix.ActionAccount&quot;]/UserName$&lt;/UserName&gt;
       &lt;Password&gt;$RunAs[Name=&quot;Unix!Microsoft.Unix.ActionAccount&quot;]/Password$&lt;/Password&gt;
    &lt;/ProbeAction&gt;
  &lt;/Diagnostic&gt;
&lt;/Diagnostics&gt;</pre>


<p>As in the previous example, add the following to the &lt;DisplayString&gt; Section: <pre class="brush: xml; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: true; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">&lt;DisplayString ElementID=&quot;RunSleep.Diagnostic&quot;&gt;
          &lt;Name&gt;Run the sleep command&lt;/Name&gt;
&lt;/DisplayString&gt;</pre>


<p><b><font size="2">Recovery Task for Executing a Command:</font></b> 
<p>The following should be inserted between the &lt;/Monitors&gt; and &lt;Overrides&gt; section. Notice the GUID that follows ProcessTemplate and the monitor are the same. This must match the GUID in the &lt;UnitMonitor ID = section of your Management Pack. It will be different from the one below: <pre class="brush: xml; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: true; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">&lt;Recoveries&gt; 
  &lt;Recovery ID=&quot;RunSleep.Recovery&quot; Accessibility=&quot;Internal&quot; Enabled=&quot;true&quot;  Target=&quot;ProcessTemplate_15f945f92c2e467d94742c41989abfa0&quot; Monitor=&quot;Microsoft.Unix.Generic.ProcessCount.Monitor.ProcessTemplate_15f945f92c2e467d94742c41989abfa0&quot; ResetMonitor=”true” ExecuteonError=”true” Timeout=&quot;300&quot;&gt;
      &lt;Category&gt;Maintenance&lt;/Category&gt;
      &lt;WriteAction ID=&quot;ExecuteRecoveryCommandWA&quot; TypeID=&quot;UNIXAuthoring!Unix.Authoring.ShellCommand.WriteAction&quot;&gt;                          
         &lt;TargetSystem&gt;$Target/Host/Property[Type=&quot;Unix!Microsoft.Unix.Computer&quot;]/PrincipalName$&lt;/TargetSystem&gt;
         &lt;ShellCommand&gt;export TERM=vt100; sleep 5000&lt;/ShellCommand&gt;
         &lt;Timeout&gt;30&lt;/Timeout&gt;
         &lt;UserName&gt;$RunAs[Name=&quot;Unix!Microsoft.Unix.ActionAccount&quot;]/UserName$&lt;/UserName&gt;
         &lt;Password&gt;$RunAs[Name=&quot;Unix!Microsoft.Unix.ActionAccount&quot;]/Password$&lt;/Password&gt;
      &lt;/WriteAction&gt;
  &lt;/Recovery&gt;
&lt;/Recoveries&gt;</pre>
<p><b><font size="2">Recovery Task for Executing a Script:</font></b> 
<p>The only two differences between executing a script and a command is substituting the word Command with Script and adding &lt;ScriptArguments&gt;. See the highlighted portion where we changed Command to Script as well as where to add the XML: 
<div class="csharpcode">&nbsp;</div><pre class="brush: xml; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: true; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">&lt;Recoveries&gt; 
  &lt;Recovery ID=&quot;RunSleep.Recovery&quot; Accessibility=&quot;Internal&quot; Enabled=&quot;true&quot;  Target=&quot;ProcessTemplate_15f945f92c2e467d94742c41989abfa0&quot; Monitor=&quot;Microsoft.Unix.Generic.ProcessCount.Monitor.ProcessTemplate_15f945f92c2e467d94742c41989abfa0&quot; ResetMonitor=”true” ExecuteonError=”true” Timeout=&quot;300&quot;&gt;
      &lt;Category&gt;Maintenance&lt;/Category&gt;
      &lt;WriteAction ID=&quot;ExecuteRecoveryScriptWA&quot; TypeID=&quot;UNIXAuthoring!Unix.Authoring.ShellScript.WriteAction&quot;&gt;                          
         &lt;TargetSystem&gt;$Target/Host/Property[Type=&quot;Unix!Microsoft.Unix.Computer&quot;]/PrincipalName$&lt;/TargetSystem&gt;
	&lt;ShellScript&gt;export TERM=vt100; ./sleep.sh&lt;/ShellScript&gt;
         &lt;ScriptArguments&gt; &lt;/ScriptArguments&gt;
	&lt;Timeout&gt;30&lt;/Timeout&gt;
         &lt;UserName&gt;$RunAs[Name=&quot;Unix!Microsoft.Unix.ActionAccount&quot;]/UserName$&lt;/UserName&gt;
         &lt;Password&gt;$RunAs[Name=&quot;Unix!Microsoft.Unix.ActionAccount&quot;]/Password$&lt;/Password&gt;
      &lt;/WriteAction&gt;
  &lt;/Recovery&gt;
&lt;/Recoveries&gt;</pre>


<p>Now that the edits are complete, save them and let’s import the Management Pack. Be sure to change the version number at the top of XML or it will not import. If it imports successfully, you can kill the sleep task from the Linux shell and you will see a critical error logged in the SCOM console. Use the Health Explorer to view the results of your Diagnostic or Recovery Task.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>]]></content:encoded>
    </item>
    <item>
      <title>Troubleshooting Cluster Discovery in Operations Manager</title>
      <link>https://docs.microsoft.com/archive/blogs/sgopi/troubleshooting-cluster-discovery-in-operations-manager</link>
      <pubDate>Wed, 14 Oct 2015 17:06:00 GMT</pubDate>
      <dc:creator><![CDATA[Sanjeev Gopinath V]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sgopi/2015/10/14/troubleshooting-cluster-discovery-in-operations-manager/</guid>
      <description><![CDATA[In this post, we'll be focusing on Cluster Discovery issues. Troubleshooting discovery issues in...]]></description>
      <content:encoded><![CDATA[In this post, we'll be focusing on Cluster Discovery issues. Troubleshooting discovery issues in SCOM is pretty easy when it comes to the day-to-day workflows. All that we do is look through the discovery in the MP – find its data source (VBScript mostly) and try executing it manually. However, with Cluster Discovery the procedure is not that straightforward. Cluster discovery in SCOM is carried out by Cluster Modules that are inbuilt in SCOM. The working of these modules is not exposed like how discovery logics are exposed in management packs. Hence we will have to depend on the events logged in ETL traces.

The most common symptom that I hear from my customers is that their SQL instances residing in various cluster instances aren't discovered. While troubleshooting, I’ve seen that it finally ends up being an issue with the cluster discovery.

There are 2 types of cluster discovery issues that are common:
<ol>
	<li>There are many cluster instances in the server and only one shows as discovered.</li>
	<li>None of the cluster instances in the server is discovered.</li>
</ol>
<em>(The procedure to check these have been covered below.)</em>

Before we go through both of these scenarios, there are a few common troubleshooting steps that we need to follow. Start by checking the following:
<ol>
	<li>Do the nodes that host the cluster have SCOM agents installed?</li>
	<li>Do they show up as monitored in SCOM console? (Healthy, Warning or Critical – OK, Greyed out – Not OK)</li>
	<li>Do you have the latest Windows Core OS (Base OS) management packs?</li>
	<li>Is Agent Proxy enabled for the nodes that host the cluster? (Follow: <a href="https://technet.microsoft.com/en-us/library/hh264858.aspx?f=255&amp;MSPPError=-2147217396"><span style="color: #0563c1">https://technet.microsoft.com/en-us/library/hh264858.aspx?f=255&amp;MSPPError=-2147217396</span></a>).</li>
</ol>
Great! We should be more than set now. Now, open the <b>Agentless Managed</b> view in <b>Administration</b> pane. Look for the cluster we are trying to discover against the list that is displayed in this view. Do you see your cluster here? If not, go back to the previous 4 steps and ensure all of them are completed. If you have just followed the above steps and you don’t see your cluster listed, wait for a few more minutes &amp; try refreshing the view again.

If the cluster shows up under Agentless Managed, we need to now check if we can find the individual cluster instances/services. For this, navigate to the <b>Monitoring Pane </b>and choose <b>Discovered Inventory</b>. In the right pane, choose <b>Change Target Type</b>. Look for <b>Windows Cluster Service (For Virtual Server)</b>. Click on OK. Now, type in the cluster name and identify how many instances show up. If you find all your cluster services in the list, the above steps did the trick for you. However, if you don’t find one or all of the cluster services, follow the post further.

From here, we will divide into two tracks covering each scenario respectively.

<b><span style="text-decoration: underline">SCENARIO 1: I see only one cluster instance in the Discovered Inventory (Windows Cluster Service for Virtual Server) view</span></b>

Like I had mentioned, this is a very common scenario and the troubleshooting is not complicated. Try following these steps:
<ol>
	<li>Open <b>SCOM Console</b> and navigate to the <b>Authoring</b> pane.</li>
	<li>Select <b>Object Discoveries</b> under <b>Management Pack Objects</b>.</li>
	<li>If you find that the view has been scoped already, remove the scope.</li>
	<li>Now, look for the following discovery: <b>Windows Clustering Discovery</b></li>
	<li>If you find many, choose the one you see under <b>Windows Cluster </b>or <b>Virtual Server.</b></li>
	<li>Now, right click on the discovery and choose <b>Overrides &gt; Override the Object Discovery.</b></li>
	<li>The next context menu options are left to you. If you want to override it for all the servers, choose the first option. If you would like to have a granular setting, choose an appropriate option that suits.</li>
	<li>You will see that there are three overrideable parameters shown and that <b>Multiple Servers Discovery </b>is one of them.</li>
	<li>Enable this parameter and change its value from <b>False to True.</b></li>
	<li>Scroll towards the extreme right and check the <b>Enforced</b> option.</li>
	<li>Click on Apply &amp; OK.</li>
</ol>
From here on it could take a few minutes. Grab some coffee and when you come back, you should see the other cluster instances to be discovered as well. If you are looking to see the SQL objects residing in the cluster, you should probably give it some more time.

<b><span style="text-decoration: underline">SCENARIO 2: I don’t see any cluster instances showing up in the view</span></b>

To troubleshoot this, we would need to collect ETL traces.
<ol>
	<li>Go to one of the nodes that hosts the cluster and open a cmd prompt in elevated mode.</li>
	<li>Type the following commands at the command prompt:</li>
</ol>
cd C:\Program Files\&lt;operations manager folder<b>\server</b>&gt;\tools

StopTracing.cmd

StartTracing.cmd VER
<ol>
	<li>Restart the <b>Microsoft Monitoring Agent</b> service from <b>Services.msc.</b></li>
	<li>Let the trace run for 15 minutes and then type the following commands:</li>
</ol>
StopTracing.cmd

FormatTracing.cmd
<ol>
	<li>Once the formatting completes, you will find the logs under C:\Windows\Logs\OpsMgrTrace</li>
	<li>Look for the file: TracingGUIDSNative.log</li>
	<li>Open the log and look for the following line:</li>
</ol>
[ModulesClusterLibrary][][Error][][CMOMClusterMonitorDiscovery::NotificationImpl]      [MOMClusterMonitorDiscovery_cpp292]Some of the Virtual server critical (or key) properties is (are) NULL

The above line suggests that the cluster discovery ran but when parsing through the resources, it encountered a number of orphan entries. To resolve the discovery issue, all that we need to do now is clear the Windows Cluster orphan entries from the registry.

Hope that helps!

Do let me know through the comments below if you ran into any issues when implementing this.

- Sanjeev]]></content:encoded>
    </item>
    <item>
      <title>Monitoring Expiring Certificates using SCOM</title>
      <link>https://docs.microsoft.com/archive/blogs/sgopi/monitoring-expiring-certificates-using-scom</link>
      <pubDate>Thu, 17 May 2012 17:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Sanjeev Gopinath V]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sgopi/2012/05/17/monitoring-expiring-certificates-using-scom/</guid>
      <description><![CDATA[Managing too many certificates in your Certificate Server? Unable to keep track of when they'd...]]></description>
      <content:encoded><![CDATA[<p>Managing too many certificates in your Certificate Server? Unable to keep track of when they'd expire? Don't worry! Here's a simple and smart way of proactively monitoring them through SCOM. A completely customizable solution so that you can configure it based on your needs! Sounds exciting? Read further.</p>
<p><span style="text-decoration: underline;"><strong>Our Strategy:</strong></span></p>
<p>Our solution for monitoring ceritifcates is based on a script that provides us information&nbsp;about the&nbsp;expiring ceritificates. For each ceritifcate that expires, our script will create an event in the <strong>Applications</strong> Log. With the help of a SCOM rule, we shall read those events and subsequently notify them as an alert.</p>
<p><span style="text-decoration: underline;"><strong>The 'Magic' Script</strong></span></p>
<p>Though there's nothing magic about it, this script is the core part of our solution. It is based on the certutil.exe that is shipped with Windows OS. The certutil provides us an easy way of querying and obtaining information about Certificates. In Windows 2008+ we can export the result set into a CSV which would have made stuff simpler. But, such options are not available in Windows Server 2003. I've designed the script to be compatible for all the OSs. Read through the script, you should be able to get most of it. Don't copy this script from the page. I've pasted it here&nbsp;so that you can have a glance. If you wish to download the script, you can find&nbsp;it at the bottom of this blog post.</p>
<p><span style="color: #339966; font-family: courier new,courier;">' Certificate Expiration Monitoring Script - CertMonitor</span><br /><span style="color: #339966; font-family: courier new,courier;">' Written by <a href="mailto:sgopi@microsoft.com"><span style="color: #339966;">sanjeevgopinath@live.com</span></a></span></p>
<p><span style="color: #339966; font-family: courier new,courier;">' Place the file under C:\CertMonitor\ folder. If you want wish to place it in a different folder, change the <strong>dump_file_path</strong> variable</span></p>
<p><span style="color: #339966; font-family: courier new,courier;">' This script is given on an as-is basis without any kind of warranties.</span><br /><span style="color: #339966; font-family: courier new,courier;">' ##########################</span><br /><span style="color: #339966; font-family: courier new,courier;">' Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : DAY BASED</span><br /><span style="color: #339966; font-family: courier new,courier;">' Description : Lists certificates that will expire in the next 1 day.</span><br /><span style="color: #339966; font-family: courier new,courier;">' ##########################</span></p>
<p><span style="color: #339966; font-family: courier new,courier;">' ---- VARIABLE DECLARATIONS ----</span><br /><span style="font-family: courier new,courier;">dim file_obj&nbsp;&nbsp;&nbsp; <span style="color: #339966;">&nbsp;' // Holds the Scripting.FileSystemObject for file handling purposes.</span></span><br /><span style="font-family: courier new,courier;">dim line_extract&nbsp;<span style="color: #339966;">' // From the file read, we extract line by line</span></span><br /><span style="font-family: courier new,courier;">dim cert_count&nbsp;<span style="color: #339966;">&nbsp; ' // Holds the current count of certificates found by the script.</span></span><br /><span style="font-family: courier new,courier;">dim event_desc&nbsp;<span style="color: #339966;">&nbsp; ' // Holds the EventCreate event description</span></span><br /><span style="font-family: courier new,courier;">dim file_txt<span style="color: #339966;">&nbsp;&nbsp;&nbsp;&nbsp; ' // Contains the File Handle for the Temporary file</span></span><br /><span style="color: #339966; font-family: courier new,courier;">'---------------------------------</span></p>
<p><span style="color: #339966; font-family: courier new,courier;">' -------- INITIALIZATIONS --------</span><br /><span style="font-family: courier new,courier;">certutil_params="SerialNumber,CommonName,RequestID,RequesterName,NotBefore,NotAfter,CertificateTemplate"</span><br /><span style="font-family: courier new,courier;">dump_file_path="C:\CertMonitor\Day_Log.txt"</span><br /><span style="font-family: courier new,courier;">script_type="day"</span><br /><span style="font-family: courier new,courier;">event_id=101</span><br /><span style="font-family: courier new,courier;">NewDate = DateAdd("d",1,Date)</span><br /><span style="color: #339966; font-family: courier new,courier;">' To Add some more parameters add it after 11:59 PM" like this --&gt;&nbsp; &amp; "YOUR CONDITION" &amp; """"</span><br /><span style="font-family: courier new,courier;">restrict_param=" -restrict ""NotAfter&gt;=" &amp; NewDate &amp; " 12:00 AM,NotAfter&lt;" &amp; NewDate &amp; " 11:59 PM" &amp; """"</span><br /><span style="color: #339966; font-family: courier new,courier;">' Creating Object to work with Shell</span><br /><span style="font-family: courier new,courier;">Set WshShell = CreateObject("WScript.Shell")</span><br /><span style="color: #339966; font-family: courier new,courier;">' Running the Certutil command and dumping the output in dump_file_path</span><br /><span style="font-family: courier new,courier;">cmd_complete="cmd /C certutil -view " &amp; restrict_param &amp; " -out """ &amp; certutil_params &amp; """ &gt; " &amp; dump_file_path</span><br /><span style="font-family: courier new,courier;">WScript.Echo cmd_complete</span><br /><span style="font-family: courier new,courier;">cmd_status = WshShell.Run(cmd_complete, 1, true)</span><br /><span style="color: #339966; font-family: courier new,courier;">' Logging event for the start of script execution.</span><br /><span style="font-family: courier new,courier;">Set cmd_status = WshShell.Exec("eventcreate /t information /l application /id 100 /d ""Running Certutil -view for " &amp; script_type &amp; " based rule.This is just an informational alert generated by the Certificate Expiry Monitoring Script."" /so ""CertMonitor""")</span><br /><span style="color: #339966; font-family: courier new,courier;">' Initializing the file handlers</span><br /><span style="font-family: courier new,courier;">Set file_obj = CreateObject("Scripting.FileSystemObject")</span><br /><span style="font-family: courier new,courier;">Set file_txt = file_obj.OpenTextFile(dump_file_path,1,False)</span><br /><span style="color: #339966; font-family: courier new,courier;">' Low Index contains the Certificate Details starting position from the top.</span><br /><span style="font-family: courier new,courier;">low_index = 0</span><br /><span style="color: #339966; font-family: courier new,courier;">' High Index holds the position of end of Certificate details.</span><br /><span style="font-family: courier new,courier;">high_index = 0</span><br /><span style="color: #339966; font-family: courier new,courier;">' At any given point, cert count tells how many certificates the script has parsed so far.</span><br /><span style="font-family: courier new,courier;">cert_count = 0</span><br /><span style="color: #339966; font-family: courier new,courier;">' Initializing the event description</span><br /><span style="color: #339966; font-family: courier new,courier;">event_desc = "Certificate Details : "</span><br /><span style="color: #339966; font-family: courier new,courier;">' Sub Str is a temporary string used for trimming and removing the quotes</span><br /><span style="font-family: courier new,courier;">sub_str = ""</span><br /><span style="color: #339966; font-family: courier new,courier;">' ------------------------------------</span></p>
<p><span style="color: #339966; font-family: courier new,courier;">' --- LOGIC STARTS HERE ---------------</span><br /><span style="color: #339966; font-family: courier new,courier;">' Extracting line by line using split. chr(10) represents newline.</span><br /><span style="font-family: courier new,courier;">line_extract = Split(file_txt.ReadAll(), chr(10))</span><br /><span style="color: #339966; font-family: courier new,courier;">' For every line in the dump file</span><br /><span style="font-family: courier new,courier;">For i = 0 To UBound(line_extract)</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;' If the line is equal to a Carriage Return, it may represent end of Certificate.</span><br /><span style="font-family: courier new,courier;">&nbsp;If line_extract(i) = VbCr Then</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;' The initial part of CertUtil contains information about the fields. We ignore it by not counting the first occurence</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;If cert_count &gt; 0 Then</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;' This loop extracts all the certificate information and concatenates it in event_desc</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;' low_index + 1 is used so that we remove the "ROW #" line</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;For j = low_index + 1 To high_index</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;' This removes unnecessary spaces.</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;sub_str = trim(line_extract(j))</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;' This removes all the quotes so that the quotes aren't closed by themselves. For e.g. in EventCreate</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;sub_str = Replace(sub_str, """", "") </span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;' The last character is a new line / NULL character. If that's present, we won't get full event description.</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;event_desc = event_desc + "" + Left(sub_str,Len(sub_str)-1)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;Next</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;event_desc = event_desc + "This event was generated by the Certificate Expiry Monitoring Script."</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;' Logs the event in the Application Log</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;Set event_return = WshShell.Exec("eventcreate /t error /l application /id " &amp; event_id &amp; " /so CertMonitor /d """ &amp; event_desc &amp; """")</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;' Waiting for the Command to complete</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;Do While event_return.Status = 0</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;WScript.Sleep 100</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;WScript.StdOut.Write(event_return.StdOut.ReadAll())</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;WScript.StdErr.Write(event_return.StdErr.ReadAll())</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;Loop</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;' Reinitializing event_desc so that we don't have the previous values.</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;event_desc = "Certificate Details : "</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;End If</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;' Incrementing the low_index to point to the starting of next certificate.</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;low_index = i + 1</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;' Incrementing cert_count value as we parsed one paragraph (one para is imagined to contain cert details) completely.</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;cert_count = cert_count + 1</span><br /><span style="font-family: courier new,courier;">&nbsp;Else</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;&nbsp;' If we find the summary information, we stop the script then and there.</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;If instr(1,line_extract(i),"Row Index",0) &gt; 0 Then Exit For</span><br /><span style="font-family: courier new,courier;">&nbsp;End If</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp;' Incrementing as we go line by line</span><br /><span style="font-family: courier new,courier;">&nbsp;high_index = high_index + 1</span><br /><span style="font-family: courier new,courier;">Next</span></p>
<p><span style="text-decoration: underline;"><strong><span style="font-family: arial,helvetica,sans-serif;">How does it work?</span></strong></span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">The script is expected to run once everyday. To confirm if it ran, you can check the&nbsp;Application log for&nbsp;100 EventId. When the script&nbsp;runs,&nbsp;it queries for all the expiring certificates and puts the result&nbsp;it in a temporary file. Since the first part of the result is junk, we omit it and just take the part where we have information about expiring certs. For each certificate entry, it creates a 101 event in the Application Log. If you want to change the event id, you can change the value specified for the event_id variable. Also, in this script we just query few parameters like serial number, etc. If you want to delete or add few more parameters, you can change the <span style="font-family: courier new,courier;">certutil_params <span style="font-family: arial,helvetica,sans-serif;">variable.</span></span></span></p>
<p><span style="font-family: arial,helvetica,sans-serif;"><span style="font-family: courier new,courier;"><span style="font-family: arial,helvetica,sans-serif;">Say, if you want to extend monitoring and be notified before a week or a month, you can do the following...</span></span></span></p>
<p><span style="font-family: arial,helvetica,sans-serif;"><span style="font-family: courier new,courier;"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-family: courier new,courier;"><span style="font-family: arial,helvetica,sans-serif;">Change the value 1 in </span><strong>NewDate = DateAdd("d",1,Date) <span style="font-family: arial,helvetica,sans-serif;">to 7 if you want to be notified before a week and 30 if you want to be notified before a month.</span></strong></span></span></span></span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">You can also change the event id when you wish to monitor for week and month. This way, you can configure the rules to alert with respective priorities. For example Day&nbsp;= High, Week&nbsp;= Medium.</span></p>
<p><span style="text-decoration: underline;"><strong><span style="font-family: arial,helvetica,sans-serif;">What is required from SCOM side?</span></strong></span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">Create an alert generating rule to monitor for NT Events 100 and 101 (or the event Id you have specified). To be very precise, you can&nbsp;specify that&nbsp;the Event Source&nbsp;is 'CertMonitor'.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">If you want to know how to create a alert generating rule for monitoring events from the NT Event Log, read this : <a href="https://technet.microsoft.com/en-us/library/bb309568">https://technet.microsoft.com/en-us/library/bb309568</a></span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">As the rule may run on all Windows Computers, restrict it to run only on the cert servers or the servers where you need to monitor expiring certificates. </span></p>
<p><span style="text-decoration: underline;"><strong><span style="font-family: arial,helvetica,sans-serif;">How do I schedule the script?</span></strong></span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">You can use Windows Task Scheduler for scheduling the script to run once everyday. For more info : <a href="https://technet.microsoft.com/en-us/library/cc748993">https://technet.microsoft.com/en-us/library/cc748993</a></span></p>
<p></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/9432/00/00/03/49/85/85/day.vbs" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-9432-00-00-03-49-85-85/day.vbs">day.vbs</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>