BGPmon-Analytics-db-1
view release on metacpan or search on metacpan
bin/bgpmon_analytics_db_import view on Meta::CPAN
get_as4_path/;
use BGPmon::Fetch;
use BGPmon::Configure qw/configure parameter_value/;
use POSIX qw/strftime/;
use Data::Dumper;
BEGIN{
our $VERSION = '1.07';
};
#step 1: set up script args (DB name/credentials, data source, log file name,
#config file name)
#step 2: fetch data from the specified data source
#step 3: convert the XML to hashes
#step 4: grab the fields I'm interested in
#step 5: insert fields into DB staging table
#step 6: inject updates into main DB tables
my $db_name = 'bgpmon_db';
#This hash is for IP addresses to be mapped to collector names for
#disambiguation when importing updates
my %aliases = (
'128.223.51.15' => 'route-views4',
'2001:468:d01:33::80df:330f' => 'route-views4',
'129.82.138.6' => 'colostate-bgpmon'
);
use constant MAX_UPDATES_PER_INJECT => 1000;
#Define parameters for logging (filename, level, use syslog)
#Define parameters for system state (DB name,DB credentials, config filename)
#Define parameters for data retrieval (source, Fetch parameters)
my @params = (
{
'Name' => BGPmon::Configure::CONFIG_FILE_PARAMETER_NAME,
'Type' => BGPmon::Configure::FILE,
'Default' => './database-import.conf',
'Description' => 'The configuration file to use'
},
{
'Name' => 'database-name',
( run in 0.270 second using v1.01-cache-2.11-cpan-4d50c553e7e )