Atlas Knowledge Base
Dashboard
SBN Frontend

SBN Frontend

The SBN Frontend service - delivers signals into SBN and is the authenticated gateway SBN Media uses for all SBN API calls.

api-engine
configuration
sbn-frontend
sbn-media
sbnfrontend
signals

SBN Frontend

The SBN Frontend is the link between SBN Media and SBN. It delivers signals and events into SBN, and it is the single point through which SBN Media talks to the SBN API.

Overview

The SBN Frontend signs in to SBN once, holds the session, and renews it automatically when it expires. Everything SBN Media needs to send to or read from SBN goes through this one service, so the other services do not each have to hold SBN credentials. It does several related jobs:

  1. Delivers signals. It turns events from the media and alarm services - a device connecting or disconnecting, an alarm stream starting or stopping, a client connecting to a call - into signals in SBN, and it writes connection comments to the alarm log so there is an audit trail.
  2. Acts as the gateway for SBN API calls. The other SBN Media services do not call SBN directly. They ask the SBN Frontend to make the call, and it runs the call against SBN using its session. This is why only the SBN Frontend needs SBN credentials. It can also validate a token against SBN on behalf of another service.
  3. Sends a heartbeat. It regularly tells SBN it is alive, so a loss of connectivity is visible.
  4. Publishes live traffic (optional). When enabled, it polls SBN for recent log activity and shares it with the other services, so they can react to SBN activity without polling SBN themselves.
  5. Runs: When configured. A deployment can run more than one.
  6. Required: Yes, in practice. It both delivers signals to SBN and is how every other service reaches the SBN API. Without it, signals are not delivered and the other services cannot talk to SBN.
  7. Depends on: NATS, and a reachable SBN API Engine with valid credentials.

Configuration

The SBN Frontend is configured under the sbnfrontend namespace. View the defaults with ./sbn-media config eject and set host-specific overrides in sbn-media.local.yaml.


Setting

Default

Description

sbnfrontend.url

a lab address

The SBN API Engine address to connect to. Set this to your SBN.

sbnfrontend.username

empty

The account used to sign in to SBN.

sbnfrontend.password

empty

The password for that account.

sbnfrontend.heartbeatDurationInSeconds

300

How often, in seconds, to send a keep-alive heartbeat to SBN.

sbnfrontend.errorAccount

VIDERROR

The SBN account SBN Media uses to report on itself - its heartbeat and its own log warnings and errors. This account must exist in SBN.

sbnfrontend.clientAddress

a lab address

The SBN Anywhere address given to clients so they can connect back to a call or video, for example for lift alarms.

sbnfrontend.liveTrafficDurationInSeconds

0

How often, in seconds, to poll SBN for recent log activity. 0 turns live traffic off.

sbnfrontend.liveTrafficMaxRows

100

The most log entries to read in one live-traffic poll.

sbnfrontend.apiExecLongDurationInMs

1500

If an SBN API call takes longer than this many milliseconds, a warning is logged. Useful for spotting a slow SBN.

sbnfrontend.zoneMap

empty

Maps each SBN Media service to a zone code, used on the signals it raises - including the warnings and errors SBN Media reports to the error account.

sbnfrontend.testMode

false

When true, the service runs without signing in to SBN or sending real signals. Useful for testing.

sbnfrontend.log.requests

false

Log the requests sent to SBN. Turn on to troubleshoot.

sbnfrontend.log.responses

false

Log the responses received from SBN. Turn on to troubleshoot.

Example:

sbnfrontend:
# The SBN API Engine to connect to.
url: "https://your-sbn-api-engine/"
username: "your-account"
password: "your-password"

# Keep-alive interval, in seconds.
heartbeatDurationInSeconds: 300

# The account used when a signal cannot be matched to a normal account.
errorAccount: "VIDERROR"

After changing these settings in sbn-media.local.yaml, reload the configuration for them to take effect.

FAQ

Alarms or events are not reaching SBN. What should I check?

Confirm the SBN Frontend is running and that sbnfrontend.url, username, and password are correct and the SBN API Engine is reachable from this host. Turn on sbnfrontend.log.requests and sbnfrontend.log.responses to see the calls being made to SBN and the replies. If the service will not start, run it in the foreground with sbn-media service exec sbnfrontend -ld to see the error.

Do the other services need their own SBN credentials?

No. Only the SBN Frontend signs in to SBN with its own account, and the other services make their SBN API calls through it - so they do not each need SBN credentials. When a request arrives through the API Proxy carrying a user's token, the SBN Frontend uses that token for the call, so the call runs as that user; when there is no caller token, it uses its own service sign-in. It renews the sign-in automatically when it expires. This is why the SBN Frontend is needed even on a host that is not itself raising alarms - it is how everything reaches SBN.

What is the error account?

The error account is the SBN account that SBN Media uses to report on itself. It files its own status under this account - a regular heartbeat so SBN can see that SBN Media is alive, and warnings or errors from the SBN Media logs - each tagged with the zone code of the service that produced it (this is what sbnfrontend.zoneMap is for). It is set by sbnfrontend.errorAccount (VIDERROR by default). Make sure the account exists in SBN, and watch it to monitor the health of SBN Media from within SBN.

How can I test without sending real signals to SBN?

Set sbnfrontend.testMode to true. The service runs as normal but does not sign in to SBN or deliver signals, so you can exercise the rest of the system without creating live incidents.

How often does it contact SBN?

It makes a call each time an event needs to be delivered or another service asks it to run an SBN API call. In addition it sends a keep-alive heartbeat every sbnfrontend.heartbeatDurationInSeconds (300 seconds by default), and, if live traffic is enabled, it polls SBN every sbnfrontend.liveTrafficDurationInSeconds.

Related pages

  1. SBN Media Overview (SBN-Media/overview)
  2. Installing and Configuring SBN Media (SBN-Media/installation)
  3. API Proxy (SBN-Media/Platform/api-proxy)




Was this helpful?