Page 1 of 1

CCR1072 BGP Monitoring

Posted: Thu Jan 11, 2018 12:40 am
by carter323
Hi there,

I have two CCR1072s that I have just installed in our Data Centre that peer with various Peering Exchanges and an IP Transit provider here in Brisbane, Australia.

I am doing some basic monitoring of the devices, enough for Netflow and some interface statistics to pass through to CACTI which generates usage reports/billing for our customers. Internally we use LogicMonitor for Network Management which is reasonably powerful and customisable.

I was wondering, has anyone had any luck monitoring things such as:
1. BGP Peer Status
2. Prefixes Received
3. Prefixes Sent

I tried to do a "print oid" and it doesn't look like any are supported for BGP. I am running 6.40.5 of RouterOS.

If SNMP is not an option, if someone can give me any sort of examples they have of Groovy/PHP/XML scripting or anything they do that would be great as I'm not a guru with that stuff.

Cheers
Dan

Re: CCR1072 BGP Monitoring

Posted: Mon Feb 26, 2018 6:01 pm
by derrickh
I devised a "roundabout" way to monitor bgp peer state. I created a script that checks for all bgp peers and creates a "dummy" bridge interface for each. Then it will enable or disable the bridge state depending on the bgp peer state. You can then setup monitoring of the "bridge" interface which in essence reflects the state of the BGP peer.
You can decide how frequently you would want to run the script. You can also remove the ":log" lines - I added it while creating for debugging purposes as I don't create scripts very often.
Perhaps someone could streamline or suggest edits.

Code: Select all

:global peername;
:global state;
/routing bgp peer
:foreach peer in=[find] do={
:set $peername [get $peer name];
:set $state [get $peer state];
:set $bridge "bridge_status-$peername";
:log info "bridge name = $bridge";
:if ([/interface find name=$bridge] = "") do={/interface bridge add name=$bridge disabled=no};
:if ($state!="established") do={/interface bridge set [find name=$bridge] disabled=yes} else={/interface bridge set [find name=$bridge] disabled=no};
}
:log info "Peer Name = $peername Status: $state bridge name=bgp_status-$peername"