Host agents: certificates, renewal and what you see in Netlens

  • A certificate made by Netlens is valid for 30 days. The collectors do not renew it by themselves: schedule the renewal script. Without it the host goes silent when the certificate ends. Netlens warns 7 days before (an event, and a problem on the dashboard).
  • Renewal presents the current certificate and a new request to https://NETLENS:4318/renew; the answer is the new certificate followed by the CA certificate(s) Netlens uses, which the scripts merge into ca.pem. The old certificate keeps working for at most 7 more days, so a failed restart does not lose the host. A certificate that has already ended cannot renew: enrol again. At most one renewal per hour.

Linux (contrib/netlens-renew.sh, needs openssl and curl), once a day from cron or a timer:

sh 0 3 * * * NETLENS_RENEW_URL=https://NETLENS:4318/renew NETLENS_DIR=/etc/otelcol-contrib/netlens NETLENS_OWNER=root:otelcol-contrib \ NETLENS_RESTART="systemctl restart otelcol-contrib" /opt/netlens/netlens-renew.sh

It does nothing until fewer than 20 days are left (NETLENS_RENEW_DAYS).

Windows (contrib/netlens-renew.ps1, PowerShell 7.4+), as a scheduled task running as SYSTEM once a day:

powershell pwsh -File C:\ProgramData\netlens-agent\netlens-renew.ps1 -RenewUrl https://NETLENS:4318/renew -Service otelcol-contrib

With the certificate in C:\ProgramData\netlens-agent\ as in the examples. * Revoke (Settings → Host agents → Revoke): refused from the next request on, including on connections that are already open. Enrol again makes a new token and cancels the current certificate. Delete removes the agent and the monitor it fed; the stored readings stay. * Server certificate: the one Netlens makes lasts about 13 months and is renewed when you change the names. Replace it with your own under Server certificate. * CA lifetime and rotation: the ingest CA lasts 10 years. Netlens reports it in its last year (an event and a problem on the dashboard), and you can rotate it at any time (Settings → Host agents → Rotate the CA) without losing a host: 1. A new CA is made. New and renewed certificates come from it. The old CA stays trusted and keeps signing the server certificate, because the hosts still trust only the old one. 2. Every host renews. The renewal brings the new CA: the renewal scripts add it to ca.pem (the old one stays, so the host trusts Netlens before and after). Run the script with NETLENS_RENEW_DAYS=40 (PowerShell: -RenewDays 40) to renew at once; with the daily schedule every host renews by itself within about ten days. 3. The panel lists the agents that still hold a certificate from the old CA. When it says every agent has one from the new CA, press Finish the rotation. Netlens stops trusting the old CA and signs the server certificate with the new one. 4. Finish anyway locks out the agents still on the old CA until they are enrolled again (Netlens asks first and writes it to the audit log). Cancel the rotation is possible until the first agent has a certificate from the new CA.

Certificates from your own CA are not affected. * Your own CA: certificates are checked against the CA certificates you uploaded; renew them with your own tooling; see above.

What you see in Netlens

  • The device shows the readings like any other monitored host (Health, graphs, limits). The method is agent; the monitor cannot be edited by hand, and a device that is monitored another way cannot be linked.
  • Settings → Host agents lists each agent: state (enrolled, waiting for enrolment, revoked, silent), when it last sent, from which address, readings accepted/dropped, requests refused, days left on the certificate.
  • Events and alerts: Agent silent (no data for three times the sending interval, at least three minutes, or an hour for an agent that never sent anything; once, and Agent sending again when it recovers), Agent certificate ending (7 days before, once a day), Agent enrolled. They go to your alert channels and log forwarding like other events, and the silent agent and the ending certificate are on the dashboard’s list of problems. Silence is not the same as the host being down: the network or the collector may be the cause, so combine it with a ping or service check.
  • Audit log: every change and every refusal, as described under Security model.
  • AI: the Ask question “which agents are silent?”, the MCP tool get_agent_status and GET /api/agent-status give the status without secrets; the readings are available to Ask, the assistant, reports and the investigation like those of any other host.