BGP-Ranking/bin/monitor.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 -*-
from bgpranking.monitor import Monitor
import logging
logging.basicConfig(format='%(asctime)s %(name)s %(levelname)s:%(message)s',
level=logging.INFO, datefmt='%I:%M:%S')
class MonitorManager():
def __init__(self, loglevel: int=logging.INFO):
self.monitor = Monitor()
def get_values(self):
generic = self.monitor.get_values()
prefix_cache = self.monitor.info_prefix_cache()
running = self.monitor.get_runinng()
return generic, prefix_cache, running
if __name__ == '__main__':
m = MonitorManager()
print(m.get_values())