BGP-Ranking/bin/rislookup.py

26 lines
649 B
Python
Raw Normal View History

2018-03-29 22:37:28 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
2018-03-30 14:33:33 +02:00
from bgpranking.abstractmanager import AbstractManager
2018-03-29 22:37:28 +02:00
from bgpranking.risfetcher import RISPrefixLookup
logging.basicConfig(format='%(asctime)s %(name)s %(levelname)s:%(message)s',
level=logging.INFO, datefmt='%I:%M:%S')
2018-03-30 14:33:33 +02:00
class RISLookupManager(AbstractManager):
2018-03-29 22:37:28 +02:00
def __init__(self, loglevel: int=logging.INFO):
2018-03-30 14:33:33 +02:00
super().__init__(loglevel)
2018-03-29 22:37:28 +02:00
self.ris_fetcher = RISPrefixLookup(loglevel=loglevel)
2018-03-30 14:33:33 +02:00
def _to_run_forever(self):
2018-03-29 22:37:28 +02:00
self.ris_fetcher.run()
if __name__ == '__main__':
2018-03-30 14:33:33 +02:00
rislookup = RISLookupManager()
rislookup.run(120)