Integrations
Prometheus
KLYRN VM serves metrics at /api/v1/metrics. Create an API token for an administrator with the Read everything scope and add this to Prometheus.
scrape_configs:
- job_name: klyrn-vm
scheme: https
metrics_path: /api/v1/metrics
authorization:
type: Bearer
credentials_file: /etc/prometheus/klyrn-vm.token
static_configs:
- targets: ['panel.example.com:8443']
| Metric | Meaning |
|---|---|
klyrn_vms | Machines by state |
klyrn_node_up | 1 when a host is online |
klyrn_node_memory_used_bytes | Memory in use on a host |
klyrn_node_storage_used_bytes | Storage in use on a host |
klyrn_ipv4_free | Free IPv4 addresses |
klyrn_tasks_failed_24h | Tasks that failed in the last day |
klyrn_alerts_open | Open alerts by severity |
Two alerts to start with:
- alert: KlyrnNodeDown
expr: klyrn_node_up == 0
for: 5m
- alert: KlyrnIPv4Low
expr: klyrn_ipv4_free / klyrn_ipv4_total < 0.1
for: 30m
Webhooks
In the panel, open Settings, then Integrations, and choose Add webhook. KLYRN VM sends each event as JSON to the address you give.
{"event":"vm.create","result":"ok","target":"vm:41","actor":"admin@example.com"}
- Filter. Send every event with
*, one kind withvm.create, or a group withvm.*. - Slack and Discord. Choose either one and paste its webhook address. Events arrive as readable messages.
- Signature. Each request has an
X-Klyrn-Signatureheader. It is an HMAC-SHA256 of the timestamp, a dot and the body, made with the secret shown when you create the webhook. - Retries. A failed delivery is retried twice. A webhook that fails 20 times in a row is switched off.
Check the signature in Node:
const [t, v1] = sig.split(',').map((p) => p.split('=')[1])
const ok = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex') === v1
Reverse DNS with PowerDNS
In Settings, then Integrations, enter your PowerDNS API address, API key and server id. Press Test connection to check it.
Customers can then set reverse DNS for their own addresses on a machine's Networking tab. KLYRN VM writes the record to the right reverse zone. You create the zones in PowerDNS.
WHMCS
A WHMCS module is in testing and is not released yet. See the WHMCS page. Any billing system can use the billing API today.
API
Everything the panel does is available through the API. See the API reference.