Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

bgp uptime/downtime log

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.

7 REPLIES
Silver

bgp uptime/downtime log

if you configured "bgp log-neighbor-changes" under bgp, you should see it in the logs. If it is not configured, please do so, so it can help you next time in troubleshooting....

---

Posted by WebUser Neeraj Jagga from Cisco Support Community App

Silver

bgp uptime/downtime log

if you configured "bgp log-neighbor-changes" under bgp, you should see it in the logs. If it is not configured, please confgure it so it can be of help next time you troubleshoot.

---

Posted by WebUser Neeraj Jagga from Cisco Support Community App

New Member

Re: bgp uptime/downtime log

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.

Cisco Employee

bgp uptime/downtime log

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

Bronze

bgp uptime/downtime log

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

New Member

bgp uptime/downtime log

Dear Vinay,

can you please help me to write this EEM script?

Thanks

Parvez

Bronze

bgp uptime/downtime log

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

4714
Views
0
Helpful
7
Replies