Call home
Once an hour, a gateway tells one other gateway that it is alive: which version it is, what kind of machine it runs on, which modules are installed and how many tags it has. This is the check-in, or call home. It lets the people who make Scadex see which installations exist and what they run. This page says exactly what is sent, and how to turn it off.
What is sent
The check-in is a call to a public named query called call-home on the collecting gateway, with these values and no others:
| Value | What it is |
|---|---|
instanceId | A random identifier made the first time the gateway starts and kept in internal/instance-id in its data folder. It survives restarts and upgrades |
event | start for the first check-in that arrives after the gateway started, ping for the rest |
instanceName | The name from SCADEX_INSTANCE_NAME, if one is set |
version | The gateway's version, such as 0.1.3 or 0.1.3-preview.3 |
os, arch | The operating system as the runtime describes it, and the processor architecture |
startedAt, uptimeSeconds | When the gateway process started, and for how long it has run |
baseUrl | The scheme and host of AUTH_BASE_URL, such as https://plant.example |
modules | The installed modules: each id, version and state |
tagCount | How many tags there are |
Nothing else leaves the gateway: no tag values, tag names or paths, users, passwords, addresses of plant equipment, alarms, screens, or anything read from a database. An administrator can read the exact values the next check-in carries, and the answer to the last one, at GET /api/v1/admin/call-home and in the dashboard.
When
The first check-in goes out 30 to 90 seconds after the gateway starts. After that it goes about once an hour (the interval, spread by 10% either way so installations that started together do not call together). The call waits at most 15 seconds for an answer.
A gateway with no internet connection, or one the collector cannot answer, notices nothing: a failed check-in changes a status and nothing else. It tries again after 2 minutes, then 4, 8, and so on up to the interval, and writes one line to the log when it starts failing and one when it works again.
Settings
| Setting | Default | Meaning |
|---|---|---|
SCADEX_CALL_HOME | on | off (also false, 0, no, disabled) turns it off. Nothing is sent and the gateway does not try |
SCADEX_CALL_HOME_URL | https://app.scadex.io | The collecting gateway |
SCADEX_INSTANCE_NAME | none | A name for this installation, to tell it apart in the collector's list |
SCADEX_CALL_HOME_INTERVAL_MINUTES | 60 | How often, 1 to 1440 |
These are environment variables, read when the gateway starts. See Configuration.
Seeing it
Administrators see it in the dashboard: open Gateway settings and find Call home. It shows the state, the gateway it reports to, the last check-in, the last error, when the next one is due, the instance id, and the values the next check-in carries. Check in now sends one at once. When call home is off it says so and nothing is sent.
The same through the API:
GET /api/v1/admin/call-home (administrator) returns enabled, state (off, waiting, sent or failing), url, instanceId, instanceName, intervalMinutes, lastAttemptAt, lastSuccessAt, lastError, failures, nextAttemptAt, sent (check-ins that arrived since the gateway started) and payload (the values above). POST /api/v1/admin/call-home/send checks in now and returns the same; it answers 409 when call home is off.
Collecting check-ins
Any gateway can be the collector. It needs a public named query called call-home that stores the values above, and a database to keep them in. The gateway at app.scadex.io does this with a table of check-ins, one row each, and the instances query that lists the last one of every installation. The SQL of both is in deploy/collector of the platform repository, with a script that puts the queries on a gateway.