HowTo: Create a Monitor to Restart a Stopped Application
From SCInterface Wiki
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:
Verify SCInterface Dependencies
The following must be confirmed prior to proceeding with these steps:
- SCInterface is fully installed.
- SCM is installed on a Linux server and started.
- SCM's PostgreSQL database is running.
- The UI is running.
- the UI's PHP enabled web server is running.
- The SC is installed on the server that you will be monitoring.
- SCM is installed on a Linux server and started.
- 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.
- 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:
Add the Application Monitor
- Go under the Config or Admin section for the FFOW application that you wish to monitor.
- Click Add Monitor under the Start/Stop button.
- Make sure the following are selected:
- Select an Application:
- <This should be the name of your application or device and should be automatically selected>
- Select a Macro:
- status
- Query Interval: (5 minutes is a good time interval
- Every 0 days 0 hours 5 minutes 0 seconds
- Start Date: (M/D/Y h:m:s): (today's date)
- Dec 17 2007 0 0 0
- 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
- Timezone Offset:
- GMT
- Select an Application:
- Click Add to add the monitor.
Next, we should Add the Application Trigger.
Add the Application Trigger
- Click on the Monitors Tab
- 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.
- Click on the (↑) to edit the monitor.
- 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.
- You should now be on the Add Trigger page.
- 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.
- The Trigger Macro should be set to restart.
- The page will refresh and four more fields will appear. These fields must be set as defined:
- Trigger Name:
- Restart stopped application
- Trigger Condition: (1 indicates that the device is stopped)
- == 1
- Trigger Delay (Seconds):
- 0
- Trigger Interval (Seconds):
- 0
- Trigger Name:
- Click Add Trigger.
- 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.

