> For the complete documentation index, see [llms.txt](https://docs.layeronecloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layeronecloud.com/monitoring-agent.md).

# LayerOne Agents

Source project: `LayerOne Agents` (migrated from `README.md`). Run commands from the code checkout and directory specified below, not from this documentation repository.

This directory is the standalone LayerOne monitoring and Looking Glass agent. It uses only Python's standard library and does not need Django, PostgreSQL, Redis, Celery, SMTP credentials, `SECRET_KEY`, or a copy of the web project.

## Install on Ubuntu <a href="#install-on-ubuntu" id="install-on-ubuntu"></a>

1. In the Operations console, open **Settings → Monitoring agents**.
2. Create and name the agent, then select its worker group.
3. Copy the one-time API key.
4. Copy this directory to the Ubuntu host and run:

   ```bash
   chmod +x install.sh
   sudo ./install.sh
   ```

The installer asks only for the API key. It installs the required operating system packages, copies the runtime to `/opt/layerone-agent`, stores the key in `/etc/layerone-agent/agent.env`, creates a restricted system user, installs the systemd unit, enables it, and starts it. Rerunning the installer replaces the runtime and restarts the service so the updated code takes effect immediately.

The API URL defaults to `https://layeronecloud.com`. The API key identifies the agent and the web app returns its name, worker group, and region at check-in. The agent claims Looking Glass commands over the same outbound HTTPS connection used for monitoring and posts output lines back while the command is running. No public agent URL, inbound port, DNS record, or TLS termination is required.

## Service commands <a href="#service-commands" id="service-commands"></a>

```bash
systemctl status layerone-agent.service
journalctl -u layerone-agent.service -f
systemctl restart layerone-agent.service
```

The former inbound Looking Glass listener remains available only when `LOOKING_GLASS_AGENT_URL` is explicitly set, for a rolling upgrade from older control-plane releases. New installations should leave it unset.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.layeronecloud.com/monitoring-agent.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
