# Luftbude VM Monitoring (Standalone)

This directory contains configuration and service definitions for the standalone monitoring exporters running on the Luftbude VM.

## Binaries (Exporters)

The binaries for the exporters are **not** committed to the repository because they exceed the GitHub file size limits.

### Download and Installation

To download the latest compatible binaries on the target system (or locally for testing), use the provided download script:

```bash
# On the Luftbude VM
cd /var/www/we8upmb/htdocs/scripts/monitoring  # or appropriate dir
./download-exporters.sh
```

The script will download:
- Grafana Alloy
- Node Exporter
- PHP-FPM Exporter
- Process Exporter
- Promtail
- SQL Exporter

Binaries are placed in the `export-bins/` directory.

### Directory Structure

The systemd services expect the following structure (relative to `/var/www/we8upmb/htdocs/scripts/`):

- `node_exporter/`
  - `node_exporter`
  - `php-fpm_exporter`
  - `process-exporter`
  - `promtail`
  - `sql_exporter/bin/sql_exporter`
- `export_bins/` (Legacy/Alloy)
  - `alloy`
  - `config.alloy`

> [!NOTE]
> The inconsistent naming (`node_exporter` as a base dir for multiple tools) is a legacy requirement for the current Luftbude VM environment.

## Service Management

The systemd service files are located in `./systemd/`. To install or update them:

1. Copy files to `~/.config/systemd/user/` (if running as user) or `/etc/systemd/system/`.
2. Reload systemd: `systemctl --user daemon-reload`
3. Restart services: `systemctl --user restart alloy node_exporter ...`

## Maintenance

To update versions, modify the variables in `download-exporters.sh`.
