Quick start: setting monitoring 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:

      While you typically include both the group and the service name using the format "--service group-name/service-name", you must not include the group when the service is in the _default services group. For services in the _default group, simply provide the service name using the format "--service service-name".

      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:

  • For an overview of how to monitor with alarms, see How alarms work.
  • You can display a list of all available alarms by executing the gasadmin command: gasadmin monitoring update --list-alarm.
  • You can manage alarms by configuring them, setting, and unsetting them.
  • You can fine tune alarms by setting thresholds to suit the speed of your network.
  • When debugging, you can raise the monitoring level. This provides you with more details in the monitoring data (.dat) files to help you detect abnormal events.
  • There are different ways of working with and managing the data stored in dat files.