Skip to main content
Version: Next

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:

ValueWhat it is
instanceIdA random identifier made the first time the gateway starts and kept in internal/instance-id in its data folder. It survives restarts and upgrades
eventstart for the first check-in that arrives after the gateway started, ping for the rest
instanceNameThe name from SCADEX_INSTANCE_NAME, if one is set
versionThe gateway's version, such as 0.1.3 or 0.1.3-preview.3
os, archThe operating system as the runtime describes it, and the processor architecture
startedAt, uptimeSecondsWhen the gateway process started, and for how long it has run
baseUrlThe scheme and host of AUTH_BASE_URL, such as https://plant.example
modulesThe installed modules: each id, version and state
tagCountHow 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​

SettingDefaultMeaning
SCADEX_CALL_HOMEonoff (also false, 0, no, disabled) turns it off. No check-in is sent and the gateway does not try. It also stops the gateway asking for newer licences by itself, as the next section says
SCADEX_CALL_HOME_URLhttps://app.scadex.ioThe collecting gateway
SCADEX_INSTANCE_NAMEnoneA name for this installation, to tell it apart in the collector's list
SCADEX_CALL_HOME_INTERVAL_MINUTES60How often, 1 to 1440

These are environment variables, read when the gateway starts. See Configuration.

Asking for licences​

The gateway also asks the same collector, or the gateway that SCADEX_LICENSE_URL names, whether there is a newer version of its licence, and for the list of withdrawn keys and vendors, every 6 hours. That is a separate call with contents of its own, listed on Licensing, and it is part of call home: SCADEX_CALL_HOME=off turns it off. A person who presses the button to redeem a code or check for a newer licence sends that request with call home on or off.

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.