Skip to main content

BGP rib timeseries recording tool

Project description

bgp route collector

Create a BGP RIB time series database from MRT format dump files.

how to deploy

docker

  1. Create docker-compose.yml with reference to docker-compose.sample.yml.
  2. Create .env
BGPRECORDER_DB_HOST=postgres
BGPRECORDER_DB_PORT=5432
BGPRECORDER_DB_NAME=bgprecorder
BGPRECORDER_DB_USER=postgres
BGPRECORDER_DB_PASSWORD=PASSWORD

  1. run
docker-compose up -d

native install

TBD

CLI tool

bgprecord

$ bgprecorder  -h 
usage: bgprecorder [-h] [-H DB_HOST] [-p DB_PORT] [-u DB_USER] [-w DB_PASSWORD] [-d DB_NAME] [-c COMPRESS] [-i DURATION] [-f MRT_DUMP_FILES]

bgprecord dump BGP MRT rib to DB

optional arguments:
  -h, --help            show this help message and exit
  -H DB_HOST, --db_host DB_HOST
                        db host. default: localhost or $BGPRECORDER_DB_HOST
  -p DB_PORT, --db_port DB_PORT
                        db port. default: 5432 or $BGPRECORDER_DB_PORT
  -u DB_USER, --db_user DB_USER
                        db user. default: postgres or $BGPRECORDER_DB_USER
  -w DB_PASSWORD, --db_password DB_PASSWORD
                        db password. default: None or $BGPRECORDER_DB_PASSWORD
  -d DB_NAME, --db_name DB_NAME
                        db name. default: bgprecorder or $BGPRECORDER_DB_RECORDER
  -c COMPRESS, --compress COMPRESS
                        compress MRT dump after import. default: False
  -i DURATION, --duration DURATION
                        interval of recording (sec.) default: 3600 or $BGPRECORDER_DURATION
  -f MRT_DUMP_FILES, --mrt_dump_files MRT_DUMP_FILES
                        target MRT dumpfile match rule. default: ./mrt/*.dump or $BGPRECORDER_DURATION
$ bash misc/env.sh
$ bgprecord 

bgpquery

$ bgpquery  -h 
usage: bgpquery [-h] -a ADDRESS [-t DATETIME] [-H DB_HOST] [-p DB_PORT] [-u DB_USER] [-w DB_PASSWORD] [-d DB_NAME]

bgpquery: get BGP rib json from bgprecorder db

optional arguments:
  -h, --help            show this help message and exit
  -a ADDRESS, --address ADDRESS
                        target address
  -t DATETIME, --datetime DATETIME
                        target datetime. example: "200601021504"
  -H DB_HOST, --db_host DB_HOST
                        db host. default: localhost or $BGPRECORDER_DB_HOST
  -p DB_PORT, --db_port DB_PORT
                        db port. default: 5432 or $BGPRECORDER_DB_PORT
  -u DB_USER, --db_user DB_USER
                        db user. default: postgres or $BGPRECORDER_DB_USER
  -w DB_PASSWORD, --db_password DB_PASSWORD
                        db user. default: None or $BGPRECORDER_DB_PASSWORD
  -d DB_NAME, --db_name DB_NAME
                        db user. default: bgprecorder or $BGPRECORDER_DB_RECORDER
$ bash misc/env.sh
$ bgpquery -a 3ffe::114  -d 202207131800  | jq
{
  "id": 13735,
  "time": "2022-07-13T17:00:32",
  "path_id": 3204,
  "type_name": "TABLE_DUMP2_AP",
  "sequence": null,
  "from_ip": "2001:200:e00:300:dad::4",
  "from_as": 0,
  "originated": null,
  "origin": "IGP",
  "aspath": "400 300",
  "nlri_type": null,
  "nlri": "3ffe::/32",
  "nexthop": "2001:db8::ace",
  "community": "4690:64500",
  "large_community": null
}
{
  "id": 13736,
  "time": "2022-07-13T17:00:32",
  "path_id": 4634,
  "type_name": "TABLE_DUMP2_AP",
  "sequence": null,
  "from_ip": "2001:200:e00:300:dad::5",
  "from_as": 0,
  "originated": null,
  "origin": "IGP",
  "aspath": "100 200 300",
  "nlri_type": null,
  "nlri": "3ffe::/32",
  "nexthop": "2001:db8::beaf",
  "community": "4690:64501",
  "large_community": null
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bgprecorder-0.1.4.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

bgprecorder-0.1.4-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file bgprecorder-0.1.4.tar.gz.

File metadata

  • Download URL: bgprecorder-0.1.4.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b3 CPython/3.8.13 Linux/5.13.0-1031-azure

File hashes

Hashes for bgprecorder-0.1.4.tar.gz
Algorithm Hash digest
SHA256 4faf01538a2428c5c477b88427138f5f8fe66417f440cb880150ec9cf771e55d
MD5 d180495cb6564f6f2ed5caa44834f9bd
BLAKE2b-256 9e10499f696af11a60c15c61f5ed209f907c04d4c0703fa74e593d806208a6e7

See more details on using hashes here.

File details

Details for the file bgprecorder-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: bgprecorder-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b3 CPython/3.8.13 Linux/5.13.0-1031-azure

File hashes

Hashes for bgprecorder-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b31b08f4e8f68fe6ff919aec8fa4932612e240f274f2af8292cea8c2021ebeed
MD5 3a845cb9a8cde861377c578630107c4d
BLAKE2b-256 3b258297eb16b6371a451148e17a175406331d9ff0db8263a3570dc68a55fe49

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page