Categorygithub.com/CSUNetSec/bgpmon
modulepackage
0.0.0-20190730192424-891f3ce14ace
Repository: https://github.com/csunetsec/bgpmon.git
Documentation: pkg.go.dev

# README

GoDoc Build Status Go Report Card

BGPmon is a client server application to store and analyze large amounts of BGP data.

Installation

Requirements

  1. Golang > 1.11
  2. make
  3. to store message a db backend (Postgresql >= 9.5)

Running make will create two binaries under bin. To run the daemon, run:

bgpmond conf-file

To succesfully store messages in a database please have a Postgresql with a user that has access to write create tables on a database and reflect that configuration in the config file.

Example client commands

The client works over RPC, so the rpc module must be started in order for the client to work.

To show configured sessions on the server

bgpmon listAvailable sessions

To open a configured session

bgpmon open session LocalPostgres -s sID

To write MRT files

bgpmon write sID mrtFiles...

To close a session

bgpmon close session sID

To see available modules and the options required to run them

bgpmon listAvailable modules

Example config file

DebugOut = "stdout"
ErrorOut = "stderr"

# Sessions represent the possible database backends
[Sessions]
#this will configure an available session named LocalPostgres
[Sessions.LocalPostgres]
Type = "postgres"
Hosts = ["localhost"]
Database = "bgpmon"
User = "bgpmon"
Password = "bgpmon"
WorkerCt = 4 #the maximum amount of concurrent workers
DBTimeoutSecs = 120 #maximum lifetime seconds for a DB operation

# Modules represent modules to run on startup
# Multiple modules of the same type can be instantiated with
# different IDs
[Modules]
# RPC exposes the basic bgpmond operation over an RPC interface that
# consumes and produces protocol buffers defined in the netsec-protobufs
# repository /bgpmon
[Modules.rpc1]
Type="rpc"
Args="-address :12289 -timeoutsecs 240"

# pprof enables the http profiler at an address specified by Args
[Modules.pprof1]
Type="pprof"
Args="-address localhost:6969"

# Nodes represent operator provided information for nodes involved in
# BGP transactions
# If there are already saved nodes in the database that conflict with the
# configuration, the configuration is preferred
[Nodes]
[Nodes."128.223.51.102"]
Name="routeviews2"
IsCollector=true
DumpDurationMinutes=1440
Descritption="routeviews.org routeviews2 collector"

# Packages

No description provided by the author
Package config defines the constants and functions necessary to parse configuration files for bgpmon.
Package db is responsible for the communication between the database backends and the bgpmon daemon.
Package modules defines commonly used modules for bgpmon.
Package util defines miscellaneous functions used in multiple parts of bgpmon or other projects.

# Functions

NewOpenModuleInfo returns an info struct with a type and a status, and leaves the ID to be populated by something else.
NewServer creates a BgpmondServer instance from a configuration.
NewServerFromFile does the same thing as NewServer, but loads the configuration from a specified file name.
RegisterModule adds a module type to a list of known modules.

# Constants

A daemon will run constantly, and won't stop until it is closed by the server.
A task will run until it's finished.

# Structs

ModuleHandler wraps the info and maker types.
ModuleInfo is used to describe an available module.
OpenModuleInfo describes an actively running module.
SessionHandle is used to return information on an open session.

# Interfaces

BgpmondServer is the interface for interacting with a server instance.
Module describes a service that can be started by the server.

# Type aliases

ModuleMaker is a function to instantiate a module.