> ## Documentation Index
> Fetch the complete documentation index at: https://strettch-make-section-id-optional.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SC Metrics Agent

> Install the SC Metrics Agent to collect CPU, memory, disk, and network metrics from your compute instances and view usage graphs in the dashboard.

The SC Metrics Agent is a lightweight, open-source utility that collects system-level metrics from your computes and forwards them to Strettch Cloud. It enables monitoring features including usage graphs, resource tracking, and performance analytics.

**Supported Systems:** Ubuntu 20.04+, Debian 8+

View the [source code on GitHub](https://github.com/strettch/sc-metrics-agent)

## Automatic Installation

The SC Metrics Agent installs automatically when you create a new compute instance. No action needed—just wait a few minutes after creation, then view your metrics from the dashboard's Graphs tab.

## Manual Installation

Need to install the agent on an existing instance? Here's how:

### Quick Install (Recommended)

Run this single command to install the agent:

<CodeGroup>
  ```bash Install the agent theme={null}
  curl -sSL https://repo.cloud.strettch.com/metrics/install.sh | sudo bash
  ```
</CodeGroup>

The script will automatically detect your OS, set up repositories, and install the agent:

```
--- Installing sc-metrics-agent for noble ---
-> Cleaning up old repository configurations...
   -> Updating package lists
   -> Installing prerequisites
   -> Downloading GPG key
   -> Adding repository
   -> Updating package index
   -> Installing sc-metrics-agent
...
Setting up sc-metrics-agent (3.17.1) ...
Configuring SC-Metrics-Agent...
ℹ️  Creating required directories...
ℹ️  Configuring metrics collection...
✅ Metrics agent configured successfully
ℹ️  Enabling sc-metrics-agent.service...
✅ sc-metrics-agent.service enabled
ℹ️  Starting services...
✅ sc-metrics-agent.service started successfully

╔═════════════════════════════════════════╗
║ SC-Metrics-Agent Installation Complete  ║
╚═════════════════════════════════════════╝

Service Status:
  • Main Service: active
  • Auto-Update:  active

✅ sc-metrics-agent installed successfully!
```

### Review Before Installing

Prefer to inspect the script first? Download and review it:

<CodeGroup>
  ```bash Review the install script theme={null}
  curl -sSL https://repo.cloud.strettch.com/metrics/install.sh
  ```
</CodeGroup>

### Verify Installation

Check that the agent is running:

<CodeGroup>
  ```bash Check agent status theme={null}
  systemctl status sc-metrics-agent
  ```
</CodeGroup>

You should see `Active: active (running)`:

```
● sc-metrics-agent.service - Strettch Cloud Metrics Agent
     Loaded: loaded (/etc/systemd/system/sc-metrics-agent.service; enabled; preset: enabled)
     Active: active (running) since Tue 2025-10-14 10:15:30 UTC; 45s ago
       Docs: https://docs.cloud.strettch.com/agents/sc-metrics-agent
   Main PID: 578620 (sc-metrics-agen)
      Tasks: 6 (limit: 9435)
     Memory: 2.1M (peak: 2.5M)
        CPU: 38ms
     CGroup: /system.slice/sc-metrics-agent.service
             └─578620 /usr/bin/sc-metrics-agent
```

View your metrics from the dashboard's Graphs tab within a few minutes.

To check the installed agent version:

<CodeGroup>
  ```bash Check version theme={null}
  dpkg -l | grep sc-metrics-agent
  ```
</CodeGroup>

## Managing the Agent

### Basic Commands

<CodeGroup>
  ```bash Start the agent theme={null}
  sudo systemctl start sc-metrics-agent
  ```

  ```bash Stop the agent theme={null}
  sudo systemctl stop sc-metrics-agent
  ```

  ```bash Restart the agent theme={null}
  sudo systemctl restart sc-metrics-agent
  ```

  ```bash Check status theme={null}
  systemctl status sc-metrics-agent
  ```
</CodeGroup>

### Auto-Start on Boot

<CodeGroup>
  ```bash Enable auto-start theme={null}
  sudo systemctl enable sc-metrics-agent
  ```

  ```bash Disable auto-start theme={null}
  sudo systemctl disable sc-metrics-agent
  ```
</CodeGroup>

## Viewing Logs

<CodeGroup>
  ```bash Live logs theme={null}
  sudo journalctl -u sc-metrics-agent -f
  ```

  ```bash Last hour theme={null}
  sudo journalctl -u sc-metrics-agent --since=1h
  ```

  ```bash Last 100 lines theme={null}
  sudo journalctl -u sc-metrics-agent -n 100
  ```
</CodeGroup>

## Updates

The agent updates automatically. You can also trigger updates manually:

<CodeGroup>
  ```bash Check for and install updates theme={null}
  sudo systemctl start sc-metrics-agent-updater
  ```

  ```bash View update logs theme={null}
  sudo journalctl -u sc-metrics-agent-updater -f
  ```
</CodeGroup>

## Uninstalling

To completely remove the agent:

<CodeGroup>
  ```bash Uninstall the agent theme={null}
  sudo apt-get purge sc-metrics-agent
  ```
</CodeGroup>

The uninstall process will stop all services and remove the agent:

```
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
  sc-metrics-agent*
After this operation, 6,823 kB disk space will be freed.
Do you want to continue? [Y/n] Y
...
Removing sc-metrics-agent (3.17.1) ...
Removing SC-Metrics-Agent (keeping configuration)...
Stopping sc-metrics-agent-update-scheduler.timer...
Stopping sc-metrics-agent.service...
Disabling sc-metrics-agent-update-scheduler.timer...
Disabling sc-metrics-agent.service...
SC-Metrics-Agent removed (configuration preserved in /etc/sc-metrics-agent)
Purging configuration files for sc-metrics-agent (3.17.1) ...
```

**Note:** After uninstalling, metrics collection and usage graphs will be unavailable.

## Troubleshooting

### Metrics Not Showing?

1. Verify the agent is running:
   <CodeGroup>
     ```bash theme={null}
     systemctl status sc-metrics-agent
     ```
   </CodeGroup>

2. Check recent logs:
   <CodeGroup>
     ```bash theme={null}
     sudo journalctl -u sc-metrics-agent -n 50
     ```
   </CodeGroup>

3. Restart the service:
   <CodeGroup>
     ```bash theme={null}
     sudo systemctl restart sc-metrics-agent
     ```
   </CodeGroup>

4. Wait a few minutes for metrics to appear in the dashboard

### Need Help?

Contact support at [cloud@strettch.com](mailto:cloud@strettch.com) with:

* Output from `systemctl status sc-metrics-agent`
* Recent logs: `journalctl -u sc-metrics-agent -n 100`
* Your compute instance ID
* Description of the issue

## Security

The agent uses encrypted communication to securely transmit metrics data to Strettch Cloud. It runs with minimal privileges and updates automatically for security patches.
