Skip to content

Commit 172fa79

Browse files
committed
Recipes Doc: Enhance server hooks documentation to include server_add notifications
1 parent 860392d commit 172fa79

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

docs/recipes.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Notify your team when any server disconnects from the xyOps network. This uses a
136136

137137
### How It Works
138138

139-
Add a `server_remove` hook into the [hooks](config.md#hooks) section in your `config.json`. This activity fires when a server disconnects from the network. See [Activity.action](data.md#activity-action) for the full list of hookable activity action IDs.
139+
Add a `server_remove` hook into the [hooks](config.md#hooks) section in your `config.json`. This activity fires when a server disconnects from the network. See [Activity.action](data.md#activity-action) for the full list of activity action IDs that can trigger System Hooks.
140140

141141
Simple web hook example:
142142

@@ -168,9 +168,23 @@ You can also use a configured xyOps web hook ID if you want custom headers, requ
168168
}
169169
```
170170

171+
To notify when a server comes back online, or when a new server is added to the network, add a `server_add` hook as well:
172+
173+
```json
174+
"hooks": {
175+
"server_remove": {
176+
"email": "oncall-pager@mycompany.com"
177+
},
178+
"server_add": {
179+
"email": "oncall-pager@mycompany.com"
180+
}
181+
}
182+
```
183+
171184
### Notes
172185

173186
- The `server_remove` activity fires whenever a server disconnects, including planned upgrades, service restarts, network maintenance, and other expected outages. It does not always mean the server crashed.
187+
- The `server_add` activity fires whenever a server connects to the network. This means a previously offline server returned, or a brand new server was added.
174188

175189
## Daylight Savings Time
176190

0 commit comments

Comments
 (0)