bgpmon-filter.pl - Critical Prefix parser
This script can connect to a BGPmon instance and filter messages that match given critical prefixes. These messages can then be sent to other clients that connect to this instance, can be saved to a file, or printed to standard out.
This script allows one to specify a set of configuration parameters and a list of desired critical prefixes or autonomous system numbers. This script will then connect to the specified instance of BGPmon and filter the messages it receives. If a given message has data for one of our given prefixes or any address within that prefix, it will pass it along to other cliences connected to it, print it to standard out, or save it to a file. These are options the user may set before running an instance.
This will read from a default configuration file located at /usr/local/etc/bgpmon-analytics.conf. Below is an example of a full configuration file:
config_file = /usr/local/etc/bgpmon-filter.confg output_file = /tmp/bgpmon-filter-output.txt prefix_file = /usr/local/etc/bgpmon-filter-prefixes.conf log_file = /tmp/bgpmon-filter-log.log log_level = 7 server = bgpmon2.netsec.colostate.edu port = 50001 listening_port= 60000 stdout = 1
This configuration will connect to a BGPmon instance at bgpmon2.netsec.colostate.edu:50000 and will listen for connections on 60000. It will look for a list of critical prefixes to filter in file /usr/local/etc/bgpmon-filter-prefixes.conf. All messages that match the prefixes will be printed to standard out and will be saved in file /tmp/bgpmon-filter-output.txt. Note that if you have a configuration file already and want to change variables for a run, you may do so using command line arguments. They will override any variables set from the configuration file. You may see a list of all options by running ./bgpmon-filter.pl -h.
The following is an example of the critical prefix configuration file:
ipv4 184.108.40.206/24 ms as 1733 ipv6 2a02:1378::/32 ls
You may have multiple prefixes of all kinds and don't have to be in any order within the file. For mor information on this file configuration, please see the perldoc for BGPmon::Filter.pm.
M. Lawrence Weikum, "firstname.lastname@example.org"
Please report any bugs or feature requests to "email@example.com".
You may find documentation help for this script with the perldoc command.
Copyright (c) 2012 Colorado State University
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.