Skip to main content
Documentation

My server stopped reporting

A Stopped reporting badge or alert on a host means no report arrived for 3 hours. Alopex cannot see the machine, only its reports, so this page helps you work out which of these happened: the job did not run, the report was refused, the request did not reach Alopex, or the server is gone.

Note

Servers and threats are in beta. They appear only on accounts where Alopex has switched them on.

Stopped reporting

What you see

The server's badge reads Stopped reporting, and the people on your account get a Server stopped or resumed reporting alert that says when the last report arrived. Alopex checks every five minutes, so the mark can follow the third hour by a few minutes. The next report that Alopex accepts clears the mark and sends the same alert type again. See About servers.

Environments and hosts that have never reported do not get this alert. An environment shows Reports on deploy, and a host that has never reported shows Waiting for first report.

Likely causes

  • The cron job is not running. The crontab entry was lost, cron is stopped, the user was removed, or the machine was off or restarted.
  • The script was never installed, or /usr/local/bin/alopex-reporter.sh was deleted.
  • The ALOPEX_TOKEN line is missing from the crontab, or is not above the job line.
  • The token was regenerated or the server was deleted, so the old token gets 401.
  • The report is refused for another reason: 403 when servers are switched off for the account or the account is suspended, 413 or 422 when the report is too large or invalid, or when a host's token receives an --environment report (or the reverse), 429 when too many requests arrive for one token.
  • The machine cannot make outbound https requests to et.alopex.uk.
  • curl or gzip is no longer installed.

How to check

  1. Open the server and note the Reported line under the server's name. Compare it with when the job should have run.

  2. Look at the cron user's crontab. As root, run crontab -u alopex-reporter -l. The ALOPEX_TOKEN line and the job line should both be there.

  3. Run the job by hand as the cron user, with your token. As root:

    su -s /bin/sh -c 'ALOPEX_TOKEN=<token> /bin/sh /usr/local/bin/alopex-reporter.sh' alopex-reporter
    

    An accepted report prints nothing and the badge changes to Reporting. A refused report prints a message, such as curl: (22) The requested URL returned error: 401. The number is the status in the table in What the reporter sends.

  4. If the script prints set ALOPEX_TOKEN, ALOPEX_TOKEN looks wrong or curl and gzip are required, it did not get as far as sending. Fix what it names. ALOPEX_TOKEN looks wrong means the value contains something other than letters, digits and underscores, such as a space, a quote mark or the angle brackets of <token>.

  5. Check that cron ran the job at all, using your system's cron log or the output cron mails to the user.

How to fix

  • If the cron entry or the script is missing, install again with the commands under Reporter on the server page. See Add a server.
  • If the token is wrong, select Regenerate token, copy the new token and run the install commands again. They replace the ALOPEX_TOKEN line. Do the same if you lost the token.
  • If the status is 413 or 422, run the script with --dry-run and check the output is a single JSON object. A server with more than 20,000 packages is refused.
  • If the status is 429, check that only one job reports for this token. One report an hour is all a host needs.
  • If outbound https is blocked, allow it to et.alopex.uk.
  • If you retired the machine, delete the server. See Server settings.

It reports but the details look wrong

A report replaces the inventory each time, so the page shows the last report and nothing older.

  • A program is missing from Components: the script found no version line for it, or the line was not one Alopex recognises. It looks in PATH and a few fixed folders, and cron's PATH is short. If the program is in another folder, add a PATH line above the job line in the crontab that includes it. Programs from one installed package appear as one component, and a database server is kept over its client. See What the reporter sends.
  • A component has Not known as its version, or Lifecycle unknown: Alopex has no version for it, or no release dates for that version. A component you added by hand without a version is the usual case.
  • The server page and the threats do not change after you upgraded software: the next report brings the new versions. Run the reporter by hand to avoid waiting for the hour. If the old version is still listed, look at what the script finds with sh /usr/local/bin/alopex-reporter.sh --dry-run, which prints the path and version of each program. It lists every copy it finds, so an old copy in another folder still appears until you remove it.

Software that you added by hand stays until you remove it, whatever the reporter finds.