Community discussions

MikroTik App
 
fpascual
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Mon May 29, 2006 3:17 pm

Monitor BGP under WhatsUp

Mon Dec 04, 2006 2:51 pm

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.
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6697
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Mon Dec 04, 2006 3:28 pm

As far as I know, BGP menu does not provide any OID for SNMP monitoring.
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Mon Dec 04, 2006 5:45 pm

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.)
 
fpascual
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Mon May 29, 2006 3:17 pm

Mon Dec 04, 2006 7:28 pm

Thanks, I need to monitor only if BGP sessions are active, are this oid correct ?.
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Mon Dec 04, 2006 8:31 pm

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
 
galaxynet
Long time Member
Long time Member
Posts: 646
Joined: Fri Dec 17, 2004 2:52 pm
Contact:

Mon Dec 04, 2006 8:36 pm

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

thom.lawless@rapidwifi.com
 
fpascual
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Mon May 29, 2006 3:17 pm

Tue Dec 05, 2006 4:47 pm

Ok, understand, someone knows how to do that on a Whatsup ?
 
fpascual
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Mon May 29, 2006 3:17 pm

Wed Dec 06, 2006 8:03 pm

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
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Wed Dec 06, 2006 8:18 pm

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
 
fpascual
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Mon May 29, 2006 3:17 pm

Wed Dec 06, 2006 8:32 pm

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 ?
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Wed Dec 06, 2006 10:35 pm

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:

1. Add a blank bridge interface.
interface bridge> add name=b-peer-1 mtu=1000

2. 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...

3. 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}
4. 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
 
fpascual
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Mon May 29, 2006 3:17 pm

Thu Dec 07, 2006 3:56 pm

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<SAFE> :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
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Thu Dec 07, 2006 6:00 pm

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
 
fpascual
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Mon May 29, 2006 3:17 pm

Thu Dec 07, 2006 7:28 pm

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
 
fpascual
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Mon May 29, 2006 3:17 pm

Thu Dec 07, 2006 7:44 pm

Ok, I understand, the question is, how can I scheduled each ":if" statement and configure in permanent mode ?
 
fpascual
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Mon May 29, 2006 3:17 pm

Thu Dec 07, 2006 8:44 pm

Sam, works great !!, thanks a lot !.


Regards.
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Thu Dec 07, 2006 9:44 pm

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
 
fpascual
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Mon May 29, 2006 3:17 pm

Thu Dec 07, 2006 10:04 pm

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 !.