From 18738e1b437aad7d30eb4fd6687ff3e7b0c77a17 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Tue, 10 May 2016 11:10:47 +0900 Subject: server: log the change of admin state via config file Signed-off-by: FUJITA Tomonori --- server/server.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'server') diff --git a/server/server.go b/server/server.go index bb1459b7..c69b6b76 100644 --- a/server/server.go +++ b/server/server.go @@ -2448,6 +2448,15 @@ func (server *BgpServer) handleUpdateNeighbor(c *config.Neighbor) ([]*SenderMsg, sub := uint8(bgp.BGP_ERROR_SUB_OTHER_CONFIGURATION_CHANGE) if original.Config.AdminDown != c.Config.AdminDown { sub = bgp.BGP_ERROR_SUB_ADMINISTRATIVE_SHUTDOWN + state := "Admin Down" + if c.Config.AdminDown == false { + state = "Admin Up" + } + log.WithFields(log.Fields{ + "Topic": "Peer", + "Key": peer.ID(), + "State": state, + }).Info("update admin-state configuration") } else if original.Config.PeerAs != c.Config.PeerAs { sub = bgp.BGP_ERROR_SUB_PEER_DECONFIGURED } -- cgit v1.2.3