HowTo: Create a Port Monitor to Restart an Unresponsive Application

From SCInterface Wiki

Jump to: navigation, search

The purpose of this document is to summarize the process of adding a UDP or TCP port monitor and an event trigger 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 port monitor and trigger within SCInterface (v2.2.20071217 or later). Make sure to complete both of these steps:

  1. Add the Port 11000 Monitor and Trigger
    1. Add the Port 11000 Monitor
    2. Add the Port 11000 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 Port 11000 Monitor and Trigger

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

  1. Add the Port 11000 Monitor
  2. Add the Port 11000 Trigger

Add the Port 11000 Monitor

  1. Go under the Config or Admin section for the application or device 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. For the Select a Macro:, choose one of the following depending if you need to monitor a TCP or UDP port:
      1. Status on TCP Port
        -OR-
      2. Status on UDP Port
    3. Macro Parameters: (Set portnumber to the port that you wish to monitor)
      23
    4. Query Interval:
      Every 0 days 0 hours 5 minutes 0 seconds
    5. Start Date: (M/D/Y h:m:s): (This should be the current date and time)
      Dec 17 2007 0 0 30
    6. Stop Date: (M/D/Y h:m:s): (This should be as long as the monitor should run)
      Dec 31 2008 0 0 0
    7. Timezone Offset:
      GMT
  4. Click Add to add the monitor.

Next, we should Add the Port 11000 Trigger.

Add the Port 11000 Trigger

  1. Click on the Monitors Tab
  2. Your application or device should be listed with the following macro shown:
    1. Status on TCP Port [results] (↑)
      -OR-
    2. Status on UDP Port [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 server that we will be invoking the event on if the port becomes unresponsive.
  7. The Trigger Macro should be set to restart.
  8. The page will refresh and four more fields will appear. These fields should be set as defined:
    1. Trigger Name:
      Restart unresponsive port
    2. Trigger Condition:
      == 0
    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 unresponsive port trigger. The restart macro will be invoked if the Status on TCP Port or Status on UDP Port macro returns a 0.
    • 0 = The application is not running on the port.
    • 1 = The application is running on the port.


Additional References

Personal tools