Skip to the page
DataMosaic

Docs · Monitors

Live Hosts

Whether each store's server answers on a port, Linux or Windows, without a ping — setting it up, choosing the ports, and what each reason in the Why column means.

A Live Hosts monitor asks whether each store's server is up. It opens a TCP connection to each one on a port, the way nc -zvw 3 <host> 22 does, and shows which answered:

StatusColourMeans
OnlineGreenA port answered, or, with A refusal counts as online on, the machine refused
OfflineRedNothing answered. Why says what happened instead
No addressGreyThe store has no server address in Business Locations, so it was not asked

In the answer, status is online, offline or nohost.

#Before you start

  • Each store's server address, a hostname or an IP, in a property of Business Locations. A property called Server or POS host on each store, filled in by hand, imported, or synced from a query.
  • A Mosaic inside the network. On Mosaic Cloud, a connection to an address inside a private network is refused, and store servers are almost always inside one. See Run Mosaic.
  • A port each server answers on. See Linux and Windows servers.

Nothing is installed or switched on at the stores, and no password is needed: an open port is the whole question.

#Setting it up

Press + beside Monitors, choose Live Hosts, and fill in:

FieldNotes
NameStore servers to start with
StoresWhich places, as a place query: $Country = France AND $Fascia = Outlet. Empty is every open place. It says how many match as you type
Server addressThe place property that holds each store server's address. It says how many places have one
PortsOne port, or several with commas: 22, 3389 to start with. A server is online when any of them answers. At most 8
A refusal counts as onlineOff to start with. See When no port is known
Wait (seconds)How long a server has to answer: 3 to start with
Check every (minutes)5 to start with, up to once a day

Create monitor builds a workflow of four nodes and switches it on:

  1. On a schedule: every five minutes, or whatever you chose.
  2. Places from Business Locations: one item for each store the query chose, with its address as host. The levels above the stores, which have no address, are left out.
  3. Check a port: a TCP connection to each host on each of the ports, 32 hosts at once. It runs no command, so it works the same on Windows and Linux.
  4. Show on a monitor: what reaches it becomes the monitor's answer.

#The table

ColumnFieldHolds
StorenameThe store's name
CodecodeThe store's code
ServerhostThe address asked
StatusstatusAs above
PortansweredPortWhich port answered: 22 on a row is a Linux server, 3389 a Windows one. Empty on a refusal
Response (ms)responseMsHow long the answer took
WhyerrorEmpty when online; what happened when not
CheckedcheckedAtWhen this store was asked

Each row also carries refused: true where no port took the connection and at least one refused it, whatever the switch says. Add it as a column under Display to see which green rows are refusals.

A monitor made before there was a Port column gets one under Display: add a column whose field is answeredPort.

#Linux and Windows servers

A monitor does not ping. Ping is often blocked between a head office and its stores, so a server that is running would look down. It opens a TCP connection instead, and a connection needs a port that something listens on. Which port depends on the machine:

ServerA port it answers on
Linux22, SSH
Windows3389, Remote Desktop, where it is switched on
Windows445, file sharing, or 135, where the firewall lets them in
Windows5985, Windows Remote Management, where it is set up

Write the ports for every kind of server you have in Ports, with commas: 22, 3389. Each server is tried on all of them at once and is Online when any one answers.

A server that is up but answers on none of them is Offline, and Why says so:

Refused: the machine answered, but nothing is listening on any of 22, 3389.

Refused means the machine was there to say no, which is what a Windows server says to port 22. Add a port it does answer on, or see When no port is known.

#When no port is known

Sometimes there is no port to name: the Windows servers answer on nothing you can count on, and all the monitor gets from them is the refusal. The refusal is still an answer. A machine that is switched off refuses nothing.

A refusal counts as online, in the setup and in Settings, takes it as one. With it on, a server that refuses every port it is tried on is Online. Its Port is empty, because no port took the connection, and its response time is how long the refusal took. A port that does answer is still preferred, so a Linux server keeps its 22.

It is off to start with, for one reason. A firewall between Mosaic and a store can be set to reject connections rather than drop them, and then it refuses on behalf of a server that is down. With the switch on, that server would be shown Online. Turn it on where the refusal comes from the server itself.

#A network that answers for everyone

Some networks answer for the servers. A security gateway, or a tunnel client on the machine Mosaic runs on, can complete every connection itself, so any address looks online on any port whether or not a machine is there.

Check once, from the machine Mosaic runs on: a store address you know has no machine must come out Offline. If it comes out Online, the monitor is asking the gateway and not the stores, and belongs on a machine inside the network, past the gateway.

#What Why says

WhyMeansWhat to do
Refused: the machine answered, but nothing is listening on any of 22, 3389.The machine is there, and nothing listens on those portsAdd a port it answers on, or turn on A refusal counts as online
No answer within 3 s.Nothing came back in time: the server is off, or a firewall on the way drops the connection without a wordCheck the server. If it is up, the firewall between Mosaic and the store must let the port through
Unknown host: the name does not resolve.The address is a name the machine Mosaic runs on cannot look upFix the address in Business Locations, or use the IP
Unreachable: no route to the host.The network has no way to that addressThe store's line is down, or the address is wrong
Reset by the host.The connection was accepted and cut at onceUsually a service on that port refusing this caller; try another port
No address.The store's server address property is emptyFill it in under Business Locations
… is an address inside the network, which Mosaic Cloud does not call.The monitor runs on Mosaic CloudRun the monitor on a Mosaic inside your network

A server is tried on at most 8 ports: more is a scan of it, not a check.