예제 #1
0
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import sys
import redis

from nicelogging import logger
from utils import *
from options import *


load_options()
if options.db_unix_socket:
	logger.info("(*) Connessione a Redis: db %d socket unix %s...", options.db_num, options.db_unix_socket)
	redisdb = redis.Redis(unix_socket_path=options.db_unix_socket, db=options.db_num)
else:
	logger.info("(*) Connessione a Redis: db %d host %s:%d...", options.db_num, options.db_host, options.db_port)
	redisdb = redis.Redis(host=options.db_host, port=options.db_port, db=options.db_num)

# Attributes
attribute_description = {}
"""attribute_description = {
	"mac": "Indirizzo MAC",
	"ip": "Indirizzo IP",
	# NetBIOS
	"netbios.name": "Netbios name",
	# DHCP
	"dhcp.hostname": "DHCP hostname",
	"dhcp.vendor": "DHCP vendor",
	# Dropbox
	"dropbox.host.int": "Dropbox host int",
예제 #2
0
def load_options():
	if os.path.isfile(options.config):
		logger.info("(*) Leggo il file di configurazione %s", options.config)
		tornado.options.parse_config_file(options.config)
	tornado.options.parse_command_line()