Quick start: Setting alarms

Monitoring involves deciding what to monitor and configuring alarms for a Genero Application Server (GAS) session or service.

Before you begin

Ensure the Genero Application Server is started. For this quick start, you can use the standalone dispatcher (httpdispatch).

Ensure you have access to the Genero demo applications. Start the demo calculator service. For details of using this service, see Explore Genero demo Web services (server side).

Monitoring the GAS involves setting monitoring alarms to capture critical events, such as when a DVM fails to start, when a DVM crashes, when there are request/response errors, and so on. GAS monitoring configuration can be done on a service or on a service session.

For this quick start, you will set a DVM_NOT_STARTED monitoring alarm on a service running on the GAS. All configuration will be done at the command line using the gasadmin tool.

  1. At the command line, check what services are running.
    gasadmin session --list
    The standard output shows details of the services and applications (if any) running on the dispatcher. In the sample output, the "Calculator" Web service is started and has a session id. The service name is "demo/Calculator", as Calculator is in the demo group. When configuring monitoring for services, you must use the format of [group/]service_name.
    Session list: (httpdispatch)
      - d98290172c8f7c0d861db329f1ce6597 (demo/Calculator)
        Port: 59226
        Type: WebServices
        Pid : 17184
        GSID:
  2. Check if any monitoring alarm has been set.
    You check by session id or service name, using the gasadmin monitoring status command.
    • To check monitoring status by session id:

      gasadmin monitoring status --session d98290172c8f7c0d861db329f1ce6597

      The output message shows the session monitoring status as disabled.

      Monitoring status for session :d98290172c8f7c0d861db329f1ce6597 
      MONITORING: disabled. 
      LEVEL: MIN.
    • To check monitoring status by service name:

      gasadmin monitoring status --service demo/Calculator

      The output message shows the session monitoring status as disabled.

      Monitoring status for service :demo/Calculator 
      MONITORING: disabled. 
      LEVEL: MIN.
  3. Enable monitoring.
    You enable monitoring by session id or service name, using the gasadmin monitoring update command.
    • To enable monitoring for a session:

      gasadmin monitoring update --enable --session d98290172c8f7c0d861db329f1ce6597

      The output message shows the session monitoring status as enabled.

      Update monitoring configuration for session :d98290172c8f7c0d861db329f1ce6597
      Ok. 
    • To enable monitoring for a service:

      gasadmin monitoring update --enable --service demo/Calculator

      Important: Default group services:

      Normally, you enable service monitoring with the --service option by specifying the group and the service name. For example [group/]mySevice. However, the group must not be set when the service is in the "_default" services group.

      Tip: Monitoring can be enabled for services not started. The monitoring starts when the service next starts up.

      The output message shows the service monitoring status as enabled.

      Update monitoring configuration for service :demo/Calculator
      Ok. 
  4. Configure or update monitoring.
    You configure monitoring by session id or service name, using the gasadmin monitoring update --set-alarm alarm_type command option. The configuration takes effect immediately.
    • Set the DVM not started alarm on a session.

      gasadmin monitoring update --set-alarm DVM_NOT_STARTED --session d98290172c8f7c0d861db329f1ce6597

    • Set the DVM not started alarm on a service.

      gasadmin monitoring update --set-alarm DVM_NOT_STARTED --service demo/Calculator

  5. Check the monitoring configuration.

    You check the monitoring status by repeating step 2. The output message this time should show the monitoring status as enabled with the configured alarms.

  6. Reset configuration.
    You can remove the monitoring configuration by session id or service name using the gasadmin monitoring reset command. Choose from the following:
    • Reset the session monitoring configuration.

      gasadmin monitoring reset --session d98290172c8f7c0d861db329f1ce6597

      The output message shows the session monitoring status.

      Reset status for session :d98290172c8f7c0d861db329f1ce6597
      Ok. 
    • Reset the monitoring configuration for a service.

      gasadmin monitoring reset --service demo/Calculator

      The output message shows the service monitoring status.

      Reset monitoring for service :demo/Calculator
      Ok.
What to do next

Having completed this quick start you have a basic knowledge of working with monitoring. There are many more ways of using this feature: