Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pixlcore/xyops/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Alerts evaluate live server data and trigger actions when conditions are met. In xyOps, an alert is defined once (the “definition”) and may fire many times across servers (each firing is an “invocation”).Alerts are evaluated every minute on the conductor using the most recent ServerMonitorData collected from each server.
- Detect system conditions (high CPU, low memory, disk full, job spikes)
- Notify teams via email, webhooks, or channels
- Attach context via snapshots
- Open tickets automatically
- Run jobs in response to conditions
- Limit or abort jobs on affected servers
Concepts
The configuration that specifies the trigger condition and actions
A single firing instance against a server. Stored in the database and visible in the Alerts view.
Once per minute per server, alongside monitor sampling
By server group. Leave blank to apply to all groups.
Optionally require N consecutive true evaluations before firing, and N consecutive false evaluations before clearing
Execute on alert fired and/or cleared. Can be defined on the alert, augmented by groups, and extended with universal defaults.
Optionally prevent new jobs from launching while active, or abort all running jobs when the alert fires
How Alerts Are Evaluated
Per incoming minute of server data:Evaluate Expression
The alert’s expression (JavaScript format) runs against the current ServerMonitorData snapshot
Sample Counter
If true, the alert’s internal sample counter increments. If false and previously incremented, the counter decrements toward zero.
Code Implementation
Alert evaluation from/workspace/source/lib/monitor.js:292-354:
monitor.js:292-354
Expressions compile ahead of time; syntax errors are rejected at create/update time. The alert message is re-evaluated each minute while active, so macros reflect current server values.
Alert Expressions
An alert expression is evaluated using xyOps Expression Format (JavaScript-style) with the current ServerMonitorData as context.Common Entry Points
cpu- CPU stats and hardware informationmemory- Total/available memoryload- 1/5/15 minute load averagesmonitors- Values from configured monitors (absolute values)deltas- Computed deltas for counter-style monitors since last samplejobs- Running job count for the server
Examples
Helper Functions
Available in expressions and message macros:min(a, b),max(a, b)- Math functionsinteger(x),float(x)- Type conversionbytes(x)- Render human-readable bytesnumber(x)- Render localized numberspct(x)- Render a percentagestringify(obj)- JSON stringify a valuefind(array, key, substr)- Filter array items
Alert Messages
The alert message is a string with{{ ... }} macros evaluated against the same ServerMonitorData context used for expressions.
Additional Variables in Actions
def- The alert definition object (def.title,def.notes, etc.)alert- The alert invocation object (alert.id,alert.message, etc.)nice_*- Friendly strings for host, IP, CPU, OS, memory, uptime, groups, noteslinks-server_urlandalert_urldirect links
Creating and Editing Alerts
Click on “Alert Setup” in the sidebar:Display name for the alert
Enable/disable notifications and actions
Optional Material Design Icon for the alert
One or more groups where the alert applies (blank for all groups)
Trigger condition evaluated each minute. Use the Server Data Explorer to discover paths.
Text with
{{macros}} for dynamic context. Evaluated on fire and each minute while active.Consecutive minutes that must evaluate true to fire; also used as cool-down to clear
Optional monitor to overlay alert annotations on charts
While active, prevent new jobs from starting on the server
When fired, abort all running jobs on the server
Optional actions to run on
alert_new and/or alert_clearedOptional text included in emails and other notifications
Use the “Test…” button to evaluate the current Expression and Message against a selected live server. The dialog shows whether it would trigger right now and previews the computed message.
Actions on Fire and Clear
When an alert fires (alert_new) and when it clears (alert_cleared), xyOps executes actions in parallel from three sources:
Universal Actions Configuration
config.json:58-65
Supported Action Types
Email
Send to specified users and/or custom addresses
Channel
Channel
Fire a notification channel (a preset bundle like users, web hooks, etc.)
Run Job
Run Job
Start a job by event with optional parameters
Create Ticket
Create Ticket
Open or update a ticket tied to the alert
Web Hook
Web Hook
Fire a preconfigured outbound web hook with templated payload
Plugin
Plugin
Run a custom plugin with arguments
Snapshot
Snapshot
Capture a point-in-time server snapshot (included by default via universal actions)
Job Control During Alerts
While the alert is active on a server, that server is excluded from job scheduling (prevents new jobs from launching). Workflow parent jobs are exempt from this restriction.
When the alert fires, all running jobs on the affected server are aborted immediately.
Code Example: Job Abortion
monitor.js:442-447
Default Alert Examples
| Alert Title | Expression | Message |
|---|---|---|
| High CPU Load | monitors.load_avg >= (cpu.cores + 1) | CPU load average is too high: {{float(monitors.load_avg)}} ({{cpu.cores}} CPU cores) |
| Low Memory | memory.available < (memory.total * 0.05) | Less than 5% of total memory is available ({{bytes(memory.available)}} of {{bytes(memory.total)}}) |
| High I/O Wait | monitors.io_wait >= 75 | Disk I/O wait is too high: {{pct(monitors.io_wait)}} |
| Disk Full | monitors.disk_usage_root >= 90 | Root filesystem is {{pct(monitors.disk_usage_root)}} full. |
| High Active Jobs | monitors.active_jobs >= 50 | Active job count is too high: {{number(monitors.active_jobs)}} |
Best Practices
- Prefer relative thresholds when available (e.g., compare load to
cpu.cores) - Use
bytes()/pct()/number()to produce readable messages in notifications - Overlay alerts on monitors users already watch to provide context
- Use group-level alert actions for standard responses (e.g., page an on-call channel)
- Keep per-alert actions focused on specifics
- Consider limiting jobs for conditions that would degrade runtime reliability (disk full, high I/O wait)
Viewing and Searching Alerts
- Active alerts: Shown in the header counter and the Alerts tab with evaluated message, server context, snapshot link and related jobs/tickets
- Timelines: If
monitor_idis set, alert annotations appear on the corresponding monitor chart - History search: Search for historical alerts on the Alerts page
Related APIs
get_alerts- List all alert definitionsget_alert- Fetch a single definition by IDcreate_alert/update_alert/delete_alert- Manage definitionstest_alert- Compile and evaluate an expression/message against a serversearch_alerts- Query historical and active alert invocations