Hi, I need to monitor the BGP state of my mk under a WhatsUp system, what’s the oid that need to put into them ?
Thanks a lot.
As far as I know, BGP menu does not provide any OID for SNMP monitoring.
You might be able to monitor the number of routes in the table or something ?
.1.3.6.1.2.1.4.24.3.0 = 60
(The number of current ipCidrRouteTable entries
that are not invalid.)
Or query for the OID of a route that you know should be there (and if not alarm?):
.1.3.6.1.2.1.4.21.1.9 = bgp
(The routing mechanism via which this route was
learned. Inclusion of values for gateway routing
protocols is not intended to imply that hosts
should support those protocols.)
Thanks, I need to monitor only if BGP sessions are active, are this oid correct ?.
That first OID is the number of active routes on the box … so no, I don’t think you can monitor BGP directly, but say if < x number of routes are present does that mean BGP is down? Not sure in your case what to monitor, but its a workaround to do it that way…
Sam
changeip - this is Galaxynet (Thom) - would you drop me a line off forum IRT multigateway config… I’ve been trying to catch up w/you since we exchanged a little info on this subject a few weeks ago…
R/
Thom
Ok, understand, someone knows how to do that on a Whatsup ?
The OID is .1.3.6.1.2.1.4.24.3.0, but, how can I identify the corresponding peer ?
$snmpwalk -Os -c [community] -v 1 IP_ADDRESS .1.3.6.1.2.1.4.24.3.0
$ip.24.3.0 = Gauge32: 7021
Sound like I receive 7021 routes, but from all the peers.
Thanks
Yes, exactly… if you have more than 1 peer it might not be easy to determine. If you are very determined you could setup a script to change a queue property (dummy queue) that you could then read from snmp … The script would determine up/down of bgp peer and change a queue (since queues are accessable via oid). Can be done, but not really that easily : ) Can whatsup perform SSH and command ?
Sam
Sam, no, don’t have options to make ssh.
In a whatsup cisco routers a bgp peer query OID.IP_PEER(oid[dot]ip_peer), can I do that in MK ?
How can I do to make an script for query via snmp ?
Unfortunately snmp oids are not plenty on mikrotik yet : ) It would be best if snmp oid could be queried and a :global variable on mikrotik could be handed back.
Hack this up and see what you get:
-
Add a blank bridge interface.
interface bridge> add name=b-peer-1 mtu=1000 -
Find its OID:
interface> print oid
14 R name=.1.3.6.1.2.1.2.2.1.2.41 mtu=.1.3.6.1.2.1.2.2.1.4.41
mac-address=.1.3.6.1.2.1.2.2.1.6.41
admin-status=.1.3.6.1.2.1.2.2.1.7.41
oper-status=.1.3.6.1.2.1.2.2.1.8.41
bytes-in=.1.3.6.1.2.1.2.2.1.10.41
packets-in=.1.3.6.1.2.1.2.2.1.11.41
discards-in=.1.3.6.1.2.1.2.2.1.13.41
errors-in=.1.3.6.1.2.1.2.2.1.14.41
bytes-out=.1.3.6.1.2.1.2.2.1.16.41
packets-out=.1.3.6.1.2.1.2.2.1.17.41
discards-out=.1.3.6.1.2.1.2.2.1.19.41
errors-out=.1.3.6.1.2.1.2.2.1.20.41
Now the MTU oid can be used to check value with whatsup or other snmp monitoring…
- Run / schedule this script for how often you want that to update.
:if ([/routing bgp peer get [/routing bgp peer find name=cymru] state ] = established) do={/int bridge set [/int bridge find name=b-peer-1] mtu=1000} else={/int bridge set [/int bridge find name=b-peer-1] mtu=1001}
- Use whats up to query OID mtu=.1.3.6.1.2.1.2.2.1.4.41 - if MTU = 1000 its up, if its 1001 its down.
Kind of a hack, but very possible. I’m sure the script could be enhanced to automatically update multiple at once but this was a quicky. Possibly name the bridge with a psuedo name of the bgp peer and it would run thru all of them.
Sam
Sam, thanks a lot, but, how can I identify between my 6 bgp peers ?, I must to create 6 bridge interfaces and 6 scripts ?.
When I put the script receive an error message
] system scheduler :if ([/routing bgp peer get [/routing bgp peer find name=cymru] state ] = established) do={/int bridge set [/int bridge find name=b-peer-1] mtu=1000} else={/int bridge set [/int bridge fi
nd name=b-peer-1] mtu=1001}
“invalid item number”
What I doing wrong ?
Thanks
You need to change out “cymru” for the name of your peer.
You need to change out “b-peer-1” for the name of the bridge that you setup.
If there is a number of peers you will need 1 bridge for each peer. This could all be done in the same script however. If you need more help let me know
Sam
Sam, the “:if” statements must be configured in /system scheduler path ?.
I put the six “:if” with right configuration but doesn’t works, how can I view the sentences ?. Do you understand me ?
Thanks
Ok, I understand, the question is, how can I scheduled each “:if” statement and configure in permanent mode ?
Sam, works great !!, thanks a lot !.
Regards.
You should first put those lines into a script, then schedule the script in another command… the scheduler doesn’t seem to like full blown scripts.
Glad you are following along : )
Sam
Yes yes, it’s a great idea.
Thanks a lot !.