Troubleshooting Cross Platform Discovery and Agent Installation (part 3)

This is part of a multi-part article (if you didn't gather that from the title). For easy reference, here are all the parts.

(part 1) Scenario #1 - "There were no computers that met the specified discovery criteria"

(part 2) Scenario #2 - "SSH discovery failed." with "unspecified problem"

(this article) Scenario #3 - "Did not find a matching supported agent"

(part 4) Scenario #4 – "New computer shows as Platform: Unknown and Version: Unknown"

Scenario #3 - "Did not find a matching supported agent"

I barely got past my last issue, and now in DebugView I see this (note the last line):

 [6556] 9| DiscoveryScript.Discovery.Task returned as succeeded 
[6556] 9| Return from DiscoveryTaskHelper.ExecuteOSInformationScript() 
[6556] bd9a8d8f-2686-48f9-9831-a04bb45459c9 | 9 | Return from DiscoveryTaskHelper.ExecuteSSHDiscovery() 
[6556] Microsoft.MOM.UI.Console.exe Information: 0 : 
[6556] bd9a8d8f-2686-48f9-9831-a04bb45459c9 | 9 | 10.10.10.17: ExecuteSSHDiscovery successful. 
[6556] bd9a8d8f-2686-48f9-9831-a04bb45459c9 | 9 | Set MonitoringTaskResult 
[6556] bd9a8d8f-2686-48f9-9831-a04bb45459c9 | 9 | Call to DiscoveryTaskHelper.GetSupportedAgentInfo() 
[6556] bd9a8d8f-2686-48f9-9831-a04bb45459c9 | 9 | Return from DiscoveryTaskHelper.GetSupportedAgentInfo() 
[6556] Microsoft.MOM.UI.Console.exe Error: 0 : 
[6556] bd9a8d8f-2686-48f9-9831-a04bb45459c9 | 9 | 10.10.10.17: Did not find a matching supported agent. 

Ok, so apparently, even though I imported the CentOS management pack and made copies of the Red Hat agents to work for CentOS, OpsMgr still thinks this is an unsupported system. So now what? Well, I have to think of the components that OpsMgr uses to make this determination…

  1. The results of the GetOSVersion.sh script

    is compared to…

  2. The CentOS Management Pack class:Microsoft.Linux.CentOS.5.i386.Discovery (since this is an x86 computer)

    which then deploys…

  3. The agent RPM file itself

Let's examine each to see what's going wrong…First the GetOSVersion.sh script. The DebugView output doesn't show anything about the results of running the script, so I go back to the debug logs in the C:\Windows\temp folder and find SSHCommandProbe.log. Looking in this log file, I see this XML was returned:

 <DiscoveredOS>
    <Hostname>centos55-x86</Hostname>
    <OSName>CentOS</OSName>
    <OSAlias>CentOS</OSAlias>
    <Version>5.5</Version>
    <Arch>i686</Arch>
    <IsLinux>true</IsLinux>
</DiscoveredOS>

Now I compare that to my MP's discovery class (of which, the "InstanceSettings" part is shown below):

 <ClassId>$MPElement[Name="Microsoft.Linux.CentOS.5.SupportedAgent"]$</ClassId>
  <InstanceSettings>
    <Settings>
      <Setting>
        <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/UnixOS$</Name>
        <Value>CentOS 5 (i386)</Value>
      </Setting>
      <Setting>
       <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/Version$</Name>
       <Value>1.0.3</Value>
     </Setting>
     <Setting>
       <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/Build$</Name>
       <Value>106</Value>
     </Setting>
     <Setting>
       <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/OS$</Name>
       <Value>CentOS</Value>
     </Setting>
     <Setting>
       <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/Arch$</Name>
       <Value>i386</Value>
     </Setting>
     <Setting>
       <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/ArchFriendly$</Name>
       <Value>i386</Value>
     </Setting>
     <Setting>
       <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/ArchKitName$</Name>
       <Value>i386</Value>
     </Setting>
     <Setting>
       <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/Ext$</Name>
       <Value>rpm</Value>
     </Setting>
      <Setting>
        <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/MinVersion$</Name>
        <Value>5</Value>
      </Setting>
      <Setting>
        <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/ComputerType$</Name>
        <Value>Microsoft.Linux.CentOS.5.Computer</Value>
      </Setting>
      <Setting>
        <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/KitOSVersion$</Name>
        <Value>5</Value>
      </Setting>
      <Setting>
        <Name>$MPElement[Name="Unix!Microsoft.Unix.SupportedAgent"]/TaskVersion$</Name>
        <Value>5</Value>
       </Setting>
    </Settings>
</InstanceSettings>

Comparing the <Arch> element of the script results and the "Arch$" setting in the MP, I see my problem… My MP says "i386" and my GetOSVersion script says "i686". So, My MP is wrong and needs to be changed. And, before I go creating yet another scenario step, I know my agent RPM file name needs to be changed too in order to be consistent. So I will change the "Arch$", "ArchFriendly$" and "ArchKitName$" settings in the MP to "i686" (and increment the version number of the MP) and change my file name to scx-1.0.4-258.centos.5.i686.rpm.

Now I will re-run the discovery and see what happens. Ah-ha! This time it says "Found a matching supported agent". Great! My discovery wizard shows the correct OS and architecture:

image_thumb[1]

Now I can select the computer and deploy the agent. It's successful! Just to show you what that looks like in DebugView, here's the output:

 [6556] Entered Install/Upgrade Process 
[6556] Call to executeDeploymentTask() 
[6556] Return from executeDeploymentTask() 
[6556] Microsoft.MOM.UI.Console.exe Information: 0 : 
[6556] centos55-x86: Deployment was successful 
[6556] Entered Install Process 
[6556] Call to executeInstallationTask() 
[6556] Return from executeInstallationTask() 
[6556] Microsoft.MOM.UI.Console.exe Information: 0 : 
[6556] centos55-x86: Installation was successful 
[6556] Call to DiscoveryTaskHelper.ExecuteWSManDiscovery() 
[6556] Return from DiscoveryTaskHelper.ExecuteWSManDiscovery() 
[6556] Microsoft.MOM.UI.Console.exe Information: 0 : 
[6556] centos55-x86WS-Man result validation was successful 
[6556] Call to DiscoveryTaskHelper.SignHostCertificate() 
[6556] Return from DiscoveryTaskHelper.SignHostCertificate() 
[6556] Microsoft.MOM.UI.Console.exe Information: 0 : 
[6556] centos55-x86: Certififcate was signed successfully 
[6556] Begin Post-Process WS-Man Validation Process 
[6556] Call to DiscoveryTaskHelper.ExecuteWSManDiscovery() 
[6556] Return from DiscoveryTaskHelper.ExecuteWSManDiscovery() 
[6556] WS-Man result has no exceptions 
[6556] Call to DiscoveryTaskHelper.GetSupportedAgentInfo() 
[6556] Return from DiscoveryTaskHelper.GetSupportedAgentInfo() 
[6556] Microsoft.MOM.UI.Console.exe Information: 0 : 
[6556] centos55-x86: Post-Process WS-Man Validation succeded 
[6556] End Post-Process WS-Man Validation Process 
[6556] Microsoft.MOM.UI.Console.exe Information: 0 : 
[6556] centos55-x86: Discovery into OpsMgr succeeded 

I click Done to exit the discovery wizard and now I can go see how my new computer shows up in the console. It's not quite what I expect though.

More on that in part 4.