bgp uptime/downtime log

Unanswered Question
Nov 9th, 2012

Dear All,

is there any command to see bdp uptime/downtime log for a certain period, like for last 7 days or so.

i need to see for last 7 days how many times bgp got down and what time are those happened.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Average Rating: 0 (0 ratings)
skmparvez Fri, 11/09/2012 - 11:36

after configure "bgp log-neighbor-changes" under bgp, what will be command to see in next time? what was the down time ?

also please help me to write script for this configuration.

svalenga Fri, 11/09/2012 - 22:07

Hi Parvez,

You can use below methods, to get details about BGP neighbor state changes

1. #show log | in BGP (from router console)

2. #Depend on syslog server to which you are logging

3. Or use BGP SNMP event notifications. For this you can use SNMP server.

Thanks,

Sudeep

vinayk3 Mon, 11/12/2012 - 03:47

Hi ,

One other option is to get an EEM script that will notify you or send the logs in a file whenever BGP goes down.

Thanks

Vinay

skmparvez Mon, 11/12/2012 - 10:43

Dear Vinay,

can you please help me to write this EEM script?

Thanks

Parvez

vinayk3 Tue, 11/13/2012 - 23:54

Hi Parvez ,

Here is the EEM script that i have written for my BGP neighbor going down.

event manager applet BGP_Notify

event syslog pattern "%BGP-5-ADJCHANGE: neighbor 20.0.0.2 Down"

action 1.0 cli command "enable"

action 2.0 cli command "show clock | append bootdisk:bgplog.txt"

action 3.0 syslog msg "BGP Down"

So now look at the logs in  my router.

when i shut down my BGP neighor , EEM triggers and it alsonotify that BGP down.

TAM(config)#router bgp 1

TAM(config-router)#nei 20.0.0.2 shut

TAM(config-router)#

*Nov 14 13:19:15.894: %BGP-5-ADJCHANGE: neighbor 20.0.0.2 Down Admin. shutdown

*Nov 14 13:19:15.894: %BGP_SESSION-5-ADJCHANGE: neighbor 20.0.0.2 IPv4 Unicast topology base removed from session  Admin. shutdown

*Nov 14 13:19:16.322: %HA_EM-6-LOG: BGP_Notify: BGP Down

TAM(config-router)#

now look at the file that is created in bootdisk now

TAM#dir bootdisk:
Directory of bootdisk:/

    1  -rw-      249462  Jul 16 2012 04:38:14 +00:00  config-16jul
    2  -rw-      249382   Jul 6 2012 13:46:24 +00:00  config
    3  -rw-          72  Aug 27 2012 11:16:28 +00:00  BGP.TXT
    4  -rw-          36  Nov 14 2012 13:13:58 +00:00  bgplog.txt
    5  -rw-          36  Nov 14 2012 13:19:16 +00:00  bgpdown.txt <---- ( same name what i have configured )

lets check the file now.

TAM#more bootdisk:bgpdown.txt

*13:19:16.010 UTC Wed Nov 14 2012  <---- shows that time when it went down

Tried one more time and now my file has two entries

TAM(config-router)#nei 20.0.0.2 shut
TAM(config-router)#
*Nov 14 13:22:34.906: %BGP-5-ADJCHANGE: neighbor 20.0.0.2 Down Admin. shutdown
*Nov 14 13:22:34.906: %BGP_SESSION-5-ADJCHANGE: neighbor 20.0.0.2 IPv4 Unicast topology base removed from session  Admin. shutdown
*Nov 14 13:22:35.130: %HA_EM-6-LOG: BGP_Notify: BGP Down
TAM(config-router)#
TAM(config-router)#exit
TAM(config)#exit
TAM#more
*Nov 14 13:22:44.758: %SYS-5-CONFIG_I: Configured from console by console bootdisk:bgpdo
TAM#more bootdisk:bgpdown.txt
*13:19:16.010 UTC Wed Nov 14 2012


*13:22:34.918 UTC Wed Nov 14 2012 <------

HTH

Vinay

Actions

Login or Register to take actions

This Discussion

Posted November 9, 2012 at 10:31 AM
Stats:
Replies:7 Avg. Rating:
Views:1076 Votes:0
Shares:0
Tags: No tags.
Categories: Routers
+

Discussions Leaderboard