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 :


  <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">
 <WriteAction ID="SSHCommand" TypeID="Unix!Microsoft.Unix.SSHCommand.WriteAction">
  <Command>/etc/init.d/acpid restart</Command> 

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>


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