Use `:net_kernel.monitor_nodes/1` to subscribe the calling process to remote-node connection changes. Notifications expose `{:nodeup, node}` and `{:nodedown, node}` messages, making partitions and disconnected peers observable. section 12.2.5
Choose the subscription mode deliberately:
- `true` adds a subscription; `false` installs a single subscriber and replaces earlier subscriptions on the node. section 12.2.5
- Use `Node.monitor/2` instead when monitoring one particular node rather than all node connections. section 12.2.5
- Treat disconnection notifications as operational signals: disconnected nodes are not automatically reconnected. section 12.1.1
$ iex --sname node1@localhost iex(node1@localhost)1> :net_kernel.monitor_nodes(true)
Start a distributed shell, subscribe with `:net_kernel.monitor_nodes(true)`, then observe node-up and node-down messages as peers connect or stop. section 12.2.5
