bgp_sessions
List BGP session status including remote address, AS, state, uptime, and prefix count. Handles RouterOS 6 and 7 differences, returning empty for devices without BGP.
Instructions
List BGP session status: remote-address/remote-as, state (established/idle/...), uptime, prefix-count.
RouterOS exposes this under two different paths depending on generation, the same split wireless_registrations already handles for wifi: ROS7's routing package (/routing/bgp/session) or ROS6's (/routing/bgp/peer). This tries ROS7 first, falls back to ROS6, and returns an empty list - rather than raising - for a device that doesn't run BGP at all.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |