Spooky season is here. Happy Halloween from Lattice!
Lattice
Docs/PteroAlerts

PteroAlerts

Know the moment a server is in trouble.

No reviews yet

Requirements

Panel Pterodactyl 1.x (tested on 1.15)
OS Ubuntu or Debian
Web server nginx or Caddy (Apache: manual setup)
Access root
License A Lattice license key with Ptero Alerts

Node.js is installed for you if it is missing.

Install

unzip ptero-alerts-*.zip
cd ptero-alerts-*/
sudo bash install.sh --license LAT-XXXXX-XXXXX-XXXXX-XXXXX --api-key ptlc_XXXXXXXX

Reload the panel. You will see a bell in the top bar.

Option Use
--license KEY Your Lattice license key
--api-key KEY Host API key, see below. Optional
--panel PATH Panel folder if not /var/www/pterodactyl
--panel-url URL Panel URL if it cannot be read from .env
--port PORT Local port for the service (default 47812)
--skip-proxy Do not touch the web server config

API keys

Alerts run all the time, so the service needs a client API key to reach servers.

Key Who sets it Covers
Host key The panel owner, with --api-key or ptero-alerts apikey set Every server. Only root admins can put alerts on these
Personal key Any user, in the bell > API key tab The servers that user can reach

Create a key under Account > API Credentials. Leave the allowed IPs empty. For the host key, use a root admin account. A personal key must belong to the user who saves it.

Command

ptero-alerts is installed with the addon. Run it as root.

Command Does
ptero-alerts status Version, service, license, host key and watched servers
ptero-alerts license set KEY Set your license key and restart
ptero-alerts license refresh Check your license with Lattice now
ptero-alerts apikey set KEY Set the host API key and restart
ptero-alerts apikey clear Remove the host API key and restart
ptero-alerts restart Restart the service
ptero-alerts logs Recent logs (logs follow to follow)
ptero-alerts patch Re-apply the panel patch after a panel update

Update

Unzip the new version and run its installer. Settings, keys, rules and history are kept.

unzip ptero-alerts-LATEST.zip
cd ptero-alerts-LATEST/
sudo bash install.sh

Uninstall

Command Removes
sudo bash uninstall.sh --keep-data Everything except your rules and config
sudo bash uninstall.sh --purge Everything

Using it

  1. Bell > API key: save a key, unless you are a root admin and the host key is set.
  2. Bell > Destinations: add a Discord webhook or another webhook. Press Test.
  3. Bell > Rules: pick what to watch, which servers, and where to send it.
Alert Fires when
CPU usage CPU is above the threshold, in percent of the server's CPU limit
Memory usage Memory is above the threshold, in percent of the server's limit
Disk usage Disk is above the threshold, in percent of the server's limit
Server offline The server stopped after it was seen running
Server crashed Wings reports a crash. Includes exit code and out-of-memory
Node unreachable The connection to the server's node is lost

Each alert sends one message when it starts and one when it clears. For at least waits before alerting, so short spikes and restarts stay quiet. Cooldown stops a flapping server from sending again and again. Other webhooks get a JSON POST with event, rule, message, server and at.

Settings

File: /etc/ptero-alerts/config.json. Run ptero-alerts restart after changes.

Key Meaning
licenseKey Your Lattice license key
apiKey Host API key (optional)
panelUrl Public panel URL
panelUpstream How the service reaches the panel locally
port Local service port
logLevel info or debug

Troubleshooting

Problem Fix
No bell Hard refresh, then run ptero-alerts status
"Ptero Alerts is not active" Run ptero-alerts license. Set the key with ptero-alerts license set KEY
Servers show 0 connected The panel machine must reach your nodes on their Wings port
"this API key belongs to another account" Create the key while logged in as yourself
Bell gone after a panel update Run ptero-alerts patch
Anything else ptero-alerts logs

Support

Open a ticket on Lattice: https://license.atlantisservices.net/support