Partager via


SCOM 2007- How to create a Diagnostic task for Unix/Linux services

I have already shown on how you can create the recovery task for Unix services in my previous blog Here. And that was meant to run when the state changes from healthy to critical. But personally, i didn't like that. So i feel its good to allow those services to be queries if its stopped or not, and only then run the recovery. Isnt that Cool!!

Here is how you can create a Diagnostic task for Unix/Linux services.

<!-- Add below lines just below the tag </Discoveries> and right above the tag <Recoveries> -->

 <Diagnostics> 
  <Diagnostic Accessibility="Public" ID="Microsoft.Unix.ACPID.Restart.Diagnostic" Remotable="true" Target="MicrosoftUnixServiceLibrary!Microsoft.SystemCenter.UnixService" Enabled="false"              Timeout="300" ExecuteOnState="Error" Monitor="MicrosoftUnixServiceLibrary!Microsoft.Unix.Generic.Service.Monitor" Comment="In response">
      <Category>Maintenance</Category>
    <ProbeAction ID="Invoke" TypeID="Unix!Microsoft.Unix.SSHCommand.ProbeAction">                          
     <Host>$Target/Property[Type="MicrosoftUnixServiceLibrary!Microsoft.SystemCenter.UnixService"]/ComputerName$</Host>
     <Port>22</Port>
     <UserName>$RunAs[Name="Unix!Microsoft.Unix.PrivilegedAccount"]/UserName$</UserName>
    <Password>$RunAs[Name="Unix!Microsoft.Unix.PrivilegedAccount"]/Password$</Password>
    <Command>/etc/init.d/acpid -status</Command>
    <TimeoutSeconds>20</TimeoutSeconds>
   </ProbeAction>
  </Diagnostic>
</Diagnostics>

Once this is done, please add the Display string as well

 <DisplayString ElementID="Microsoft.Unix.ACPID.Restart.Diagnostic">
  <Name>ACPID Diagnostic</Name> 
   <Description>WARNING: Running this diagnostic is unsecure, do not run this against machines you do not trust as it may expose credentials to an unknown system.</Description> 
</DisplayString>
 

Also please make sure to edit your Recovery task Where you have an entry "ExecuteOnState="Error"  Described in https://blogs.technet.com/b/chandanbharti/archive/2011/12/21/creating-the-recovery-task-for-linux-services-in-scom-2007.aspx

So basically you have to change it to ExecuteOnDiagnostic="Microsoft.Unix.ACPID.Restart.Diagnostic"

Remember, this is created under a custom MP. Next import the MP to the console. You should see your Diagnostic task created     

-Chandan

Comments

  • Anonymous
    January 09, 2012
    Dear all, I there any way to generate alert with red hat linux physical memory performance.

  • Anonymous
    January 12, 2012
    I think this can help you www.opsvault.com/extending-the-cross-platform-monitoring-agent-in-operations-manager-2007-r2

  • Anonymous
    December 28, 2013
    Microsoft’s own Chandan Bharti posted another great article over on his personal blog about how to create

  • Anonymous
    December 28, 2013
    Pingback from How to create an OpsMgr 2007 diagnostic task for Unix/Linux services - Safranka M??ty??s szakmai blogja - TechNetKlub

  • Anonymous
    December 28, 2013
    Microsoft’s own Chandan Bharti posted another great article over on his personal blog about how to create