예제 #1
0
def import_delegated_stats(rir, w_date):
    ## Import delegated stats files
    print "====>> RUNNING: Import delegated stats files"
    if rir == "lacnic" or rir == "all":
        d = dlg.delegatedStats(rir='lacnic',
                               date=w_date,
                               db_filename=fname_base)
    if rir == "arin" or rir == "all":
        d = dlg.delegatedStats(rir='arin',
                               date=w_date,
                               db_filename=fname_base,
                               as_cache=True)
    if rir == "ripencc" or rir == "all":
        d = dlg.delegatedStats(rir='ripencc',
                               date=w_date,
                               db_filename=fname_base,
                               as_cache=True)
    if rir == "afrinic" or rir == "all":
        d = dlg.delegatedStats(rir='afrinic',
                               date=w_date,
                               db_filename=fname_base,
                               as_cache=True)
    if rir == "apnic" or rir == "all":
        d = dlg.delegatedStats(rir='apnic',
                               date=w_date,
                               db_filename=fname_base,
                               as_cache=True)
    print " "
    print "============================================="
 def setUp(self):
     if not self._setuponce_done:
         self.__class__.dsreader = delegatedStats(local_file="tmp/delegated-extended-lacnic-short")
         #self.__class__.dsreader = delegatedStats(rir="arin", date="latest")
         self.__class__._setuponce_done = True
     else:
         pass
"""
Generates daily delegated db dump for lacnic

:author: Carlos M. Martinez, [email protected]
:date: 20151228
:date: 20160523

"""

import sys
import lacniclabs.netdata.delegated as dlg
import lacniclabs.netdata.riswhois as rwh

## Import delegated stats files
d = dlg.delegatedStats(rir='lacnic', date='latest', db_filename='var/netdata-latest.db')
d = dlg.delegatedStats(rir='arin', date='latest', db_filename='var/netdata-latest.db', as_cache=True)
d = dlg.delegatedStats(rir='ripencc', date='latest', db_filename='var/netdata-latest.db', as_cache=True)
d = dlg.delegatedStats(rir='afrinic', date='latest', db_filename='var/netdata-latest.db', as_cache=True)
d = dlg.delegatedStats(rir='apnic', date='latest', db_filename='var/netdata-latest.db', as_cache=True)

## Import RISWHOIS
r = rwh.risWhois(date='latest', db_filename='var/netdata-latest.db')

sys.exit()
예제 #4
0
:date: 20170224 - fixed import roa data

"""

import sys
import lacniclabs.netdata.delegated as dlg
import lacniclabs.netdata.riswhois as rwh
import lacniclabs.netdata.riperpki as rpki  # import ripevalRoaData
from datetime import date

# set filename
fname_base = "var/netdata-%s.db" % (date.today())

## Import delegated stats files
print "====>> RUNNING: Import delegated stats files"
d = dlg.delegatedStats(rir='lacnic', date='latest', db_filename=fname_base)
d = dlg.delegatedStats(rir='arin',
                       date='latest',
                       db_filename=fname_base,
                       as_cache=True)
d = dlg.delegatedStats(rir='ripencc',
                       date='latest',
                       db_filename=fname_base,
                       as_cache=True)
d = dlg.delegatedStats(rir='afrinic',
                       date='latest',
                       db_filename=fname_base,
                       as_cache=True)
d = dlg.delegatedStats(rir='apnic',
                       date='latest',
                       db_filename=fname_base,