Legacy TASS Sensors in Stratus - brief description

1. Overview

'lts' module brings 'ltsd' daemon and associated config files to Stratus
ltsd connects to TASS gateway and listens to notifications. 
When notification comes, ltsd creates event for Stratus sensor object which has HW_ID specified in message

2. Activation

After Stratus is activated, execute from root:
    /opt/sarch/lts/bin/activate.lts

This will register 'ltsd' daemon process, add special set for TASS sensors and create required directory structure in /var/sarch
Application should be restarted after activation of 'lts' module
ltsd is running on Master only

3. Configuration

ltsd reads 2 config files: 
    * /var/sarch/lts/ltsd.conf - contains only two params: IP address and tcp port of TASS gateway
    * /var/sarch/lts/cmd.map - contains mapping of command IDs to pair of values: eventtype and event message
      each line of cmd.map can be one of the following:
        <CMD>=<eventtype>,<event msg>
        <CMD>=ignore
      eventtype is "alert", "info"
      "ignore" - for commands that should be ignored by ltsd
      If ltsd receives command that isn't mentioned in cmd.map it will ignore it and print warning to log file

Sample config files ltsd.conf.sample and cmd.map.sample are located in /opt/sarch/lts/etc
They will be copied to /var/sarch/lts when 'lts' module is activated, where they should be edited

4. Admin GUI

When 'lts' module is activated (flag file ACTIVATED is located in /var/sarch/lts) sensor of model 'TASS' can be added in Admin GUI.
TASS sensors can be configured on nodes as well as on Master.
When configuring TASS sensor you should specify "Sensor ID" - integer in (0..255) range.

Special user set 'Legacy TASS Sensors' is added on 'lts' module activation. It is not a protected or default one, so admin user 
should be instructed about using it for TASS sensors 

5. Test scripts

Test scripts are located in SVN repo in lts/src/test and aren't installed with Stratus distribution.

    * ltsgw - TASS gateway emulator. Daemon that opens listen socket and receives commands
      from one client, converts it to 'lts-compatible' format and retransmits it to all other connected clients
      It requires single command-line argument - TCP port to listen on.
      Log messages are printed to console
      
    * send_cmd - script for sending commands to ltsgw
      Usage:
        send_cmd GW_HOST GW_PORT CMD SENSOR [PORT]
      Where:
        GW_HOST - ip or DNS name of gateway host
        GW_PORT - TCP port gateway is listening on
        CMD     - command code (decimal)
        SENSOR  - internal sensor id (0-255)
        PORT    - sensor port number
      Example:
        send_cmd 127.0.0.1 24000 136 25 1

6. Deactivation and reactivation

'lts' module cannot be correcty deactivated
Reactivation is safe, but requires patrol restart

7. Logging

ltsd uses logger config file /opt/sarch/lts/etc/logger_ltsd.conf
It logs to /var/sarch/log/system_ltsd.log
Default log level is DEBUG
