예제 #1
0
 def __init__(self, db, executor, api_user, api_key, sender, endpoint):
     super(MailAgent, self).__init__(db)
     self.mail_proxy = MailProxy(api_user=api_user,
                                 api_key=api_key,
                                 sender=sender,
                                 endpoint=endpoint)
     self.executor_driver_name = executor
     self.executor = get_executor(executor)
예제 #2
0
파일: sms_agent.py 프로젝트: QthCN/hmonitor
 def __init__(self, db, executor, username, password,
              epid, endpoint, charset="gb2312"):
     super(SmsAgent, self).__init__(db)
     self.sms_proxy = SmsProxy(username=username,
                               password=password,
                               epid=epid,
                               endpoint=endpoint,
                               charset=charset)
     self.executor_driver_name = executor
     self.executor = get_executor(executor)
예제 #3
0
파일: manager.py 프로젝트: znavy/hmonitor
    def __init__(self, worker=8, executor="ssh"):
        self.worker = worker
        self.executor_driver_name = executor
        self.executor = get_executor(executor)
        self.db = HMonitorDB(mysql_user=options.mysql_user,
                             mysql_passwd=options.mysql_password,
                             mysql_host=options.mysql_host,
                             mysql_database=options.mysql_database)

        self.queue = Queue.Queue()

        for w in range(0, self.worker):
            t = threading.Thread(target=self.do_autofix)
            t.daemon = True
            t.start()
        logging.debug("START {0} WORKERS FOR AUTOFIX".format(self.worker))
예제 #4
0
 def __init__(self,
              db,
              executor,
              username,
              password,
              epid,
              endpoint,
              charset="gb2312"):
     super(SmsAgent, self).__init__(db)
     self.sms_proxy = SmsProxy(username=username,
                               password=password,
                               epid=epid,
                               endpoint=endpoint,
                               charset=charset)
     self.executor_driver_name = executor
     self.executor = get_executor(executor)
예제 #5
0
파일: manager.py 프로젝트: QthCN/hmonitor
    def __init__(self, worker=8, executor="ssh"):
        self.worker = worker
        self.executor_driver_name = executor
        self.executor = get_executor(executor)
        self.db = HMonitorDB(mysql_user=options.mysql_user,
                             mysql_passwd=options.mysql_password,
                             mysql_host=options.mysql_host,
                             mysql_database=options.mysql_database)

        self.queue = Queue.Queue()

        for w in range(0, self.worker):
            t = threading.Thread(target=self.do_autofix)
            t.daemon = True
            t.start()
        logging.debug("START {0} WORKERS FOR AUTOFIX".format(self.worker))
예제 #6
0
파일: manager.py 프로젝트: znavy/hmonitor
 def __init__(self, db, executor, url):
     self.db = db
     self.executor_driver_name = executor
     self.executor = get_executor(executor)
     self.autofix_url = url
예제 #7
0
파일: manager.py 프로젝트: QthCN/hmonitor
 def __init__(self, db, executor, url):
     self.db = db
     self.executor_driver_name = executor
     self.executor = get_executor(executor)
     self.autofix_url = url