A lightweight SNMP AgentX implementation for monitoring BIRD routing daemon through SNMP. This agent provides real-time monitoring of BGP peers and their states using the standard BGP4-MIB.
- 🚀 Real-time BGP peer monitoring
- 📊 SNMP AgentX protocol support
- 🔄 Automatic data refresh
- 🛠️ IPv4 BGP peer support
- 📈 Standard BGP4-MIB compliance
| OID | Description |
|---|---|
| bgpLocalAs | Local Autonomous System number |
| bgpPeerState | Current state of BGP peer |
| bgpPeerRemoteAddr | Remote peer IP address |
| bgpPeerFsmEstablishedTime | Time since BGP session establishment |
| bgpIdentifier | BGP router identifier |
- BIRD2 configured with BGP peers
- net-snmpd installed and configured
- Install net-snmpd:
opkg install snmpd snmp-mibs- Configure net-snmpd:
cat > /opt/etc/snmp/snmpd.conf <<EOF
rocommunity public
master agentx
EOF- Start snmpd:
/opt/etc/init.d/S47snmpd start- Install bird2snmp:
wget -O /opt/usr/bin/bird2snmp https://github.com/subuk/bird2snmp/releases/download/v0.1.0/bird2snmp.linux.mipsle
chmod +x /opt/usr/bin/bird2snmp- Create init script:
cat > /opt/etc/init.d/S81bird2snmp <<EOF
#!/bin/sh
ENABLED=yes
PROCS=bird2snmp
ARGS="--bird-sock=/opt/var/run/bird.ctl"
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export TZ=/opt/etc/localtime
. /opt/etc/init.d/rc.func
EOF
chmod +x /opt/etc/init.d/S81bird2snmp
/opt/etc/init.d/S81bird2snmp startTest the installation with snmpwalk:
snmpwalk -m ALL -c public -v2c myhost.example.com bgpExpected output:
BGP4-MIB::bgpVersion = STRING: "4"
BGP4-MIB::bgpLocalAs.0 = INTEGER: 64842
BGP4-MIB::bgpPeerState.169.254.153.78 = INTEGER: established(6)
...
make release-binariesmake| Option | Description | Default |
|---|---|---|
-s, --bird-sock |
BIRD socket path | /run/bird/bird.ctl |
-r, --bird-refresh-interval |
Data refresh interval | 3s |
-x, --snmp-master-sock |
SNMP master socket path | /var/agentx/master |
-p, --snmp-priority |
SNMP registration priority | 127 |
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.