In-App Notifications
Each severity has a switch:
Turning a severity off stops the host creating that kind of notification at all. It no longer appears in the notification center, lights a tab indicator, alerts you, or runs a hook.
Notification Hooks
A hook runs when the host creates a notification of a severity you choose. Use it to forward notifications to a chat tool, a phone, or your own script. The toolbar shows the number of hooks, the path of the hooks file with a copy button, Refresh, and Add hook.Add A Hook
1
Open the editor
Click Add hook.
2
Name it and pick an action
Enter a Name, then choose an Action: Run a script or POST to a URL.
3
Fill in the action
For a script, enter the Executable and its Arguments. For a URL, enter the URL and any Headers. See the sections below.
4
Choose severities
Under Severities, turn on Needs action, Failure and Done as needed. At least one is required.
5
Enable and save
Turn on Enabled, which starts off for a new hook, then click Save hook.
HTTP 200, exit 0 or timed out. It reads “No test yet” until the hook has run, and it resets when the host restarts.
Run A Script
The host runs the executable on the host machine, passing each line of Arguments as one argument. No shell is involved, so shell syntax such as pipes, redirects, variables or~ isn’t expanded.
- The event JSON arrives on the script’s standard input.
- The script runs with the host’s shell environment.
- Exit code
0counts as success. Any other exit code is a failure, and the last result shows the start of the script’s error output. - A script that runs longer than 10 seconds is stopped and recorded as timed out. Scripts are not retried.
POST To A URL
The host sends the event JSON as the body of aPOST request with content-type: application/json.
- The URL must be an absolute
httporhttpsURL. Put credentials in a header, not in the URL; a URL with a user name or password is refused. - Enter headers one
name: valueper line. - In header values,
$VARand${VAR}are read from the host’s shell environment when the request is sent. The value is never stored in the hooks file or shown in the app. If a referenced variable isn’t set, nothing is sent and the hook fails with “env var NAME is not set”. - A request times out after 5 seconds.
- A timeout, a network error, a
429, or a5xxresponse is retried twice, after 1 second and then 5 seconds. Other error responses are not retried. Retries are not kept across a host restart.
Event Payload
Scripts and URLs receive the same JSON:event is one of:
A test event has
"test": true, "event": "agent.stopped", "severity": "info", the title “Test notification”, the message “Sent from Traycer”, and null Task and agent IDs.
The Hooks File
Hooks live innotification-hooks.json in the host’s data folder. For the standard install that is:
Unknown fields are not allowed.
Saving from Settings rewrites the whole file from the hooks the page last loaded. If you edit the file by hand while Settings is open, click Refresh before changing hooks there, or your hand edits are replaced.