Partager via


Creating the Recovery Task for Linux Services in SCOM 2007

Once you create a monitor for Linux services and wonder how to create a recovery task for service restart. Here is how you can do that.

The following would go in a custom MP that has the Unix Library MP defined in the References sections with the Alias "Unix".

 Insert this in the  section, right after the closing </Discoveries> tag :

 

<Recoveries>
<Recovery ID="Custom.SCX.Restart.Recovery" Accessibility="Public" Enabled="false" Target="MicrosoftUnixServiceLibrary!Microsoft.SystemCenter.UnixService" Monitor="MicrosoftUnixServiceLibrary!Microsoft.Unix.Generic.Service.Monitor" ExecuteOnState="Error" ResetMonitor="false" Remotable="true" Timeout="300">
<Category>Maintenance</Category>
<WriteAction ID="SSHCommand" TypeID="Unix!Microsoft.Unix.SSHCommand.WriteAction">
<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 restart</Command>
<TimeoutSeconds>120</TimeoutSeconds>
</WriteAction>
</Recovery>
</Recoveries>

Make sure to define the Display Strings as well:

 

        <DisplayString ElementID=" Custom.SCX.Restart.Recovery">

          <Name>SSH Daemon Recovery</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>

MP attached in this blog. Hope this Helps!!

Note: This MP attached is just an example for HTTPD service, you can change the service name in the override page.

- Chandan Bharti

Custom.HTTPDService.Recovery.Unix.MP.xml

Comments

  • 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 a recovery task for Linux services in OpsMgr 2007 - Information Store - ExchangeBlog - TechNetKlub
  • 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 recently posted a great article over on his personal blog about how to
  • 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 a recovery task for Linux services in OpsMgr 2007 - System Center Mindenkinek - TechNetKlub