示例#1
0
 def __init__(self, path):
     self.path = path
     self.db = database.MySQLDatabase()
     self.mac_address = self.get_mac_address()
     self.ip_address = self.get_ip_address()
     self.probe_id = self.get_probe_id()
     self.setup_probe()
     self.find_my_status()
示例#2
0
 def __init__(self, path):
     self.path = path
     self.mac_address = self.get_mac_address()
     self.db = database.MySQLDatabase()
     self.ip = self.get_ip()
     self.id = self.get_probe_id(self.mac_address)
     self.set_probe()
     self.worker()
示例#3
0
 def __init__(self, path):
     LOCAL_DIR = '/root/release3/'
     REMOTE_DIR = '/root/release3_service/'
     self.path = path
     self.mac_address = self.get_mac_address()
     self.db = database.MySQLDatabase()
     self.ip = self.get_ip()
     self.id = self.get_probe_id()
     self.set_probe()
     self.worker()
示例#4
0
 def __init__(self, service_id, probe_id, cluster_id, transport_protocol=None, file_cmd=None, file_name=None,
              udp_cmd=None, path=None, **kwargs):
     self.service_id = service_id
     self.probe_id = probe_id
     self.cluster_id = cluster_id
     self.transport_protocol = transport_protocol
     self.file_cmd = file_cmd
     self.file_name = file_name
     self.udp_cmd = udp_cmd
     self.path = path
     self.db = database.MySQLDatabase()
     self.info_test_result = []  # list of data for insert
     self.collect_data()
 def __init__(self,
              service_id,
              probe_id,
              collection_id,
              transport_protocol=None,
              file_cmd=None,
              file_name=None,
              udp_cmd=None,
              path=None,
              **kwargs):
     self.service_id = service_id
     self.probe_id = probe_id
     self.collection_id = collection_id  ### do this
     self.transport_protocol = transport_protocol
     self.file_cmd = file_cmd
     self.file_name = file_name
     self.udp_cmd = udp_cmd
     self.path = path
     self.db = database.MySQLDatabase()
     self.collect_data()
import string
import database as maria
import sys
import time

# FILE_PATH = "/tmp/register.reg"
# if os.stat(FILE_PATH).st_size == 0:
#     id = ''.join(random.choice(string.ascii_uppercase + string.digits) for i in range(16))
#     open(FILE_PATH, "wb").write(id)
# else:
#     id = open(FILE_PATH, "r").readline()
# print id
#
# print os.path.dirname(sys.argv[0])

db = maria.MySQLDatabase()

NAME = 'MACos'
IP = '192.254.51.102'
MAC = '00:50:56:ad:51:1f'
TIME = time.strftime('%Y-%m-%d %H:%M:%S')


def insert_probe(probe_temp_id):
    sql = "INSERT INTO PROBES VALUES ('{probe_id}', '{name}', '{ip}', '{mac}', '{status}', '{last_update}', '{date_add}', '{collection_id}') ON DUPLICATE KEY UPDATE `last_updated`=NOW()".format(
        probe_id=probe_temp_id,
        name=NAME,
        ip=IP,
        mac=MAC,
        status=3,
        last_update=TIME,
示例#7
0
 def __init__(self):
     self.db = maria.MySQLDatabase()
 def __init__(self, service_id, probe_id, command):
     self.service_id = service_id
     self.probe_id = probe_id
     self.command = command
     self.db = database.MySQLDatabase()
     print self.collect_data()