Configure monitoring with commands file

Configure monitoring for Web services by running commands from a file.

Before you begin:

Ensure the dispatcher is shut down. The gasadmin monitoring preload command must be run when the dispatcher is not running. If the dispatcher is running, the commands may be executed but the GAS will not take the configuration into account.

In this task you create a list of commands you want to execute in order to perform various monitoring tasks on Web services and you save them to a commands file. For example, you can enable monitoring for services and set various alarms and thresholds.

Familiarize yourself with how to create the commands file. To view the list of available alarms, use the command gasadmin monitoring update --list-alarm.

  1. Create your command file. For example, call it mycmdfile.
  2. Create a list of commands and save them to the file.

    For example, enter one command per line.

    update --enable --service mygroup/my_web_service
    update --set-alarm DVM_NOT_STARTED --service mygroup/my_web_service
    update --set-alarm DVM_NOT_CONNECTED --service mygroup/my_web_service
    # ...
  3. Run the command to load the configuration
    gasadmin monitoring preload -d dispatcher mycmdfile Where dispatcher can be httpdispatch, fastcgidispatch, or isapidispatch.
    If the preload command detects that the configuration already exists, you will be prompted to overwrite it with following message:
    Warning: monitoring configuration detected, and may be used by httpdispatch.
    Overwrite monitoring configuration (y/n) ? 

    If there is no error, the GAS outputs a message with the line number (for example, "#1") for each command executed. You will see one line per command completed:

    Overwriting monitoring configuration for httpdispatch.
    Loading command at line #1 done.
    Loading command at line #5 merged.
    Loading command at line #8 merged.
    Loading command at line #9 done.
    

    Where the result is either "done" or "merged":

    • done means the GAS has configured the first command for this service.
    • merged means the GAS has configured a previous command for that service, and is merging it with the current command.
  4. Restart the dispatcher and check the monitoring status.
    For example, check the monitoring status for the service with:

    gasadmin monitoring status --service mygroup/my_web_service

    You should see output like this written to stdout:
    Monitoring status for service :mygroup/my_web_service
      MONITORING: enabled.
      ALARM:DVM_NOT_CONNECTED,threshold:1.
      ALARM:RESPONSE_ERROR,threshold:1.
      ALARM:REAL_DVM_START_TIME,threshold:1.