Server Chief webhooks
Server Chief sends a webhook when a server goes offline or comes back, a metric alert fires or resolves, metrics stop arriving, storage degrades, a batch of updates or reboots starts, pauses, or finishes, an agent update starts, succeeds, or fails, or a server is added, changed, or removed. Use them to page your on-call engineer, open a ticket, or keep an inventory in another system current without polling the API.
Deliveries are signed, retried, and logged the same way in every Chief Tools product. Read Receive webhooks first for verification, responses, retries, and duplicates. This page covers what is specific to Server Chief.
Set up an endpoint
Add endpoints under Settings › Webhooks in Server Chief, then send a test event from the endpoint's page. Deliveries come with the User-Agent ServerChief-Webhooks/1.0.
To set up endpoints from code, use the webhooks API with a token that has the serverchief:webhooks:write scope:
Code
The response includes the endpoint's secret. Store it right away: it is only returned when the endpoint is created and when you rotate its secret. Then send a test event to check your receiver. The same API lists event types, events, and deliveries with each attempt's request and response, and resends them.
Events go to the endpoints of the team that owns the server. Teams that see a server because it was shared with them get no events for it.
Events
Each event's data.object is a Server, an Alert, a Batch, or an AgentRelease, as the API returns it when the event happens. Some events add fields next to object in data.
Each event type below links to its page in the API reference, with the request headers and every field of the payload. The OpenAPI document also lists the events under webhooks, so you can generate types for your receiver from it.
Servers
| Type | Sent when |
|---|---|
server.created | A server is added. It waits for its agent, with status set to pending. A server added by an install command that creates servers gets this event and server.enrolled together. |
server.enrolled | A server's agent enrolls for the first time. Reinstalling the agent on the same server does not send it again. |
server.updated | A server's name, hostname, metadata, location, settings, or tags change. |
server.deleted | A server is removed. object is the server as it was right before. |
Availability
| Type | Sent when | Extra data fields |
|---|---|---|
server.offline | An active server has not checked in for 15 minutes. | |
server.online | An offline server checks in again. | offline_since: when it went offline |
server.reboot_stalled | A server has not checked in for 6 minutes after it started a reboot. The server counts as offline, and server.online follows once it is back. | command_id: the reboot command |
A server whose reboot stalls gets server.reboot_stalled instead of server.offline.
Metric alerts
| Type | Sent when | Extra data fields |
|---|---|---|
alert.fired | A metric alert rule fires for a server. | |
alert.resolved | A firing alert closes. | reason: why it closed |
metrics.stalled | An online server that collects metrics has delivered none for about 25 minutes. | stalled_at: when the stall was first noticed |
metrics.resumed | Metrics from that server arrive again. | stalled_at |
reason on alert.resolved is one of:
recovered: the metric stayed within the rule for two checks in a row.out_of_scope: the rule no longer covers the server, or the server stopped collecting metrics.rule_changed,rule_disabled, orrule_deleted: someone changed, turned off, or deleted the rule.
Only recovered means the problem went away. Handle unknown reasons like a closed alert.
When many servers stop delivering metrics at the same moment, the cause is on our side, and Server Chief sends no metrics.stalled events for them.
Storage health
| Type | Sent when | Extra data fields |
|---|---|---|
server.storage_unhealthy | A RAID array or ZFS pool degrades, or a disk fails, or storage that was unhealthy gets worse. | health, problems, unhealthy_since |
server.storage_healthy | The server's storage is healthy again. | unhealthy_since |
health is degraded or failed. problems lists what is wrong, each with its own health, a subject such as an array or disk name, and a description you can show to a person. Storage that improves but stays unhealthy sends no event.
Updates and reboots
| Type | Sent when | Extra data fields |
|---|---|---|
batch.started | A batch starts installing updates on or rebooting several servers, from Server Chief or a maintenance schedule. | |
batch.paused | A batch paused because too many of its servers failed. Running servers finish, the others wait until someone resumes it. | failed: the servers that failed |
batch.completed | Every server of a batch finished, failed, or did not start in time. | failed |
batch.cancelled | Someone cancelled a batch. Servers that did not start yet are left alone, running ones finish. |
object is the Batch. Its action is upgrade_packages or reboot, and schedule names the maintenance schedule that started it. failed lists each server that failed or did not start within the batch's window, with server_id, server_name, and a detail you can show to a person. Servers the batch left out from the start are in the batch's skipped.
A run of a maintenance schedule that no server could take sends batch.started and batch.completed together. Resuming a paused batch sends no event.
Agent updates
| Type | Sent when | Extra data fields |
|---|---|---|
server.agent_update_started | Someone updates a server's agent in Server Chief or through the API, or the automatic rollout does. | command_id: the update command |
server.agent_update_succeeded | The agent reports the version it was updated to. | command_id |
server.agent_update_failed | The agent reports that the update failed, does not pick up the update within 3 hours, or reports no result within 3 hours after it picked it up. Also sent when the server is deleted during an update, before server.deleted. | command_id, result: why it failed |
agent_rollout.paused | The automatic rollout of a release paused for your team because too many updates to it failed. | failures: the failed updates since the rollout was last resumed |
The update events carry the server. Asking for an update while one to the same release is already queued or running sends no second server.agent_update_started.
result on server.agent_update_failed is one of:
install_failed: the package could not be installed, the previous version still runs. An update that reported no result in time counts as this too.readiness_failed_rolled_back: the new version did not start, and the previous version was restored.rollback_failed: the new version did not start, and restoring the previous version failed too. The agent may not be running.target_unavailableorrollback_unavailable: the package repository does not offer the new version, or the installed version that a rollback needs.package_manager_busy: another process held the package manager for an hour.unsupported_install: the agent was not installed from the Server Chief package repository, so it cannot update itself.expired: the agent did not pick up the update within 3 hours, for example because the server went offline.cancelled: the server was deleted before the update finished.
result is null when the agent reported no reason. Handle unknown results like a failed update.
An agent that reports the new version after its update failed, because its result was lost, sends server.agent_update_succeeded too, so a failure is not always final. Every server.agent_update_started is followed by server.agent_update_failed or server.agent_update_succeeded.
Only install_failed, readiness_failed_rolled_back, and rollback_failed count towards pausing a rollout, so an offline server whose update expired, or a server deleted during its update, cannot pause it for your team. The automatic rollout tries a server again 6 hours after target_unavailable, rollback_unavailable, or package_manager_busy. After unsupported_install, the server cannot be updated until its agent reports that it can update itself.
For agent_rollout.paused, object is the AgentRelease whose rollout paused. Servers that already updated keep the new version. The rollout stays paused until someone resumes it in the team settings, which sends no event.
Examples
A server went offline
Code
The full object has every field of the Server schema. enrollment is always null in webhooks, so enrollment tokens never leave Server Chief this way.
An alert resolved
Code
The alert's own closed_reason field is a sentence for people. Branch on data.reason instead.
Common integrations
- Paging. Subscribe to
server.offline,server.reboot_stalled,alert.fired, andserver.storage_unhealthy. Close the page onserver.online,alert.resolvedwithreasonset torecovered, andserver.storage_healthy. - Inventory sync. Subscribe to
server.created,server.updated, andserver.deleted, and store the server fromdata.object. Use List servers once to load existing servers, and again to catch up after your receiver was down for longer than the retries last.
Events are kept for 30 days. For anything older, read the current state from the API.