def __init__(self, filename="/etc/otomat/otomat.cnf", graph=None, title="北京壹號車 系統報告"): self.filename = filename cnf = conf.files_conf_check(self.filename) # rrdtool self.rrdtool_cpu = cnf.rrdtool_cpu() self.rrdtool_mem = cnf.rrdtool_mem() self.rrdtool_disk = cnf.rrdtool_disk() self.rrdtool_host = cnf.rrdtool_host() self.rrdtool_dir = cnf.rrdtool_dir() self.rrdtool_nic = cnf.rrdtool_nic() # graph self.graph_cpu = cnf.graph_cpu() self.graph_mem = cnf.graph_mem() self.graph_disk = cnf.graph_disk() self.graph_network = cnf.graph_network() self.graph = graph self.title = title # sql self.host = cnf.sql_host() self.user = cnf.sql_user() self.password = cnf.sql_password() self.defaultdb = cnf.sql_defaultdb()
def __init__(self,report_file = "report",filename = "otomat.cnf"): self.filename = filename cnf = conf.files_conf_check(self.filename) self.path = cnf.server_report_path() print self.path self.report = report_file print self.report
def __init__(self, report_file="report", filename="otomat.cnf"): self.filename = filename cnf = conf.files_conf_check(self.filename) self.path = cnf.server_report_path() print self.path self.report = report_file print self.report
def __init__(self, filename=None): self.filename = filename cnf = conf.files_conf_check(self.filename) self.port = cnf.server_port() self.host = cnf.server_ip() #ThreadPool self.MaxThreads = 5 self.lockpool = Lock() #self.queue = [] self.sem = Semaphore(0)
def __init__(self, filename=None): self.filename = filename cnf = conf.files_conf_check(self.filename) self.port = cnf.server_port() self.host = cnf.server_ip() #ThreadPool self.MaxThreads = 5 self.lockpool = Lock() #self.queue = [] self.sem = Semaphore(0)
def __init__(self, filename="otomat.cnf"): #recive_report.__init__(self) self.filename = filename cnf = conf.files_conf_check(self.filename) self.port = cnf.server_port() self.host = cnf.server_ip() self.sql_host = cnf.sql_host() self.sql_user = cnf.sql_user() self.sql_password = cnf.sql_password() self.sql_defdb = cnf.sql_defaultdb() #ThreadPool self.MaxThreads = cnf.server_worker()
def __init__(self, filename=None): self.filename = filename cnf = conf.files_conf_check(self.filename) self.port = cnf.server_port() self.ip = cnf.server_ip() # 线程池 self.MAXTHREADS = 5 self.lockpool = Lock() self.busylist = {} self.waitinglist = {} self.queue = [] self.sem = Semaphore(0)
def __init__(self, filename=None): self.filename = filename cnf = conf.files_conf_check(self.filename) self.port = cnf.server_port() self.ip = cnf.server_ip() # 线程池 self.MAXTHREADS = 5 self.lockpool = Lock() self.busylist = {} self.waitinglist = {} self.queue = [] self.sem = Semaphore(0)
def __init__(self, filename="otomat.cnf"): #recive_report.__init__(self) self.filename = filename cnf = conf.files_conf_check(self.filename) self.port = cnf.server_port() self.host = cnf.server_ip() self.sql_host = cnf.sql_host() self.sql_user = cnf.sql_user() self.sql_password = cnf.sql_password() self.sql_defdb = cnf.sql_defaultdb() #ThreadPool self.MaxThreads = cnf.server_worker()
def __init__(self,filename="/etc/otomat/otomat.cnf",graph=None,title="北京壹號車 系統報告"): self.filename = filename cnf = conf.files_conf_check(self.filename) # rrdtool self.rrdtool_cpu = cnf.rrdtool_cpu() self.rrdtool_mem = cnf.rrdtool_mem() self.rrdtool_disk = cnf.rrdtool_disk() self.rrdtool_host = cnf.rrdtool_host() self.rrdtool_dir = cnf.rrdtool_dir() self.rrdtool_nic = cnf.rrdtool_nic() # graph self.graph_cpu = cnf.graph_cpu() self.graph_mem = cnf.graph_mem() self.graph_disk = cnf.graph_disk() self.graph_network = cnf.graph_network() self.graph = graph self.title = title # sql self.host = cnf.sql_host() self.user = cnf.sql_user() self.password = cnf.sql_password() self.defaultdb = cnf.sql_defaultdb()
#-*- encoding: utf-8 -*- import os import time import sys import traceback import os import socket from otomat.conf import conf from threading import * from Queue import Queue from otomat.sql import otomat_sql from otomat.logs import log as logging queue=Queue() #create queue # cnf =conf.files_conf_check('/etc/otomat/otomat.cnf') logfile = cnf.server_log() logdir = cnf.server_logdir() if not os.path.exists(logdir): os.makedirs(logdir,0o755) os.chdir(logdir) logging.set_logger(filename =logfile, mode = 'a') ''' class recive_report: def __init__(self,report_file = "/tmp/report",filename = None,data= None): #self.filename = filename #cnf = conf.files_conf_check(self.filename)
def __init__(self, filename = '/etc/otomat/otomat.cnf'): self.filename = filename cnf = conf.files_conf_check(self.filename) self.port = cnf.server_port() self.host = cnf.server_ip() self.client_nic = cnf.nic_port()
#_*_ coding: UTF-8 _*_ import sys, time, os reload(sys) sys.setdefaultencoding('utf8') import rrdtool import random import time import MySQLdb from otomat.conf import conf from otomat.debug import log as logging cnf = conf.files_conf_check('/etc/otomat/otomat.cnf') logfile = cnf.report_log() logdir = cnf.server_logdir() if not os.path.exists(logdir): os.makedirs(logdir, 0o755) os.chdir(logdir) logging.set_logger(filename=logfile, mode='a') class graph_rrdtool: """ rrdtool 绘图过程一共有四步: 1.创建rrdtool数据库 2.插入rrdtool所需的数据 3.更新rrdtool数据库 4.进行rrdtool绘图。 """ def __init__(self,
def __init__(self, filename = '/etc/otomat/otomat.cnf'): self.filename = filename cnf = conf.files_conf_check(self.filename) self.port = cnf.server_port() self.host = cnf.server_ip() self.client_nic = cnf.nic_port()
def __init__(self,filename=None): self.filename = filename cnf = conf.files_conf_check(self.filename) self.port = cnf.server_port() self.ip = cnf.server_ip()
def __init__(self, filename=None): self.filename = filename cnf = conf.files_conf_check(self.filename) self.port = cnf.server_port() self.ip = cnf.server_ip()