Senzor Server Agent is a lightweight, secure, and reliable telemetry collector designed for Server infrastructure. Written in TypeScript and distributed via Docker, it ensures minimal footprint while providing production-grade monitoring.
- Real-time Metrics: Captures CPU, Memory, Disk, and Network I/O.
- Zero-Config Networking: Uses outbound HTTP/S requests. No firewall ports need to be opened.
- Lightweight: Optimized Node.js runtime with strict resource limits.
- Secure: Runs in a read-only Docker container; data is authenticated via API Keys.
- Resilient: Auto-restarts on failure and queues metrics if the network momentarily drops.
This script automatically detects your operating system, installs Docker (if required), and configures the Senzor agent.
# Replace the variables below with your actual Senzor dashboard credentials
export SERVER_ID="your-server-id"
export API_KEY="your-api-key"
export API_ENDPOINT="https://api.senzor.dev/api/ingest/stats"
curl -sL https://raw.githubusercontent.com/senzops/server-agent/main/install_agent.sh | sudo -E bash -Download the script manually, review it if desired, then run it interactively.
curl -sLO https://raw.githubusercontent.com/senzops/server-agent/main/install_agent.sh
chmod +x install_agent.sh
sudo -E ./install_agent.shIf you prefer to run the container manually:
docker run -d \
--name senzor \
--restart unless-stopped \
--network host \
--pid host \
--memory="150m" \
--cpus="0.1" \
-v /:/host/root:ro \
-v /sys:/host/sys:ro \
-v /proc:/host/proc:ro \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-e SERVER_ID="<YOUR_SERVER_ID>" \
-e API_KEY="<YOUR_API_KEY>" \
-e API_ENDPOINT="https://api.senzor.dev/api/ingest/stats" \
ghcr.io/senzops/server-agent:latestFind the docker-compose.yml
- Download the file: Save the above linked file as
docker-compose.ymlon your server. - Edit Credentials: Open the file and replace the placeholders with your actual IDs from the dashboard:
SERVER_ID="<YOUR_SERVER_ID>"
API_KEY="<YOUR_API_KEY>"
API_ENDPOINT="https://api.senzor.dev/api/ingest/stats"- Start the Agent:
docker-compose up -d- View Logs:
docker-compose logs -f- Docker Image:
ghcr.io/senzops/server-agent - Custom Docker Options :
--name senzor --restart unless-stopped --network host --pid host --memory="150m" --cpus="0.1" -v /:/host/root:ro -v /sys:/host/sys:ro -v /proc:/host/proc:ro -v /var/run/docker.sock:/var/run/docker.sock:ro
- Add the following environment variables in Environment Variables:
SERVER_ID="<YOUR_SERVER_ID>"
API_KEY="<YOUR_API_KEY>"
API_ENDPOINT="https://api.senzor.dev/api/ingest/stats"The agent is configured entirely via Environment Variables.
| Variable | Description | Default | Required |
|---|---|---|---|
| SERVER_ID | Unique ID from your Senzor Dashboard | null | Yes |
| API_KEY | Secret Key for authentication | null | Yes |
| API_ENDPOINT | The ingest URL of the backend | http://localhost... | Yes |
| INTERVAL | Time between checks (in seconds) | 60 | No |
| NODE_ENV | Environment mode | production | No |
To contribute to the agent or build it locally:
- Clone & Install
git clone https://github.com/senzops/server-agent.git
cd agent
npm install-
Configure Environment
Create a.envfile in the root:API_ENDPOINT=https://api.senzor.dev/api/ingest/stats SERVER_ID=test-server-id API_KEY=test-api-key INTERVAL=5
-
Run Locally (Dev Mode)
npm run dev -
Test
npm test -
Build Docker Image
docker build -t senzor-agent .
- Read-Only Access: The container mounts the host filesystem as Read-Only (:ro). It cannot modify your system files.
- Privilege Isolation: The agent does not require sudo privileges to run, only docker group access.
- Outbound Only: The agent initiates all connections. No listening ports are exposed to the internet.
Logs:
View the agent logs to see connection status:
docker logs -f senzor"Connection Refused":
Ensure your API_ENDPOINT is reachable from the server. If testing locally with Docker, use http://host.docker.internal:3000 instead of localhost.