BIRD Plugin
This plugin monitors the state of BGP sessions on a server that runs the BIRD Internet Routing Daemon. It counts how many sessions are up, how many are trying to connect, and how many have recently failed, so you can alert when a peer goes down.
Reported Metrics
The plugin runs birdc show proto and counts the protocols whose line contains each of the following states or messages:
| Metric | Description |
|---|---|
established | Number of BGP sessions in the Established state, which are up and exchanging routes. |
connect | Number of lines containing Connect, which are sessions in the Connect state. |
active | Number of sessions in the Active state, which are trying to open a connection to the peer. |
conn_reset_bp | Number of sessions whose last error is Connection reset by peer. |
hold_timer | Number of sessions whose last error is Hold timer expired. |
All values are the current number of sessions, not totals over time.
The counts are simple text matches on the birdc show proto output, so they can overlap:
connectalso counts any line that contains the wordConnection, such asConnection reset by peerorSocket: Connection refused. A session with such a message is therefore counted inconnectas well as inconn_reset_bporactive.- Lines for protocols that aren't BGP are counted if they contain one of these words.
Use established as your main health value, and the others to see why a session is not up.
Requirements
- BIRD is installed and running, with at least one BGP protocol configured.
birdcis installed, usually at/usr/sbin/birdc. Check withwhich birdc.- The plugin uses
birdc. On BIRD 1.x, IPv6 sessions are handled by a separatebirdc6command, which the plugin does not query. BIRD 2.x handles IPv4 and IPv6 withbirdc.
Allow the agent to run birdc
birdcThe plugin runs birdc through sudo. The agent can't type a password, so it needs a sudoers rule. Create /etc/sudoers.d/agent360-bird (mode 0440) with the one command the plugin runs:
agent360 ALL=(root) NOPASSWD: /usr/sbin/birdc show proto
If which birdc shows a different path, use that path. Then check the file:
visudo -cf /etc/sudoers.d/agent360-birdDon't allow
birdcwith any arguments. A rule likeagent360 ALL=(ALL) NOPASSWD: /usr/sbin/birdclets the agent user disable protocols, shut down BGP sessions, change the routing configuration and stop BIRD. Listing the exactshow protocommand lets the agent only read the session states.
Configure the plugin
Add the following lines to the /etc/agent360-custom.ini file:
[bird]
enabled = yesThere are no other options.
Test the plugin
Run the following command:
sudo -u agent360 agent360 test birdThe output should show the five values. Compare them with the output of sudo birdc show proto. Then restart the agent for the change to take effect:
service agent360 restartTroubleshooting
- All values are
0although sessions exist. The plugin can't tell a failedbirdccall from no matching sessions, so a missing sudoers rule or a stopped BIRD also shows0. Run the command as the agent user:sudo -u agent360 sudo /usr/sbin/birdc show proto- If it asks for a password or says it's not allowed, fix the sudoers rule. The command has to match exactly.
- If it says it can't connect to the BIRD control socket, make sure BIRD is running.
- If the command isn't found, check the path with
which birdc.
connectis higher than expected. It counts every line containingConnect, includingConnection ...error messages. See the note under Reported Metrics.- IPv6 sessions are missing on BIRD 1.x. They are only visible through
birdc6, which the plugin doesn't use. - No data in the dashboard. Make sure the
[bird]section is in/etc/agent360-custom.ini,enabled = yes, and that you restarted the agent.
Updated about 16 hours ago