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

Sudeep Valengattil 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.



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.



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

Dear Vinay,

can you please help me to write this EEM script?



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 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 shut


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

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

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


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 shut
*Nov 14 13:22:34.906: %BGP-5-ADJCHANGE: neighbor Down Admin. shutdown
*Nov 14 13:22:34.906: %BGP_SESSION-5-ADJCHANGE: neighbor IPv4 Unicast topology base removed from session  Admin. shutdown
*Nov 14 13:22:35.130: %HA_EM-6-LOG: BGP_Notify: BGP Down
*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 <------




This Discussion