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:

MetricDescription
establishedNumber of BGP sessions in the Established state, which are up and exchanging routes.
connectNumber of lines containing Connect, which are sessions in the Connect state.
activeNumber of sessions in the Active state, which are trying to open a connection to the peer.
conn_reset_bpNumber of sessions whose last error is Connection reset by peer.
hold_timerNumber 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:

  • connect also counts any line that contains the word Connection, such as Connection reset by peer or Socket: Connection refused. A session with such a message is therefore counted in connect as well as in conn_reset_bp or active.
  • 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.
  • birdc is installed, usually at /usr/sbin/birdc. Check with which birdc.
  • The plugin uses birdc. On BIRD 1.x, IPv6 sessions are handled by a separate birdc6 command, which the plugin does not query. BIRD 2.x handles IPv4 and IPv6 with birdc.

Allow the agent to run birdc

The 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-bird

Don't allow birdc with any arguments. A rule like agent360 ALL=(ALL) NOPASSWD: /usr/sbin/birdc lets the agent user disable protocols, shut down BGP sessions, change the routing configuration and stop BIRD. Listing the exact show proto command lets the agent only read the session states.

Configure the plugin

Add the following lines to the /etc/agent360-custom.ini file:

[bird]
enabled = yes

There are no other options.

Test the plugin

Run the following command:

sudo -u agent360 agent360 test bird

The 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 restart

Troubleshooting

  • All values are 0 although sessions exist. The plugin can't tell a failed birdc call from no matching sessions, so a missing sudoers rule or a stopped BIRD also shows 0. 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.
  • connect is higher than expected. It counts every line containing Connect, including Connection ... 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.

Did this page help you?