HowTo: Create a Monitor to Restart a Stopped Application

From SCInterface Wiki

Jump to: navigation, search

The purpose of this document is to summarize the process of adding monitors and event triggers to a given application or device that is controlled by SCInterface.


Contents

Installing Monitors and Triggers on an Application

The following describes how to install and configure a monitor and trigger within SCInterface (v2.2.20071217 or later). Make sure to complete both of these steps:

  1. Verify Dependencies
  2. Add the Application Monitor and Trigger
    1. Add the Application Monitor
    2. Add the Application Trigger

Verify SCInterface Dependencies

The following must be confirmed prior to proceeding with these steps:

  1. SCInterface is fully installed.
    1. SCM is installed on a Linux server and started.
      1. SCM's PostgreSQL database is running.
    2. The UI is running.
      1. the UI's PHP enabled web server is running.
    3. The SC is installed on the server that you will be monitoring.
  2. The application that is being monitored is installed on the same system as the SC and SCInterface is fully able to start and stop the application through the web UI.
  3. The necessary macros (restart macro).

Add the Application Monitor and Trigger

The following describes how to add the monitor and trigger to monitor the status of the application and restart it if it has stopped responding. Both of these steps must be completed to ensure that the server is restart if it is stopped for some reason:

  1. Add the Application Monitor
  2. Add the Application Trigger

Add the Application Monitor

  1. Go under the Config or Admin section for the FFOW application that you wish to monitor.
  2. Click Add Monitor under the Start/Stop button.
  3. Make sure the following are selected:
    1. Select an Application:
      <This should be the name of your application or device and should be automatically selected>
    2. Select a Macro:
      status
    3. Query Interval: (5 minutes is a good time interval
      Every 0 days 0 hours 5 minutes 0 seconds
    4. Start Date: (M/D/Y h:m:s): (today's date)
      Dec 17 2007 0 0 0
    5. Stop Date: (M/D/Y h:m:s): (This should be as long as the monitor should run the application)
      Dec 31 2008 0 0 0
    6. Timezone Offset:
      GMT
  4. Click Add to add the monitor.

Next, we should Add the Application Trigger.

Add the Application Trigger

  1. Click on the Monitors Tab
  2. Your application or device should be listed with the following macro show:
    status [results] (↑)
    • If the status for the monitor shows as this:
      status [results] (↓)
      ...then your monitor is not running. Make sure that the current time is between the Start and Stop for the monitor.
  3. Click on the (↑) to edit the monitor.
  4. Click the Triggers button.
    • If you are taken to the View Trigger page, click Add Trigger link directly under Triggers to add a new trigger.
  5. You should now be on the Add Trigger page.
  6. The Trigger Device should already be selected as your application or device. This is the device that we will be invoking the event on if the device goes down.
  7. The Trigger Macro should be set to restart.
  8. The page will refresh and four more fields will appear. These fields must be set as defined:
    1. Trigger Name:
      Restart stopped application
    2. Trigger Condition: (1 indicates that the device is stopped)
      == 1
    3. Trigger Delay (Seconds):
      0
    4. Trigger Interval (Seconds):
      0
  9. Click Add Trigger.
  10. Click View Trigger to view the triggers for this monitor. You should see the Restart stopped application trigger. The restart macro will be invoked if the status macro returns a 1.
    • 0 = The application is running according to the status macro.
    • 1 = The application is stopped according to the status macro.
    • 3 = The application is not available (i.e. the home directory does not exist) status macro.

Additional References

Personal tools