93 lines
2.1 KiB
Markdown
93 lines
2.1 KiB
Markdown
# Usage Guide
|
|
|
|
## Start TUI
|
|
```bash
|
|
pxmon
|
|
# or
|
|
pxmon tui
|
|
```
|
|
|
|
## Add a cluster
|
|
```bash
|
|
pxmon cluster connect \
|
|
--name eu-1 \
|
|
--host 10.0.0.10 \
|
|
--user root \
|
|
--auth key \
|
|
--key-path ~/.ssh/id_ed25519
|
|
```
|
|
|
|
## Set active cluster
|
|
```bash
|
|
pxmon cluster use eu-1
|
|
```
|
|
|
|
## Connectivity checks
|
|
```bash
|
|
pxmon cluster ping eu-1
|
|
pxmon cluster ping eu-1 --agent
|
|
```
|
|
|
|
## Agent lifecycle
|
|
```bash
|
|
pxmon cluster bootstrap eu-1
|
|
pxmon cluster agent status eu-1
|
|
pxmon cluster agent update eu-1 --restart-bot=true
|
|
pxmon cluster agent versions
|
|
```
|
|
|
|
## Monitoring and history
|
|
```bash
|
|
pxmon cluster stats eu-1 --once
|
|
pxmon cluster usage eu-1 --range 1d
|
|
pxmon cluster traffic eu-1 --range 30d
|
|
pxmon cluster graph eu-1 --range 1d --out ./eu-1-1d.png
|
|
pxmon cluster p95 eu-1 --iface eth0 --range 30d --graph
|
|
```
|
|
|
|
## Alerts
|
|
```bash
|
|
pxmon cluster alert set eu-1 --cpu 85 --ram 90 --disk 90 --net-mbps 300
|
|
pxmon cluster alert-routing set eu-1 --critical-immediate=true --warning-batch-mins 5
|
|
pxmon cluster alert-vm set eu-1 --enabled --warn-on-shutoff --min-running 100
|
|
```
|
|
|
|
## Drift, SLO, capacity
|
|
```bash
|
|
pxmon cluster drift eu-1
|
|
pxmon cluster drift baseline set eu-1
|
|
pxmon cluster slo eu-1 --range 30d
|
|
pxmon cluster capacity forecast eu-1 --range 30d
|
|
```
|
|
|
|
## Backup, runbooks, scheduler
|
|
```bash
|
|
pxmon cluster backup target add --name b2 --type s3 --s3-endpoint s3.example.net --s3-bucket backups --s3-access-key AKIA... --s3-secret-key ...
|
|
pxmon cluster backup plan add --name vm-images --cluster eu-1 --target b2 --path /var/lib/libvirt/images --every 6h
|
|
pxmon cluster backup run vm-images
|
|
|
|
pxmon cluster runbook list
|
|
pxmon cluster runbook run vm-health-check
|
|
|
|
pxmon cluster schedule add --name audit --cmd 'cluster drift eu-1' --every 30m
|
|
pxmon cluster schedule start --interval 30s
|
|
```
|
|
|
|
## Telegram bot
|
|
```bash
|
|
pxmon bot telegram set --token <token> --allow <id> --allow <id>
|
|
pxmon bot telegram show
|
|
pxmon bot telegram restart
|
|
pxmon bot telegram logs --tail 100
|
|
```
|
|
|
|
## Locker and config bundles
|
|
```bash
|
|
pxmon locker set --password 'strong-pass'
|
|
pxmon locker status
|
|
pxmon locker unlock --password 'strong-pass'
|
|
|
|
pxmon config export --out ./pxmon-export.enc
|
|
pxmon config import ./pxmon-export.enc --replace
|
|
```
|