Skip to content

The secondary of CSP

This page is for the administrator of the two servers: the primary, with CSP (Central Syslog), and the secondary, with CSPH (Central Syslog Headless). The secondary receives the same logs as the primary and gives them back when the primary could not receive them.

Installing the secondary

The secondary is a separate server, with CSPH (see Installation):

esapanel-setup --modules=csph

CSP and CSPH cannot be on the same server: the secondary listens on the ports of its primary. The module must also be in the license of the secondary.

At first the secondary listens on no port: it receives them from the primary when you pair it. The firewall of the secondary opens them by itself; if the secondary is behind an external firewall or a NAT, the ports must be opened there by hand.

Keep the clocks of the two servers in sync (NTP): the logs read back have the time at which the secondary received them.

The pairing

  1. On the secondary, in Organization › API accounts, create an account with the Master server role and a key of its own. The key is shown only once.
  2. On the primary, in Modules › Secondary of CSP, write the Address of the panel of the secondary, with the port, as you open it in the browser (for instance https://csph.example.com:9943), and the Key of the API account. Press Save the pairing.

The primary gives the secondary its ports and its license: the secondary starts listening and shows them on its page. When the primary assigns new ports, it gives them to the secondary too.

If the certificate of the secondary is not signed by a recognised authority, the page of the primary shows the Certificate of the secondary, the only one accepted (SHA-256 fingerprint): the fingerprint of the one that answered when you paired. The primary accepts only that one; if the secondary gets a new certificate, save the pairing again. With a certificate from an authority, such as Let's Encrypt, there is no fingerprint to pin.

With the key the primary can give the ports and read the logs received, but it cannot delete them nor change for how many days the secondary keeps them. A secondary has one primary.

Remove the pairing detaches the secondary from the primary; the secondary keeps the logs it has for its days.

On the secondary: Secondary of CSP (CSPH)

The Modules › Secondary of CSP (CSPH) page of the secondary shows:

  • the Primary: its Server and the API account it paired with. Until a primary has paired, the page explains how to do it;
  • the Ports received, with when the primary last gave them (Last given) and the Last reading of the logs;
  • the Reception: "Receiving" with the time of the last probe, or "Not receiving: no probe in the last minutes": check that rsyslog runs, for instance with systemctl status rsyslog;
  • the Days kept: the first and the last day of logs the secondary has.

Days to keep, from 3 to 30, says for how many days the logs stay on the secondary before they are deleted. The primary can read back an interruption only within these days: a longer interruption is filled only in part. Only the secondary decides it.

The license of the secondary

The license of the secondary must cover the one of the primary: the same level or higher; between two Company licenses, at least the devices of the primary; between two Integrator licenses, at least its customers. If it does not cover it, the page says so and the secondary refuses new ports; those it already has keep receiving. The same problem shows on the page of the primary.

On the primary: Secondary of CSP

After the pairing, the Modules › Secondary of CSP page of the primary shows the State of the secondary: the Last check, the Server, the Reception (receiving or not) and the Days it has, with how many it keeps.

Every five minutes the primary checks that the secondary answers, receives and has the same time. When a problem starts you receive the alert "A problem of the secondary of CSP", and another when it ends:

  • it does not answer;
  • it does not receive: its probe has not arrived for some minutes;
  • its clock differs from the one of the primary by a few seconds: the logs read back would have a wrong time;
  • its license does not cover the one of the primary.

While the problem lasts, what the primary does not receive cannot be read back from the secondary.

Reading back

By itself. At the end of each interruption of the reception, the primary asks the secondary for the logs of that interval, with a margin before and after, and passes them to the subscriptions as if they had just arrived, with the time at which the secondary received them. The logs the primary already has are left out, so there are no duplicates. In Modules › Log reception the interruption says "read back: … logs".

Beside an interruption. If an interruption was not read back, for instance because the secondary did not answer, Log reception has Read back from the secondary.

An interval. In Secondary of CSP, Read back an interval reads back the logs between From and To: for an interruption the panel did not record, or after a disaster recovery of the primary, from the moment of the backup onwards. Within the days the secondary keeps.

A device that sends to the primary only has nothing to read back: for it the line of the interruption stays in the logs.

The instructions for the customers

When the primary has a secondary, the instructions of each device, on its page and when a device is added, have the Secondary server line: "also to …, port …, the same logs". The files for rsyslog and NXLog that the panel prepares send to both servers, each with its own queue. The devices the customers have already configured must be updated: ask the customers to add the secondary.