Skip to content

Agent status ​

logcore-agent status asks the running agent for a full health report: its connection to Logcore, host metrics, APM, and every service with its files.

sh
sudo logcore-agent status
powershell
logcore-agent status

The command needs root (or Administrator), because it reads a token that only the agent can access.

Example output ​

Logcore Agent (v0.3.0)
======================
  Status:        Running (pid 1234), up 3h12m5s
  Hostname:      web-01
  Tags:          env:prod, role:web
  Config:        /etc/logcore-agent/logcore.yaml
  Services dir:  /etc/logcore-agent/services

Forwarder
=========
  Server:        https://logcore.lsofito.com
  API key:       lc_ef62dab7…0a63
  Connection:    OK (connected)
  Last success:  2s ago
  Logs sent:     18,204 (1.9 MB compressed)
  Dropped:       0    Send errors: 0
  Queue:         0 / 5000

Host metrics
============
  Interval:      15s
  Last sample:   9s ago
  CPU 13.6%   Memory 41.0%   Disk 63.2% (/)

APM (OpenTelemetry)
===================
  Receiving:     OTLP/gRPC 127.0.0.1:4317   OTLP/HTTP 127.0.0.1:4318
  Traces:        212 requests, 9,830 spans
  Metrics:       96 requests, 2,114 metrics
  Logs:          104 requests, 1,207 records
  Last forward:  4s ago

Services
========

  nginx [OK]
  ----------
    Config:     /etc/logcore-agent/services/nginx.yaml
    Paths:      /var/log/nginx/*.log
    Rules:      0 include, 1 exclude
    Files:      2 tailed
      /var/log/nginx/access.log  (12.1 MB read of 12.1 MB, 100%)
      /var/log/nginx/error.log  (3.2 KB read of 3.2 KB, 100%)
    Events:     18,950 read, 18,204 sent, 746 filtered by rules
    Last event: 1s ago

  payments [WAITING]
  ------------------
    Config:     /etc/logcore-agent/services/payments.yaml
    Paths:      /var/log/payments/*.log
    Files:      none match yet (checked every few seconds)

Reading the report ​

Forwarder ​

FieldMeaning
Connection: OKThe last request to Logcore succeeded.
Connection: ERROR (API key rejected…)The key is wrong or was revoked. Use a valid key. See Change the API key.
Connection: ERROR (connection refused / timeout / no such host)Network, DNS, firewall or proxy problem between the server and Logcore.
DroppedLines that couldn't be delivered. This should be 0.
QueueLines waiting to be sent. If it stays near the limit, Logcore is unreachable or slow.

Services ​

StateMeaning
[OK]At least one file matches and is being followed.
[WAITING]No file matches the path yet. The agent keeps checking. Check the path with ls.
[ERROR]A file matches but can't be read, usually permission denied. See file permissions.

Events shows lines read, lines sent, and lines dropped by your include and exclude rules (filtered by rules).

APM (OpenTelemetry) ​

If APM is off, this section reads Disabled. Uncomment the apm: block in logcore.yaml…. If it's on, it shows the listen addresses, the traces, metrics and log records forwarded, and a Last error line when forwarding fails.

Exit codes and JSON ​

Exit codeMeaning
0The agent is running.
3The agent isn't running.

Use -json for machine-readable output, for example in your own health checks:

sh
sudo logcore-agent status -json | jq '.forwarder'
sh
sudo logcore-agent configcheck   # validate config + list matched files (also: test-config)
sudo logcore-agent version
sudo journalctl -u logcore-agent -n 100 --no-pager   # agent's own log (Linux)