BGPmon-core-1

 view release on metacpan or  search on metacpan

bin/bgpmon_filter  view on Meta::CPAN

$rThread = threads->create('reader');

log_info("Starting parsing thread.");
$pThread = threads->create('parser');

log_info("Starting TCP listening thread.");
$tcpListThread = threads->create('tcpListener');

if($dbToRefresh){
	log_info("Starting the timing thread for refreshing the database.");
	$timeThread = threads->create('timer');

	$timeThread->join();
	log_info("Timing thread stopped sucessfully.");
}

$rThread->join();
$pThread->join();
$tcpListThread->join();


bin/bgpmon_filter  view on Meta::CPAN

				MYFILE->autoflush(1);
			}
		}

	}

	print "Parser thread finished.\n" unless !$debug
}


sub timer{
	while(!$exit){
		log_info("Critical Prefixes will be refreshed in $dbrefresh minutes.");
		Time::HiRes::sleep($dbrefresh*60); # will sleep for $dbrefresh minutes.
		log_info("Refreshing Critical Prefixes.");
		my $res = BGPmon::Filter::parse_database_config($dbListName); #calling the update
		#TODO add in error checks

		logFilterSize();
	}
}

t/09-bgpmon-fetchdata-archive.t  view on Meta::CPAN

                                                     1338552838);
is($ret,1,'connect_archive - missing argument');
is(BGPmon::Fetch::Archive::get_error_code("connect_archive"),401,
"connect_archive - missing argument");

#Test for invalid start/end times
$ret = BGPmon::Fetch::Archive::connect_archive("data.ripe.ris.net/rrs13",
                                                1338552838,1338550000);
is($ret,1,'connect_archive - invalid interval');
is(BGPmon::Fetch::Archive::get_error_code("connect_archive"),406,
"connect_archive - invalid timerange");

$ret = BGPmon::Fetch::Archive::connect_archive("data.ripe.ris.net/rrs13",
                                                -1338552838,1338550000);
is($ret,1,'connect_archive: negative start time');
is(BGPmon::Fetch::Archive::get_error_code("connect_archive"),406,
"connect_archive - invalid timerange");

#Test for incorrectly-formatted start/end times
$ret = BGPmon::Fetch::Archive::connect_archive("data.ripe.ris.net/rrs13",
                                                "Mar 13 2011 12:34:56",
                                                "Apr 1 2011 11:11:11");
is($ret,1,'connect_archive: string time format');
is(BGPmon::Fetch::Archive::get_error_code("connect_archive"),406,
"connect_archive - invalid timerange");

#Test for illegal characters in argument
my $illegal = chr(0x90).chr(0x90).chr(0x90).chr(0x90).chr(0x90);
$ret = BGPmon::Fetch::Archive::connect_archive("data.ris.ripe.net/$illegal",
                                              1338508800,1340150400);
is($ret,1, "connect_archive - invalid character in URL");
is(BGPmon::Fetch::Archive::get_error_code("connect_archive"),406,
"connect_archive - invalid character URL");




( run in 0.532 second using v1.01-cache-2.11-cpan-49f99fa48dc )