Skip to content

Check that the agent works

The agent works when its service runs and when Guardioz shows a recent snapshot for your server. This page has one confirmation for each, and says when each answer arrives. Right after the installation the agent’s log reports that the service is waiting for its first own collection; the line that reports a sent snapshot appears one hour later.

  • The port of the PostgreSQL instance you registered. The service carries the port in its name. The examples use 5432. Replace 5432 with the port of your PostgreSQL instance.
  • Administrator rights on the server that runs PostgreSQL.
  • Your Guardioz sign-in at https://app.guardioz.com/, for the section Confirm the server in Guardioz.
  1. On the server that runs PostgreSQL, show the state of the agent’s service.

    Run this command with administrator rights:

    Terminal window
    sudo systemctl status guardioz-agent-5432 --no-pager

    Look at the line that starts with Active:. When the service runs, that line reads active (running).

    When the command answers that it cannot find the unit, the port in the name is not the one you registered. List the agent services with:

    Terminal window
    systemctl list-unit-files 'guardioz-agent-*'

    The answer is immediate. A service that does not run is the first thing to fix, so go to Agent and data problems before you look further.

  2. Show the last 50 lines of the agent’s log.

    The agent writes to the system journal. Reading one service’s messages needs administrator rights:

    Terminal window
    sudo journalctl -u guardioz-agent-5432 -n 50 --no-pager

    The journal puts its own date and time, the host name, and the process name with its process id, such as python[1234]:, in front of every line. The agent’s own message comes after that.

    Each message the agent writes begins with the date, the time, the level and [guardioz-agent]. When the agent reports an error in full, the lines that follow the message carry no such prefix. The message that proves a snapshot reached Guardioz is the following:

    Snapshot sent (HTTP 202)

    Right after a start, the log carries this message instead:

    Waiting 3600s before first collection (registration already sent a snapshot).

    That message is normal. It means that the service is waiting for its first own collection, and 3600s means 3600 seconds, that is one hour. The section When the next snapshot arrives says why the service waits.

  1. In your browser, sign in to Guardioz at https://app.guardioz.com/ and open Servers.

    The row for your server shows Last seen, the age of the newest snapshot Guardioz has for it. Never means that no snapshot has arrived yet. This row is the answer for the server from this installation.

    The dot in the Status column shows how recent that snapshot is. The agent sends one snapshot per hour, and the dot stays green while they arrive. It turns yellow when no snapshot has arrived for 90 minutes, and red after 150 minutes. After a restart the service waits one hour before it collects, so two snapshots can be up to about two hours apart, and the dot can turn yellow for a while after a restart while the agent works normally. See What the status dot shows.

  2. Open Findings.

    The Findings page shows Latest snapshot: with the age of the newest snapshot among the servers it lists, and No snapshots received yet. when none of them has sent one. Without a server filter that is the newest snapshot across all your servers, not the age for one server, so for the server from this installation pick it in the server filter, or read Last seen on the Servers page.

    Guardioz analyses a snapshot after it accepts it, so the first findings appear within a few minutes of the snapshot.

The installation sends a snapshot of its own when it registers the server. The installer sets the collection interval to one hour, so the service then waits one hour before its first own collection.

This wait happens after every start of the service, not only after the installation.

All clear next to a recent Latest snapshot: line means that no group of checks has an open finding on your servers. An empty or healthy database gives that result. Guardioz runs its checks after it stores a snapshot, so in the first minutes after the first snapshot the checks can still be running. Reload the page a few minutes later before you take All clear as the result for this server.

All clear together with No snapshots received yet. means something else: no snapshot has arrived from any of your servers, so nothing has been analysed. In that case return to the section Confirm the agent on the server.

No open findings in place of All clear means that nothing is open, and that at least one server in the view has sent no snapshot for more than 150 minutes. That server is named under the heading. See When snapshots stop arriving.

To see the checks that passed, change the view on the Findings page from Issues only to All checks. How to read the page: Read your findings.